Page 1 of 1

[0.17.3][keybind] Macro keys have same scancode as other keyboard keys

Posted: Thu Feb 28, 2019 10:25 pm
by mstmar
I've seen a lot of posts about keycode vs scancode messing up keyboard keys, so related, but nothing specifically about macro keys.

I have an alienware keyboard with macro keys, which can be configured to press key combinations like ctrl+c with one key. When i press them however, they send the ctrl+c command like its supposed to, but also act like one of the e, r, t, y, u, i, o, [ or ] keys (depending on which macro key is pressed). e.g. pressing macro 1 is like pressing ctrl+c and e at the same time. This happens regardless of whether a macro is assigned to anything or not, so a disabled macro 1 will just send e key. If nothing has been set to the e key (in game's control settings), then macro 1 just sends ctrl+c.

a few things that might be useful

none of the macro keys act like p. so macro 7 = o but macro 8 isn't p, it skips to [.

pressing the macro 1 key sends this key event (in java):
java.awt.event.KeyEvent[KEY_PRESSED,keyCode=0,keyText=Unknown keyCode: 0x0,keyChar=Undefined keyChar,keyLocation=KEY_LOCATION_STANDARD,rawCode=255,primaryLevelUnicode=0 ,scancode=18,extendedKeyCode=0x0]

followed by more key events for whatever keys it has binded to it (e.g. key event for ctrl then key event for c).

pressing e sends this key event:
java.awt.event.KeyEvent[KEY_PRESSED,keyCode=69,keyText=E,keyChar='e',keyLocation=KEY_LOCATION_STANDARD,rawCode=69,primaryLevelUnicode=101,scancode=18,extendedKeyCode=0x45]

the other macros keys' events are identical except scancode = 19-27 for macros 2-9, skipping scancode = 25 for some reason, which would explain the missing p.

Re: [0.17.3][keybind] Macro keys have same scancode as other keyboard keys

Posted: Tue Apr 16, 2019 8:07 am
by posila
Thanks for the report.
However, I belive it is problem of the keyboard driver and it shouldn't emit same scancodes for keys that are supposed to do different things.