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

Keycodes don't match #18

Closed
esperancaJS opened this issue May 2, 2017 · 5 comments
Closed

Keycodes don't match #18

esperancaJS opened this issue May 2, 2017 · 5 comments

Comments

@esperancaJS
Copy link

They don't match :

  • on different listener events
  • with keys from the browser

If you tell me a way to go about fixing this correctly I might be able to help.

@samylaumonier
Copy link

In the README, when you press "d" the keycode is 46:
{ keychar: 'd', keycode: 46, rawcode: 8, type: 'keydown' }

When I press "d", the keycode I get is 32:
{ keycode: 32, rawcode: 2, type: 'keydown' }

Why? How can I convert a keycode or a rawcode to a char? Here is the values I have: (KC for keycode, RC for rawcode)

# KC RC
a 16 12
b 48 11
c 46 8
d 32 2
e 18 14
f 33 3
g 34 5
h 35 4
i 23 34
j 36 38
k 37 40
l 38 37
m 39 41
n 49 45
o 24 31
p 25 35
q 30 0
r 19 15
s 31 1
t 20 17
u 22 32
v 47 9
w 44 6
x 45 7
y 21 16
z 17 13

Thanks!

@WilixLead
Copy link
Member

This data generate libuiohook try ask this question in this repo.
I don't control this data in my module. I think, it relate by OS and locale settings.

PS. This is key definition. Try research this file. May be it help you.

@solderzzc
Copy link

libuiohook is using Key Number of Linux Keycode Table

@WilixLead
Copy link
Member

In future I plan add matching table for different OS's in node.js side.
If anybody what to help me, pull-request welcome :)

@wurikiji
Copy link

Though this thread is closed, I really thank @solderzzc for giving us a real keycode table. I appreciate it.
Now, I could build my keyboard/mouse event hooker.
Love you @WilixLead for implementing this fantastic iohook npm library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants