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

FN, Cursor and numeric keypad keys not working on Ubuntu 18.04 #1654

Closed
twjanes opened this issue Feb 29, 2020 · 3 comments
Closed

FN, Cursor and numeric keypad keys not working on Ubuntu 18.04 #1654

twjanes opened this issue Feb 29, 2020 · 3 comments
Assignees
Labels
bug Bug reports and bugfix pull requests duplicate Issues duplicating another issue input Keyboard, joystick or mouse verified Reproduced or otherwise verified bugs X11
Milestone

Comments

@twjanes
Copy link

twjanes commented Feb 29, 2020

The main alpha and numeric keys work fine but that is all.
Observing the output of tests/events shows

`//Pressed 1
0000000f to 1 at 19.541: Key 0x0031 Scancode 0x000a (1) (1) (with no mods) was pressed
00000010 to 1 at 19.547: Character 0x00000031 (1) input
00000011 to 1 at 19.672: Key 0x0031 Scancode 0x000a (1) (1) (with no mods) was released
//Pressed <ESC>
Error: Invalid scancode
00000012 to 1 at 21.521: Key 0xffffffff Scancode 0x0009 (UNKNOWN) (with no mods) was pressed
Error: Invalid scancode
00000013 to 1 at 21.718: Key 0xffffffff Scancode 0x0009 (UNKNOWN) (with no mods) was released
Error: Invalid scancode
00000014 to 1 at 21.723: Key 0xffffffff Scancode 0x0009 (UNKNOWN) (with no mods) was released
Error: Invalid scancode
//Pressed <FN_1>
00000015 to 1 at 23.766: Key 0xffffffff Scancode 0x0043 (UNKNOWN) (with no mods) was pressed
Error: Invalid scancode
00000016 to 1 at 23.924: Key 0xffffffff Scancode 0x0043 (UNKNOWN) (with no mods) was released
Error: Invalid scancode
00000017 to 1 at 23.930: Key 0xffffffff Scancode 0x0043 (UNKNOWN) (with no mods) was released
//Pressed <UP>
_Error: Invalid scancode
00000018 to 1 at 25.549: Key 0xffffffff Scancode 0x006f (UNKNOWN) (with no mods) was pressed
Error: Invalid scancode
00000019 to 1 at 25.635: Key 0xffffffff Scancode 0x006f (UNKNOWN) (with no mods) was released
Error: Invalid scancode
0000001a to 1 at 25.640: Key 0xffffffff Scancode 0x006f (UNKNOWN) (with no mods) was released
//Pressed <KeyPad 5>
Error: Invalid scancode
0000001b to 1 at 27.894: Key 0xffffffff Scancode 0x0054 (UNKNOWN) (with no mods) was pressed
Error: Invalid scancode
0000001c to 1 at 27.980: Key 0xffffffff Scancode 0x0054 (UNKNOWN) (with no mods) was released
Error: Invalid scancode

This is on a Dell laptop with US keyboard. I have also tried a UK full size keyboard.

Tim.

@twjanes
Copy link
Author

twjanes commented Mar 3, 2020

Here is a workaround, I don't think this is a correct fix, the comments indicate this table should only be the printable chars not all, but it seems to work for me. I do not know enough about X11 keyboard handling to give a correct fix.

In x11_init.c sdd the following to the table in CreateKeyTables()

            else if (strcmp(name, "ESC") == 0) key = GLFW_KEY_ESCAPE;
            else if (strcmp(name, "FK01") == 0) key = GLFW_KEY_F1;
            else if (strcmp(name, "FK02") == 0) key = GLFW_KEY_F2;
            else if (strcmp(name, "FK03") == 0) key = GLFW_KEY_F3;
            else if (strcmp(name, "FK04") == 0) key = GLFW_KEY_F4;
            else if (strcmp(name, "FK05") == 0) key = GLFW_KEY_F5;
            else if (strcmp(name, "FK06") == 0) key = GLFW_KEY_F6;
            else if (strcmp(name, "FK07") == 0) key = GLFW_KEY_F7;
            else if (strcmp(name, "FK08") == 0) key = GLFW_KEY_F8;
            else if (strcmp(name, "FK09") == 0) key = GLFW_KEY_F9;
            else if (strcmp(name, "FK10") == 0) key = GLFW_KEY_F10;
            else if (strcmp(name, "FK11") == 0) key = GLFW_KEY_F11;
            else if (strcmp(name, "FK12") == 0) key = GLFW_KEY_F12;
            else if (strcmp(name, "UP") == 0) key = GLFW_KEY_UP;
            else if (strcmp(name, "DOWN") == 0) key = GLFW_KEY_DOWN;
            else if (strcmp(name, "LEFT") == 0) key = GLFW_KEY_LEFT;
            else if (strcmp(name, "RGHT") == 0) key = GLFW_KEY_RIGHT;
            else if (strcmp(name, "INS") == 0) key = GLFW_KEY_INSERT;
            else if (strcmp(name, "DELE") == 0) key = GLFW_KEY_DELETE;
            else if (strcmp(name, "TAB") == 0) key = GLFW_KEY_TAB;
            else if (strcmp(name, "BKSP") == 0) key = GLFW_KEY_BACKSPACE;
            else if (strcmp(name, "CAPS") == 0) key = GLFW_KEY_CAPS_LOCK;
            else if (strcmp(name, "RTRN") == 0) key = GLFW_KEY_ENTER;
            else if (strcmp(name, "LFSH") == 0) key = GLFW_KEY_LEFT_SHIFT;
            else if (strcmp(name, "RTSH") == 0) key = GLFW_KEY_RIGHT_SHIFT;
            else if (strcmp(name, "LCTL") == 0) key = GLFW_KEY_LEFT_CONTROL;
            else if (strcmp(name, "LALT") == 0) key = GLFW_KEY_LEFT_ALT;
            else if (strcmp(name, "SPCE") == 0) key = GLFW_KEY_SPACE;
            else if (strcmp(name, "RALT") == 0) key = GLFW_KEY_RIGHT_ALT;
            else if (strcmp(name, "RCTL") == 0) key = GLFW_KEY_RIGHT_CONTROL;
            else if (strcmp(name, "PGUP") == 0) key = GLFW_KEY_PAGE_UP;
            else if (strcmp(name, "PGDN") == 0) key = GLFW_KEY_PAGE_DOWN;
            else if (strcmp(name, "HOME") == 0) key = GLFW_KEY_HOME;
            else if (strcmp(name, "END") == 0) key = GLFW_KEY_END;
            else if (strcmp(name, "NMLK") == 0) key = GLFW_KEY_NUM_LOCK;
            else if (strcmp(name, "KPDV") == 0) key = GLFW_KEY_KP_DIVIDE;
            else if (strcmp(name, "KPMU") == 0) key = GLFW_KEY_KP_MULTIPLY;
            else if (strcmp(name, "KPSU") == 0) key = GLFW_KEY_KP_SUBTRACT;
            else if (strcmp(name, "KPAD") == 0) key = GLFW_KEY_KP_ADD;
            else if (strcmp(name, "KPEN") == 0) key = GLFW_KEY_KP_ENTER;
            else if (strcmp(name, "KPDL") == 0) key = GLFW_KEY_KP_DECIMAL;
            else if (strcmp(name, "KP0") == 0) key = GLFW_KEY_KP_0;
            else if (strcmp(name, "KP1") == 0) key = GLFW_KEY_KP_1;
            else if (strcmp(name, "KP2") == 0) key = GLFW_KEY_KP_2;
            else if (strcmp(name, "KP3") == 0) key = GLFW_KEY_KP_3;
            else if (strcmp(name, "KP4") == 0) key = GLFW_KEY_KP_4;
            else if (strcmp(name, "KP5") == 0) key = GLFW_KEY_KP_5;
            else if (strcmp(name, "KP6") == 0) key = GLFW_KEY_KP_6;
            else if (strcmp(name, "KP7") == 0) key = GLFW_KEY_KP_7;
            else if (strcmp(name, "KP8") == 0) key = GLFW_KEY_KP_8;
            else if (strcmp(name, "KP9") == 0) key = GLFW_KEY_KP_9;

@elmindreda elmindreda added X11 bug Bug reports and bugfix pull requests labels Apr 2, 2020
@elmindreda
Copy link
Member

This is very similar to the solution being worked on in #1598, which should hopefully resolve this issue as well.

@elmindreda elmindreda added input Keyboard, joystick or mouse verified Reproduced or otherwise verified bugs duplicate Issues duplicating another issue labels Jun 2, 2020
@elmindreda elmindreda self-assigned this Jun 2, 2020
@elmindreda
Copy link
Member

This should be fixed now with the work merged for #1598.

@elmindreda elmindreda added this to the 3.3.3 milestone Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports and bugfix pull requests duplicate Issues duplicating another issue input Keyboard, joystick or mouse verified Reproduced or otherwise verified bugs X11
Projects
None yet
Development

No branches or pull requests

2 participants