| 602 | } |
| 603 | |
| 604 | static int TranslateKeyEventKey(const SDL_KeyboardEvent &KeyEvent) |
| 605 | { |
| 606 | // See SDL_Keymod for possible modifiers: |
| 607 | // NONE = 0 |
| 608 | // LSHIFT = 1 |
| 609 | // RSHIFT = 2 |
| 610 | // LCTRL = 64 |
| 611 | // RCTRL = 128 |
| 612 | // LALT = 256 |
| 613 | // RALT = 512 |
| 614 | // LGUI = 1024 |
| 615 | // RGUI = 2048 |
| 616 | // NUM = 4096 |
| 617 | // CAPS = 8192 |
| 618 | // MODE = 16384 |
| 619 | // Sum if you want to ignore multiple modifiers. |
| 620 | if(KeyEvent.keysym.mod & g_Config.m_InpIgnoredModifiers) |
| 621 | { |
| 622 | return KEY_UNKNOWN; |
| 623 | } |
| 624 | |
| 625 | int Key = g_Config.m_InpTranslatedKeys ? SDL_GetScancodeFromKey(KeyEvent.keysym.sym) : KeyEvent.keysym.scancode; |
| 626 | |
| 627 | #if defined(CONF_PLATFORM_ANDROID) |
| 628 | // Translate the Android back-button to the escape-key so it can be used to open/close the menu, close popups etc. |
| 629 | if(Key == KEY_AC_BACK) |
| 630 | { |
| 631 | Key = KEY_ESCAPE; |
| 632 | } |
| 633 | #endif |
| 634 | |
| 635 | return Key; |
| 636 | } |
| 637 | |
| 638 | static int TranslateMouseButtonEventKey(const SDL_MouseButtonEvent &MouseButtonEvent) |
| 639 | { |