#######################################################################################################################* *-------------------------------------------------Keyboard event handling-------------------------------------------------* *#########################################################################################################################*/
| 613 | *-------------------------------------------------Keyboard event handling-------------------------------------------------* |
| 614 | *#########################################################################################################################*/ |
| 615 | static int TryGetKey(XKeyEvent* ev) { |
| 616 | KeySym keysym1 = XLookupKeysym(ev, 0); |
| 617 | KeySym keysym2 = XLookupKeysym(ev, 1); |
| 618 | |
| 619 | int key = MapNativeKey(keysym1, ev->state); |
| 620 | if (!key) key = MapNativeKey(keysym2, ev->state); |
| 621 | if (key) return key; |
| 622 | |
| 623 | Platform_Log3("Unknown key %i (%x, %x)", &ev->keycode, &keysym1, &keysym2); |
| 624 | /* The user may be using a keyboard layout such as cryllic - */ |
| 625 | /* fallback to trying to conver the raw scancodes instead */ |
| 626 | return MapNativeKeycode(ev->keycode); |
| 627 | } |
| 628 | |
| 629 | static void HandleKeyPress(XEvent* e) { |
| 630 | char data[64]; |
no test coverage detected