Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

event.data includes a newline #2

Closed
FlorianWendelborn opened this issue Dec 29, 2015 · 3 comments
Closed

event.data includes a newline #2

FlorianWendelborn opened this issue Dec 29, 2015 · 3 comments
Labels

Comments

@FlorianWendelborn
Copy link
Contributor

(tested on Kubuntu 15)
Awesome module, but unfortunately every event includes a newline in the data field.

index.js

var gkm = require('gkm');

gkm.events.on('key.pressed', function (data) {
    console.log('\'' + data + '\'')
    console.log(this.event + ' ' + data);
});

output

'D
'
key.pressed D

Guess that's not intended, makes it much harder to work with at least.

@tomzx
Copy link
Owner

tomzx commented Dec 29, 2015

@dodekeract, in gkm.js, could you try replacing the regex on line 13 from \r\n to \r\n|\r|\n and let me know if that fixes your issue?

@tomzx tomzx added the bug label Dec 29, 2015
@FlorianWendelborn
Copy link
Contributor Author

Yeah, will verify that later today or tomorrow, will submit a pull-request if that fixes it.

@tomzx
Copy link
Owner

tomzx commented Dec 30, 2015

Closed per #3. Thanks again.

@tomzx tomzx closed this as completed Dec 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants