From d1c756713dfbb28034af493025e702405571a789 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 4 Jan 2022 10:10:58 +0100 Subject: [PATCH] display: Handle raw event for key between Shift and Z on ISO keyboards This key is called raw-< for lack of anything better, it's usually mapped as backslash on US keyboards but that would not allow distinguishing between the backslash key near the enter key. --- panda/src/cocoadisplay/cocoaGraphicsWindow.mm | 1 + panda/src/device/evdevInputDevice.cxx | 2 +- panda/src/windisplay/winGraphicsWindow.cxx | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/panda/src/cocoadisplay/cocoaGraphicsWindow.mm b/panda/src/cocoadisplay/cocoaGraphicsWindow.mm index df80308b62..87a3c96777 100644 --- a/panda/src/cocoadisplay/cocoaGraphicsWindow.mm +++ b/panda/src/cocoadisplay/cocoaGraphicsWindow.mm @@ -2261,6 +2261,7 @@ map_raw_key(unsigned short keycode) const { case 0x07: return KeyboardButton::ascii_key('x'); case 0x08: return KeyboardButton::ascii_key('c'); case 0x09: return KeyboardButton::ascii_key('v'); + case 0x0A: return KeyboardButton::ascii_key('<'); case 0x0B: return KeyboardButton::ascii_key('b'); case 0x0C: return KeyboardButton::ascii_key('q'); case 0x0D: return KeyboardButton::ascii_key('w'); diff --git a/panda/src/device/evdevInputDevice.cxx b/panda/src/device/evdevInputDevice.cxx index c4d293eb91..05507086b1 100644 --- a/panda/src/device/evdevInputDevice.cxx +++ b/panda/src/device/evdevInputDevice.cxx @@ -962,7 +962,7 @@ map_button(int code, DeviceClass device_class, int quirks) { KeyboardButton::ascii_key('.'), ButtonHandle::none(), ButtonHandle::none(), - ButtonHandle::none(), + KeyboardButton::ascii_key('<'), KeyboardButton::f11(), KeyboardButton::f12(), ButtonHandle::none(), diff --git a/panda/src/windisplay/winGraphicsWindow.cxx b/panda/src/windisplay/winGraphicsWindow.cxx index ec366e4ec9..4bc914e976 100644 --- a/panda/src/windisplay/winGraphicsWindow.cxx +++ b/panda/src/windisplay/winGraphicsWindow.cxx @@ -2724,6 +2724,7 @@ lookup_raw_key(LPARAM lparam) const { // A few additional keys don't fit well in the above table. switch (vsc) { + case 86: return KeyboardButton::ascii_key('<'); // Between lshift and z case 87: return KeyboardButton::f11(); case 88: return KeyboardButton::f12(); default: return ButtonHandle::none(); @@ -2743,7 +2744,7 @@ get_keyboard_map() const { wchar_t text[256]; UINT vsc = 0; - unsigned short ex_vsc[] = {0x57, 0x58, + unsigned short ex_vsc[] = {0x56, 0x57, 0x58, 0x011c, 0x011d, 0x0135, 0x0137, 0x0138, 0x0145, 0x0147, 0x0148, 0x0149, 0x014b, 0x014d, 0x014f, 0x0150, 0x0151, 0x0152, 0x0153, 0x015b, 0x015c, 0x015d}; for (int k = 1; k < 84 + sizeof(ex_vsc) / sizeof(short); ++k) {