mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-10-21 00:10:51 +00:00
Entry: Fixed keymapings. (#3917)
This commit is contained in:
committed by
GitHub
parent
53e3c599fd
commit
6d0d15f2a5
@@ -302,85 +302,96 @@ namespace entry
|
||||
, m_scrollPos(0.0f)
|
||||
{
|
||||
bx::memSet(s_translateKey, 0, sizeof(s_translateKey));
|
||||
s_translateKey[GLFW_KEY_ESCAPE] = Key::Esc;
|
||||
s_translateKey[GLFW_KEY_ENTER] = Key::Return;
|
||||
s_translateKey[GLFW_KEY_TAB] = Key::Tab;
|
||||
s_translateKey[GLFW_KEY_BACKSPACE] = Key::Backspace;
|
||||
s_translateKey[GLFW_KEY_SPACE] = Key::Space;
|
||||
s_translateKey[GLFW_KEY_UP] = Key::Up;
|
||||
s_translateKey[GLFW_KEY_DOWN] = Key::Down;
|
||||
s_translateKey[GLFW_KEY_LEFT] = Key::Left;
|
||||
s_translateKey[GLFW_KEY_RIGHT] = Key::Right;
|
||||
s_translateKey[GLFW_KEY_PAGE_UP] = Key::PageUp;
|
||||
s_translateKey[GLFW_KEY_PAGE_DOWN] = Key::PageDown;
|
||||
s_translateKey[GLFW_KEY_HOME] = Key::Home;
|
||||
s_translateKey[GLFW_KEY_END] = Key::End;
|
||||
s_translateKey[GLFW_KEY_PRINT_SCREEN] = Key::Print;
|
||||
s_translateKey[GLFW_KEY_KP_ADD] = Key::Plus;
|
||||
s_translateKey[GLFW_KEY_EQUAL] = Key::Plus;
|
||||
s_translateKey[GLFW_KEY_KP_SUBTRACT] = Key::Minus;
|
||||
s_translateKey[GLFW_KEY_MINUS] = Key::Minus;
|
||||
s_translateKey[GLFW_KEY_COMMA] = Key::Comma;
|
||||
s_translateKey[GLFW_KEY_PERIOD] = Key::Period;
|
||||
s_translateKey[GLFW_KEY_SLASH] = Key::Slash;
|
||||
s_translateKey[GLFW_KEY_F1] = Key::F1;
|
||||
s_translateKey[GLFW_KEY_F2] = Key::F2;
|
||||
s_translateKey[GLFW_KEY_F3] = Key::F3;
|
||||
s_translateKey[GLFW_KEY_F4] = Key::F4;
|
||||
s_translateKey[GLFW_KEY_F5] = Key::F5;
|
||||
s_translateKey[GLFW_KEY_F6] = Key::F6;
|
||||
s_translateKey[GLFW_KEY_F7] = Key::F7;
|
||||
s_translateKey[GLFW_KEY_F8] = Key::F8;
|
||||
s_translateKey[GLFW_KEY_F9] = Key::F9;
|
||||
s_translateKey[GLFW_KEY_F10] = Key::F10;
|
||||
s_translateKey[GLFW_KEY_F11] = Key::F11;
|
||||
s_translateKey[GLFW_KEY_F12] = Key::F12;
|
||||
s_translateKey[GLFW_KEY_KP_0] = Key::NumPad0;
|
||||
s_translateKey[GLFW_KEY_KP_1] = Key::NumPad1;
|
||||
s_translateKey[GLFW_KEY_KP_2] = Key::NumPad2;
|
||||
s_translateKey[GLFW_KEY_KP_3] = Key::NumPad3;
|
||||
s_translateKey[GLFW_KEY_KP_4] = Key::NumPad4;
|
||||
s_translateKey[GLFW_KEY_KP_5] = Key::NumPad5;
|
||||
s_translateKey[GLFW_KEY_KP_6] = Key::NumPad6;
|
||||
s_translateKey[GLFW_KEY_KP_7] = Key::NumPad7;
|
||||
s_translateKey[GLFW_KEY_KP_8] = Key::NumPad8;
|
||||
s_translateKey[GLFW_KEY_KP_9] = Key::NumPad9;
|
||||
s_translateKey[GLFW_KEY_0] = Key::Key0;
|
||||
s_translateKey[GLFW_KEY_1] = Key::Key1;
|
||||
s_translateKey[GLFW_KEY_2] = Key::Key2;
|
||||
s_translateKey[GLFW_KEY_3] = Key::Key3;
|
||||
s_translateKey[GLFW_KEY_4] = Key::Key4;
|
||||
s_translateKey[GLFW_KEY_5] = Key::Key5;
|
||||
s_translateKey[GLFW_KEY_6] = Key::Key6;
|
||||
s_translateKey[GLFW_KEY_7] = Key::Key7;
|
||||
s_translateKey[GLFW_KEY_8] = Key::Key8;
|
||||
s_translateKey[GLFW_KEY_9] = Key::Key9;
|
||||
s_translateKey[GLFW_KEY_A] = Key::KeyA;
|
||||
s_translateKey[GLFW_KEY_B] = Key::KeyB;
|
||||
s_translateKey[GLFW_KEY_C] = Key::KeyC;
|
||||
s_translateKey[GLFW_KEY_D] = Key::KeyD;
|
||||
s_translateKey[GLFW_KEY_E] = Key::KeyE;
|
||||
s_translateKey[GLFW_KEY_F] = Key::KeyF;
|
||||
s_translateKey[GLFW_KEY_G] = Key::KeyG;
|
||||
s_translateKey[GLFW_KEY_H] = Key::KeyH;
|
||||
s_translateKey[GLFW_KEY_I] = Key::KeyI;
|
||||
s_translateKey[GLFW_KEY_J] = Key::KeyJ;
|
||||
s_translateKey[GLFW_KEY_K] = Key::KeyK;
|
||||
s_translateKey[GLFW_KEY_L] = Key::KeyL;
|
||||
s_translateKey[GLFW_KEY_M] = Key::KeyM;
|
||||
s_translateKey[GLFW_KEY_N] = Key::KeyN;
|
||||
s_translateKey[GLFW_KEY_O] = Key::KeyO;
|
||||
s_translateKey[GLFW_KEY_P] = Key::KeyP;
|
||||
s_translateKey[GLFW_KEY_Q] = Key::KeyQ;
|
||||
s_translateKey[GLFW_KEY_R] = Key::KeyR;
|
||||
s_translateKey[GLFW_KEY_S] = Key::KeyS;
|
||||
s_translateKey[GLFW_KEY_T] = Key::KeyT;
|
||||
s_translateKey[GLFW_KEY_U] = Key::KeyU;
|
||||
s_translateKey[GLFW_KEY_V] = Key::KeyV;
|
||||
s_translateKey[GLFW_KEY_W] = Key::KeyW;
|
||||
s_translateKey[GLFW_KEY_X] = Key::KeyX;
|
||||
s_translateKey[GLFW_KEY_Y] = Key::KeyY;
|
||||
s_translateKey[GLFW_KEY_Z] = Key::KeyZ;
|
||||
s_translateKey[GLFW_KEY_ESCAPE] = Key::Esc;
|
||||
s_translateKey[GLFW_KEY_ENTER] = Key::Return;
|
||||
s_translateKey[GLFW_KEY_KP_ENTER] = Key::Return;
|
||||
s_translateKey[GLFW_KEY_TAB] = Key::Tab;
|
||||
s_translateKey[GLFW_KEY_BACKSPACE] = Key::Backspace;
|
||||
s_translateKey[GLFW_KEY_SPACE] = Key::Space;
|
||||
s_translateKey[GLFW_KEY_UP] = Key::Up;
|
||||
s_translateKey[GLFW_KEY_DOWN] = Key::Down;
|
||||
s_translateKey[GLFW_KEY_LEFT] = Key::Left;
|
||||
s_translateKey[GLFW_KEY_RIGHT] = Key::Right;
|
||||
s_translateKey[GLFW_KEY_INSERT] = Key::Insert;
|
||||
s_translateKey[GLFW_KEY_DELETE] = Key::Delete;
|
||||
s_translateKey[GLFW_KEY_PAGE_UP] = Key::PageUp;
|
||||
s_translateKey[GLFW_KEY_PAGE_DOWN] = Key::PageDown;
|
||||
s_translateKey[GLFW_KEY_HOME] = Key::Home;
|
||||
s_translateKey[GLFW_KEY_END] = Key::End;
|
||||
s_translateKey[GLFW_KEY_PRINT_SCREEN] = Key::Print;
|
||||
s_translateKey[GLFW_KEY_KP_ADD] = Key::Plus;
|
||||
s_translateKey[GLFW_KEY_EQUAL] = Key::Plus;
|
||||
s_translateKey[GLFW_KEY_KP_SUBTRACT] = Key::Minus;
|
||||
s_translateKey[GLFW_KEY_MINUS] = Key::Minus;
|
||||
s_translateKey[GLFW_KEY_LEFT_BRACKET] = Key::LeftBracket;
|
||||
s_translateKey[GLFW_KEY_RIGHT_BRACKET] = Key::RightBracket;
|
||||
s_translateKey[GLFW_KEY_SEMICOLON] = Key::Semicolon;
|
||||
s_translateKey[GLFW_KEY_APOSTROPHE] = Key::Quote;
|
||||
s_translateKey[GLFW_KEY_COMMA] = Key::Comma;
|
||||
s_translateKey[GLFW_KEY_PERIOD] = Key::Period;
|
||||
s_translateKey[GLFW_KEY_KP_DECIMAL] = Key::Period;
|
||||
s_translateKey[GLFW_KEY_SLASH] = Key::Slash;
|
||||
s_translateKey[GLFW_KEY_KP_DIVIDE] = Key::Slash;
|
||||
s_translateKey[GLFW_KEY_BACKSLASH] = Key::Backslash;
|
||||
s_translateKey[GLFW_KEY_GRAVE_ACCENT] = Key::Tilde;
|
||||
s_translateKey[GLFW_KEY_F1] = Key::F1;
|
||||
s_translateKey[GLFW_KEY_F2] = Key::F2;
|
||||
s_translateKey[GLFW_KEY_F3] = Key::F3;
|
||||
s_translateKey[GLFW_KEY_F4] = Key::F4;
|
||||
s_translateKey[GLFW_KEY_F5] = Key::F5;
|
||||
s_translateKey[GLFW_KEY_F6] = Key::F6;
|
||||
s_translateKey[GLFW_KEY_F7] = Key::F7;
|
||||
s_translateKey[GLFW_KEY_F8] = Key::F8;
|
||||
s_translateKey[GLFW_KEY_F9] = Key::F9;
|
||||
s_translateKey[GLFW_KEY_F10] = Key::F10;
|
||||
s_translateKey[GLFW_KEY_F11] = Key::F11;
|
||||
s_translateKey[GLFW_KEY_F12] = Key::F12;
|
||||
s_translateKey[GLFW_KEY_KP_0] = Key::NumPad0;
|
||||
s_translateKey[GLFW_KEY_KP_1] = Key::NumPad1;
|
||||
s_translateKey[GLFW_KEY_KP_2] = Key::NumPad2;
|
||||
s_translateKey[GLFW_KEY_KP_3] = Key::NumPad3;
|
||||
s_translateKey[GLFW_KEY_KP_4] = Key::NumPad4;
|
||||
s_translateKey[GLFW_KEY_KP_5] = Key::NumPad5;
|
||||
s_translateKey[GLFW_KEY_KP_6] = Key::NumPad6;
|
||||
s_translateKey[GLFW_KEY_KP_7] = Key::NumPad7;
|
||||
s_translateKey[GLFW_KEY_KP_8] = Key::NumPad8;
|
||||
s_translateKey[GLFW_KEY_KP_9] = Key::NumPad9;
|
||||
s_translateKey[GLFW_KEY_0] = Key::Key0;
|
||||
s_translateKey[GLFW_KEY_1] = Key::Key1;
|
||||
s_translateKey[GLFW_KEY_2] = Key::Key2;
|
||||
s_translateKey[GLFW_KEY_3] = Key::Key3;
|
||||
s_translateKey[GLFW_KEY_4] = Key::Key4;
|
||||
s_translateKey[GLFW_KEY_5] = Key::Key5;
|
||||
s_translateKey[GLFW_KEY_6] = Key::Key6;
|
||||
s_translateKey[GLFW_KEY_7] = Key::Key7;
|
||||
s_translateKey[GLFW_KEY_8] = Key::Key8;
|
||||
s_translateKey[GLFW_KEY_9] = Key::Key9;
|
||||
s_translateKey[GLFW_KEY_A] = Key::KeyA;
|
||||
s_translateKey[GLFW_KEY_B] = Key::KeyB;
|
||||
s_translateKey[GLFW_KEY_C] = Key::KeyC;
|
||||
s_translateKey[GLFW_KEY_D] = Key::KeyD;
|
||||
s_translateKey[GLFW_KEY_E] = Key::KeyE;
|
||||
s_translateKey[GLFW_KEY_F] = Key::KeyF;
|
||||
s_translateKey[GLFW_KEY_G] = Key::KeyG;
|
||||
s_translateKey[GLFW_KEY_H] = Key::KeyH;
|
||||
s_translateKey[GLFW_KEY_I] = Key::KeyI;
|
||||
s_translateKey[GLFW_KEY_J] = Key::KeyJ;
|
||||
s_translateKey[GLFW_KEY_K] = Key::KeyK;
|
||||
s_translateKey[GLFW_KEY_L] = Key::KeyL;
|
||||
s_translateKey[GLFW_KEY_M] = Key::KeyM;
|
||||
s_translateKey[GLFW_KEY_N] = Key::KeyN;
|
||||
s_translateKey[GLFW_KEY_O] = Key::KeyO;
|
||||
s_translateKey[GLFW_KEY_P] = Key::KeyP;
|
||||
s_translateKey[GLFW_KEY_Q] = Key::KeyQ;
|
||||
s_translateKey[GLFW_KEY_R] = Key::KeyR;
|
||||
s_translateKey[GLFW_KEY_S] = Key::KeyS;
|
||||
s_translateKey[GLFW_KEY_T] = Key::KeyT;
|
||||
s_translateKey[GLFW_KEY_U] = Key::KeyU;
|
||||
s_translateKey[GLFW_KEY_V] = Key::KeyV;
|
||||
s_translateKey[GLFW_KEY_W] = Key::KeyW;
|
||||
s_translateKey[GLFW_KEY_X] = Key::KeyX;
|
||||
s_translateKey[GLFW_KEY_Y] = Key::KeyY;
|
||||
s_translateKey[GLFW_KEY_Z] = Key::KeyZ;
|
||||
}
|
||||
|
||||
int run(int _argc, const char* const* _argv)
|
||||
|
||||
@@ -39,59 +39,61 @@ namespace entry
|
||||
, m_scroll(0)
|
||||
{
|
||||
bx::memSet(s_translateKey, 0, sizeof(s_translateKey));
|
||||
s_translateKey[27] = Key::Esc;
|
||||
s_translateKey[uint8_t('\n')] =
|
||||
s_translateKey[uint8_t('\r')] = Key::Return;
|
||||
s_translateKey[uint8_t('\t')] = Key::Tab;
|
||||
s_translateKey[127] = Key::Backspace;
|
||||
s_translateKey[uint8_t(' ')] = Key::Space;
|
||||
s_translateKey[38] = Key::Up;
|
||||
s_translateKey[40] = Key::Down;
|
||||
s_translateKey[37] = Key::Left;
|
||||
s_translateKey[39] = Key::Right;
|
||||
|
||||
s_translateKey[uint8_t('+')] =
|
||||
s_translateKey[uint8_t('=')] = Key::Plus;
|
||||
s_translateKey[uint8_t('_')] =
|
||||
s_translateKey[uint8_t('-')] = Key::Minus;
|
||||
// Note: Keyboard events carry DOM `KeyboardEvent.keyCode`, which is
|
||||
// layout independent, and it's not a character code.
|
||||
//
|
||||
// Reference(s):
|
||||
// - https://web.archive.org/web/20250808182750/https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_code_values
|
||||
//
|
||||
s_translateKey[ 8] = Key::Backspace;
|
||||
s_translateKey[ 9] = Key::Tab;
|
||||
s_translateKey[ 13] = Key::Return;
|
||||
s_translateKey[ 27] = Key::Esc;
|
||||
s_translateKey[ 32] = Key::Space;
|
||||
s_translateKey[ 33] = Key::PageUp;
|
||||
s_translateKey[ 34] = Key::PageDown;
|
||||
s_translateKey[ 35] = Key::End;
|
||||
s_translateKey[ 36] = Key::Home;
|
||||
s_translateKey[ 37] = Key::Left;
|
||||
s_translateKey[ 38] = Key::Up;
|
||||
s_translateKey[ 39] = Key::Right;
|
||||
s_translateKey[ 40] = Key::Down;
|
||||
s_translateKey[ 44] = Key::Print;
|
||||
s_translateKey[ 45] = Key::Insert;
|
||||
s_translateKey[ 46] = Key::Delete;
|
||||
|
||||
s_translateKey[uint8_t(':')] =
|
||||
s_translateKey[uint8_t(';')] = Key::Semicolon;
|
||||
s_translateKey[uint8_t('"')] =
|
||||
s_translateKey[uint8_t('\'')] = Key::Quote;
|
||||
s_translateKey[107] = Key::Plus;
|
||||
s_translateKey[109] = Key::Minus;
|
||||
s_translateKey[110] = Key::Period;
|
||||
s_translateKey[111] = Key::Slash;
|
||||
|
||||
s_translateKey[uint8_t('{')] =
|
||||
s_translateKey[uint8_t('[')] = Key::LeftBracket;
|
||||
s_translateKey[uint8_t('}')] =
|
||||
s_translateKey[uint8_t(']')] = Key::RightBracket;
|
||||
s_translateKey[186] = Key::Semicolon;
|
||||
s_translateKey[187] = Key::Plus;
|
||||
s_translateKey[188] = Key::Comma;
|
||||
s_translateKey[189] = Key::Minus;
|
||||
s_translateKey[190] = Key::Period;
|
||||
s_translateKey[191] = Key::Slash;
|
||||
s_translateKey[192] = Key::Tilde;
|
||||
s_translateKey[219] = Key::LeftBracket;
|
||||
s_translateKey[220] = Key::Backslash;
|
||||
s_translateKey[221] = Key::RightBracket;
|
||||
s_translateKey[222] = Key::Quote;
|
||||
|
||||
s_translateKey[uint8_t('<')] =
|
||||
s_translateKey[uint8_t(',')] = Key::Comma;
|
||||
s_translateKey[uint8_t('>')] =
|
||||
s_translateKey[uint8_t('.')] = Key::Period;
|
||||
s_translateKey[uint8_t('?')] =
|
||||
s_translateKey[uint8_t('/')] = Key::Slash;
|
||||
s_translateKey[uint8_t('|')] =
|
||||
s_translateKey[uint8_t('\\')] = Key::Backslash;
|
||||
|
||||
s_translateKey[uint8_t('~')] =
|
||||
s_translateKey[uint8_t('`')] = Key::Tilde;
|
||||
|
||||
s_translateKey[uint8_t('0')] = Key::Key0;
|
||||
s_translateKey[uint8_t('1')] = Key::Key1;
|
||||
s_translateKey[uint8_t('2')] = Key::Key2;
|
||||
s_translateKey[uint8_t('3')] = Key::Key3;
|
||||
s_translateKey[uint8_t('4')] = Key::Key4;
|
||||
s_translateKey[uint8_t('5')] = Key::Key5;
|
||||
s_translateKey[uint8_t('6')] = Key::Key6;
|
||||
s_translateKey[uint8_t('7')] = Key::Key7;
|
||||
s_translateKey[uint8_t('8')] = Key::Key8;
|
||||
s_translateKey[uint8_t('9')] = Key::Key9;
|
||||
|
||||
for (char ch = 'a'; ch <= 'z'; ++ch)
|
||||
for (uint8_t ii = 0; ii < 10; ++ii)
|
||||
{
|
||||
s_translateKey[uint8_t(ch)] =
|
||||
s_translateKey[uint8_t(ch - ' ')] = Key::KeyA + (ch - 'a');
|
||||
s_translateKey[uint8_t('0')+ii] = uint8_t(Key::Key0 + ii);
|
||||
s_translateKey[96+ii] = uint8_t(Key::NumPad0 + ii);
|
||||
}
|
||||
|
||||
for (uint8_t ii = 0; ii < 26; ++ii)
|
||||
{
|
||||
s_translateKey[uint8_t('A')+ii] = uint8_t(Key::KeyA + ii);
|
||||
}
|
||||
|
||||
for (uint8_t ii = 0; ii < 12; ++ii)
|
||||
{
|
||||
s_translateKey[112+ii] = uint8_t(Key::F1 + ii);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,30 +241,6 @@ namespace entry
|
||||
int32_t keyCode = int32_t(_event->keyCode);
|
||||
*_specialKeys = translateModifiers(_event);
|
||||
|
||||
if (_event->charCode == 0)
|
||||
{
|
||||
switch (keyCode)
|
||||
{
|
||||
case 112: return Key::F1;
|
||||
case 113: return Key::F2;
|
||||
case 114: return Key::F3;
|
||||
case 115: return Key::F4;
|
||||
case 116: return Key::F5;
|
||||
case 117: return Key::F6;
|
||||
case 118: return Key::F7;
|
||||
case 119: return Key::F8;
|
||||
case 120: return Key::F9;
|
||||
case 121: return Key::F10;
|
||||
case 122: return Key::F11;
|
||||
case 123: return Key::F12;
|
||||
|
||||
case 37: return Key::Left;
|
||||
case 39: return Key::Right;
|
||||
case 38: return Key::Up;
|
||||
case 40: return Key::Down;
|
||||
}
|
||||
}
|
||||
|
||||
// if this is a unhandled key just return None
|
||||
if (keyCode < 256)
|
||||
{
|
||||
|
||||
@@ -279,6 +279,8 @@ namespace entry
|
||||
case NSPageDownFunctionKey: return Key::PageDown;
|
||||
case NSHomeFunctionKey: return Key::Home;
|
||||
case NSEndFunctionKey: return Key::End;
|
||||
case NSInsertFunctionKey: return Key::Insert;
|
||||
case NSDeleteFunctionKey: return Key::Delete;
|
||||
|
||||
case NSPrintScreenFunctionKey: return Key::Print;
|
||||
}
|
||||
|
||||
@@ -291,6 +291,7 @@ namespace entry
|
||||
bx::memSet(s_translateKey, 0, sizeof(s_translateKey) );
|
||||
initTranslateKey(SDL_SCANCODE_ESCAPE, Key::Esc);
|
||||
initTranslateKey(SDL_SCANCODE_RETURN, Key::Return);
|
||||
initTranslateKey(SDL_SCANCODE_KP_ENTER, Key::Return);
|
||||
initTranslateKey(SDL_SCANCODE_TAB, Key::Tab);
|
||||
initTranslateKey(SDL_SCANCODE_BACKSPACE, Key::Backspace);
|
||||
initTranslateKey(SDL_SCANCODE_SPACE, Key::Space);
|
||||
@@ -298,6 +299,8 @@ namespace entry
|
||||
initTranslateKey(SDL_SCANCODE_DOWN, Key::Down);
|
||||
initTranslateKey(SDL_SCANCODE_LEFT, Key::Left);
|
||||
initTranslateKey(SDL_SCANCODE_RIGHT, Key::Right);
|
||||
initTranslateKey(SDL_SCANCODE_INSERT, Key::Insert);
|
||||
initTranslateKey(SDL_SCANCODE_DELETE, Key::Delete);
|
||||
initTranslateKey(SDL_SCANCODE_PAGEUP, Key::PageUp);
|
||||
initTranslateKey(SDL_SCANCODE_PAGEDOWN, Key::PageDown);
|
||||
initTranslateKey(SDL_SCANCODE_HOME, Key::Home);
|
||||
@@ -308,11 +311,17 @@ namespace entry
|
||||
initTranslateKey(SDL_SCANCODE_KP_MINUS, Key::Minus);
|
||||
initTranslateKey(SDL_SCANCODE_MINUS, Key::Minus);
|
||||
initTranslateKey(SDL_SCANCODE_GRAVE, Key::Tilde);
|
||||
initTranslateKey(SDL_SCANCODE_LEFTBRACKET, Key::LeftBracket);
|
||||
initTranslateKey(SDL_SCANCODE_RIGHTBRACKET, Key::RightBracket);
|
||||
initTranslateKey(SDL_SCANCODE_SEMICOLON, Key::Semicolon);
|
||||
initTranslateKey(SDL_SCANCODE_APOSTROPHE, Key::Quote);
|
||||
initTranslateKey(SDL_SCANCODE_KP_COMMA, Key::Comma);
|
||||
initTranslateKey(SDL_SCANCODE_COMMA, Key::Comma);
|
||||
initTranslateKey(SDL_SCANCODE_KP_PERIOD, Key::Period);
|
||||
initTranslateKey(SDL_SCANCODE_PERIOD, Key::Period);
|
||||
initTranslateKey(SDL_SCANCODE_KP_DIVIDE, Key::Slash);
|
||||
initTranslateKey(SDL_SCANCODE_SLASH, Key::Slash);
|
||||
initTranslateKey(SDL_SCANCODE_BACKSLASH, Key::Backslash);
|
||||
initTranslateKey(SDL_SCANCODE_F1, Key::F1);
|
||||
initTranslateKey(SDL_SCANCODE_F2, Key::F2);
|
||||
initTranslateKey(SDL_SCANCODE_F3, Key::F3);
|
||||
|
||||
@@ -380,7 +380,9 @@ namespace entry
|
||||
s_translateKey[VK_NEXT] = Key::PageDown;
|
||||
s_translateKey[VK_SNAPSHOT] = Key::Print;
|
||||
s_translateKey[VK_OEM_PLUS] = Key::Plus;
|
||||
s_translateKey[VK_ADD] = Key::Plus;
|
||||
s_translateKey[VK_OEM_MINUS] = Key::Minus;
|
||||
s_translateKey[VK_SUBTRACT] = Key::Minus;
|
||||
s_translateKey[VK_OEM_4] = Key::LeftBracket;
|
||||
s_translateKey[VK_OEM_6] = Key::RightBracket;
|
||||
s_translateKey[VK_OEM_1] = Key::Semicolon;
|
||||
@@ -389,6 +391,7 @@ namespace entry
|
||||
s_translateKey[VK_OEM_PERIOD] = Key::Period;
|
||||
s_translateKey[VK_DECIMAL] = Key::Period;
|
||||
s_translateKey[VK_OEM_2] = Key::Slash;
|
||||
s_translateKey[VK_DIVIDE] = Key::Slash;
|
||||
s_translateKey[VK_OEM_5] = Key::Backslash;
|
||||
s_translateKey[VK_OEM_3] = Key::Tilde;
|
||||
s_translateKey[VK_F1] = Key::F1;
|
||||
|
||||
@@ -250,21 +250,26 @@ namespace entry
|
||||
initTranslateKey(XK_Insert, Key::Insert);
|
||||
initTranslateKey(XK_Delete, Key::Delete);
|
||||
initTranslateKey(XK_Home, Key::Home);
|
||||
initTranslateKey(XK_KP_End, Key::End);
|
||||
initTranslateKey(XK_End, Key::End);
|
||||
initTranslateKey(XK_Page_Up, Key::PageUp);
|
||||
initTranslateKey(XK_Page_Down, Key::PageDown);
|
||||
initTranslateKey(XK_Print, Key::Print);
|
||||
initTranslateKey(XK_equal, Key::Plus);
|
||||
initTranslateKey(XK_KP_Add, Key::Plus);
|
||||
initTranslateKey(XK_minus, Key::Minus);
|
||||
initTranslateKey(XK_KP_Subtract, Key::Minus);
|
||||
initTranslateKey(XK_bracketleft, Key::LeftBracket);
|
||||
initTranslateKey(XK_bracketright, Key::RightBracket);
|
||||
initTranslateKey(XK_semicolon, Key::Semicolon);
|
||||
initTranslateKey(XK_apostrophe, Key::Quote);
|
||||
initTranslateKey(XK_comma, Key::Comma);
|
||||
initTranslateKey(XK_period, Key::Period);
|
||||
initTranslateKey(XK_KP_Decimal, Key::Period);
|
||||
initTranslateKey(XK_slash, Key::Slash);
|
||||
initTranslateKey(XK_KP_Divide, Key::Slash);
|
||||
initTranslateKey(XK_backslash, Key::Backslash);
|
||||
initTranslateKey(XK_grave, Key::Tilde);
|
||||
initTranslateKey(XK_KP_Enter, Key::Return);
|
||||
initTranslateKey(XK_F1, Key::F1);
|
||||
initTranslateKey(XK_F2, Key::F2);
|
||||
initTranslateKey(XK_F3, Key::F3);
|
||||
|
||||
Reference in New Issue
Block a user