Media keys are not recognised as valid keys for rebinding
As far as I've tested, most multimedia keys don't appear to be recognised by classicube at all, even though many other programs (including Minecraft 1.13+) accept these as valid inputs.
These appear to produce unknown key outputs in the game log - would lists of these for Windows and Linux be of use for implementation?
Sure, I could add support for such buttons
I added support for some media keys on Windows
Here's some results from one of my old multimedia keyboards on both Windows and Linux:
Windows: Back: 00000000000000A6 Forward: 00000000000000A7 Stop (page loading): 00000000000000A9 Refresh: 00000000000000A8 Search: 00000000000000AA Favorites: 00000000000000AB Web/Home: 00000000000000AC Mail: 00000000000000B4 Media: 00000000000000B5 Mute: 00000000000000AD Previous Track: 00000000000000B1 Next Track: 00000000000000B0 Play/Pause: 00000000000000B3 Stop (media playback): 00000000000000B2 Volume Down: 00000000000000AE Volume Up: 00000000000000AF My Computer: 00000000000000B6 Calculator: 00000000000000B7 Power: 00000000000000FF Sleep: 000000000000005F Wake Up: 00000000000000FF
Linux: Back: 166 Forward: 167 Stop (page loading): 136 Refresh: 181 Search: acts as Escape Favorites: 164 Web/Home: 180 Mail: 163 Media: 234 Mute: 121 Previous Track: 173 Next Track: 171 Play/Pause: acts as Scroll Lock Stop (media playback): acts as Print Screen Volume Down: 122 Volume Up: acts as Pause Break My Computer: 165 Calculator: 148 Power: 124 Sleep: 150 Wake Up: 151
Aside from the ones misinterpreted as other keys for some reason, the Linux results match up pretty much identically to how modern Minecraft refers to them ("scancode." + their evtest numeric IDs plus 8).
No idea why classicube thinks some of them are normal keys, nor how we can get Windows to distinguish between the Power and Wake keys.
Here's what evtest calls each of the keys (add 8 to each value to get the "unknown key" ID that gets spit out to the log):
113: KEY_MUTE 114: KEY_VOLUMEDOWN 115: KEY_VOLUMEUP 116: KEY_POWER 128: KEY_STOP 140: KEY_CALC 142: KEY_SLEEP 143: KEY_WAKEUP 155: KEY_MAIL 156: KEY_BOOKMARKS 157: KEY_COMPUTER 158: KEY_BACK 159: KEY_FORWARD 163: KEY_NEXTSONG 164: KEY_PLAYPAUSE 165: KEY_PREVIOUSSONG 166: KEY_STOPCD 172: KEY_HOMEPAGE 173: KEY_REFRESH 217: KEY_SEARCH 226: KEY_MEDIA
Could you please also log the keysyms (the two hex numbers printed for an unknown key) for Linux too?
Here goes: Back: 000000001008FF26 Forward: 000000001008FF27 Stop (page loading): 000000000000FF69 Refresh: 000000001008FF73 Search: nothing printed to log Favorites: 000000001008FF30 Web/Home: 000000001008FF18 Mail: 000000001008FF19 Media: 000000001008FF32 Mute: 000000001008FF12 Previous Track: 000000001008FF16 Next Track: 000000001008FF17 Play/Pause: nothing printed to log Stop (media playback): nothing printed to log Volume Down: 000000001008FF11 Volume Up: nothing printed to log My Computer: 000000001008FF33 Calculator: 000000001008FF1D Power: 000000001008FF2A Sleep: 000000001008FF2F Wake Up: 000000001008FF2B
Each of these is printed twice.
For stuff that isn't printed to the game log (both X11 and Wayland are affected), evtest still recognises them as their correct, distinct keys.
I may see if plugging this keyboard into my newer desktop machine yields different results in-game, as I remember this machine with Windows 10 behaving differently with a certain keyboard than that exact same keyboard plugged into a Windows 10 machine.
Results from a laptop I own:
Windows 10: Fn+Esc: 00000000000000FF Brightness Down: 00000000000000FF Brightness Up: 00000000000000FF Mute: 00000000000000AD Volume Down: 00000000000000AE Volume Up: 00000000000000AF Previous Track: 00000000000000B1 Play/Pause: 00000000000000B3 Next Track: 00000000000000B0
Linux: Fn+Esc: nothing printed to log Brightness Down: nothing printed to log Brightness Up: nothing printed to log Mute: 121, 000000001008FF12 Volume Down: 122, 000000001008FF11 Volume Up: nothing printed to log Previous Track: 173, 000000001008FF16 Play/Pause: nothing printed to log Next Track: 171, 000000001008FF17
I added some more keys to both Windows and Linux versions
For stuff that isn't printed to the game log (both X11 and Wayland are affected), evtest still recognises them as their correct, distinct keys.
It's probably because of this bit of code in MapNativeKey: key &= 0xFFFF;
That will cause some of the special keysyms to mistakenly get treated as other keysyms
Some results from a Microsoft Natural Multimedia keyboard:
Windows: My Documents: 00000000000000FF My Pictures: 00000000000000FF My Music: 00000000000000FF Mute: 00000000000000AD Play/Pause: 00000000000000B3 Stop: 00000000000000B2 Volume Down: 00000000000000AE Volume Up: 00000000000000AF Previous Track: 00000000000000B1 Next Track: 00000000000000B0 Media: 00000000000000B5 Mail: 00000000000000B4 Web/Home: 00000000000000AC Messenger: 00000000000000FF Calculator: 00000000000000B7 Log Off: 00000000000000FF Sleep: 000000000000005F Help: 00000000000000FF Undo: 00000000000000FF Redo: 00000000000000FF New: 00000000000000FF Open: 00000000000000FF Close: 00000000000000FF Reply: 00000000000000FF Forward: 00000000000000FF Send: 00000000000000FF Spell: 00000000000000FF Save: 00000000000000FF Print: 00000000000000FF
Linux: My Documents: 120, 0000000000000000 My Pictures: not recognised My Music: not recognised Mute: 121, 000000001008FF12 Play/Pause: recognised as Scroll Lock Stop: recognised as Print Screen Volume Down: 122, 000000001008FF11 Volume Up: recognised as Pause Previous Track: 173, 000000001008FF16 Next Track: 171, 000000001008FF17 Media: 234, 000000001008FF32 Mail: 163, 000000001008FF19 Web/Home: 180, 000000001008FF18 Messenger: not recognised Calculator: 148, 000000001008FF1D Log Off: not recognised Sleep: 150, 000000001008FF2F Help: not recognised Undo: not recognised Redo: not recognised New: not recognised Open: not recognised Close: not recognised Reply: not recognised Forward: not recognised Send: not recognised Spell: not recognised Save: not recognised Print: not recognised
Those last twelve (actually F1-F12 without F Lock) not being recognised on Linux seems to be a Linux issue in and of itself. Windows definitely can pick them apart for some programs such as Minecraft Java Edition 1.13+, even if the ClassiCube game log just produces FF for every single one of them (likewise for all the other inputs that produce FF - I can provide the scancode.### results Minecraft provides for them if desired).
Managed to rebind some mouse buttons to some uncommon keys as well:
KEY_KPEQUAL: Unknown key 125 (000000000000FFBD, 000000000000FFBD) KEY_PASTE: Unknown key 143 (000000001008FF6D, 000000001008FF6D) KEY_FIND: Unknown key 144 (000000000000FF68, 000000000000FF68) KEY_CUT: Unknown key 145 (000000001008FF58, 000000001008FF58) KEY_HELP: Unknown key 146 (000000000000FF6A, 000000000000FF6A)