mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Shortened the names of the left/right square bracket keys.
This commit is contained in:
parent
a44d566057
commit
3b0084799c
@ -245,9 +245,9 @@ extern "C" {
|
||||
#define GLFW_KEY_X 88
|
||||
#define GLFW_KEY_Y 89
|
||||
#define GLFW_KEY_Z 90
|
||||
#define GLFW_KEY_LEFT_SQUARE_BRACKET 91 /* [ */
|
||||
#define GLFW_KEY_LEFT_BRACKET 91 /* [ */
|
||||
#define GLFW_KEY_BACKSLASH 92 /* \ */
|
||||
#define GLFW_KEY_RIGHT_SQUARE_BRACKET 93 /* ] */
|
||||
#define GLFW_KEY_RIGHT_BRACKET 93 /* ] */
|
||||
#define GLFW_KEY_GRAVE_ACCENT 96 /* ` */
|
||||
#define GLFW_KEY_WORLD_1 161 /* non-US #1 */
|
||||
#define GLFW_KEY_WORLD_2 162 /* non-US #2 */
|
||||
|
@ -128,8 +128,8 @@ static void updateKeyCodeLUT(void)
|
||||
else if (strcmp(name, "AD08") == 0) keyCodeGLFW = GLFW_KEY_I;
|
||||
else if (strcmp(name, "AD09") == 0) keyCodeGLFW = GLFW_KEY_O;
|
||||
else if (strcmp(name, "AD10") == 0) keyCodeGLFW = GLFW_KEY_P;
|
||||
else if (strcmp(name, "AD11") == 0) keyCodeGLFW = GLFW_KEY_LEFT_SQUARE_BRACKET;
|
||||
else if (strcmp(name, "AD12") == 0) keyCodeGLFW = GLFW_KEY_RIGHT_SQUARE_BRACKET;
|
||||
else if (strcmp(name, "AD11") == 0) keyCodeGLFW = GLFW_KEY_LEFT_BRACKET;
|
||||
else if (strcmp(name, "AD12") == 0) keyCodeGLFW = GLFW_KEY_RIGHT_BRACKET;
|
||||
else if (strcmp(name, "AC01") == 0) keyCodeGLFW = GLFW_KEY_A;
|
||||
else if (strcmp(name, "AC02") == 0) keyCodeGLFW = GLFW_KEY_S;
|
||||
else if (strcmp(name, "AC03") == 0) keyCodeGLFW = GLFW_KEY_D;
|
||||
|
@ -386,8 +386,8 @@ static int translateKey(int keycode)
|
||||
case XK_space: return GLFW_KEY_SPACE;
|
||||
case XK_minus: return GLFW_KEY_MINUS;
|
||||
case XK_equal: return GLFW_KEY_EQUAL;
|
||||
case XK_bracketleft: return GLFW_KEY_LEFT_SQUARE_BRACKET;
|
||||
case XK_bracketright: return GLFW_KEY_RIGHT_SQUARE_BRACKET;
|
||||
case XK_bracketleft: return GLFW_KEY_LEFT_BRACKET;
|
||||
case XK_bracketright: return GLFW_KEY_RIGHT_BRACKET;
|
||||
case XK_backslash: return GLFW_KEY_BACKSLASH;
|
||||
case XK_semicolon: return GLFW_KEY_SEMICOLON;
|
||||
case XK_apostrophe: return GLFW_KEY_APOSTROPHE;
|
||||
|
174
tests/events.c
174
tests/events.c
@ -47,32 +47,32 @@ static const char* get_key_name(int key)
|
||||
switch (key)
|
||||
{
|
||||
// Printable keys
|
||||
case GLFW_KEY_A: return "a";
|
||||
case GLFW_KEY_B: return "b";
|
||||
case GLFW_KEY_C: return "c";
|
||||
case GLFW_KEY_D: return "d";
|
||||
case GLFW_KEY_E: return "e";
|
||||
case GLFW_KEY_F: return "f";
|
||||
case GLFW_KEY_G: return "g";
|
||||
case GLFW_KEY_H: return "h";
|
||||
case GLFW_KEY_I: return "i";
|
||||
case GLFW_KEY_J: return "j";
|
||||
case GLFW_KEY_K: return "k";
|
||||
case GLFW_KEY_L: return "l";
|
||||
case GLFW_KEY_M: return "m";
|
||||
case GLFW_KEY_N: return "n";
|
||||
case GLFW_KEY_O: return "o";
|
||||
case GLFW_KEY_P: return "p";
|
||||
case GLFW_KEY_Q: return "q";
|
||||
case GLFW_KEY_R: return "r";
|
||||
case GLFW_KEY_S: return "s";
|
||||
case GLFW_KEY_T: return "t";
|
||||
case GLFW_KEY_U: return "u";
|
||||
case GLFW_KEY_V: return "v";
|
||||
case GLFW_KEY_W: return "w";
|
||||
case GLFW_KEY_X: return "x";
|
||||
case GLFW_KEY_Y: return "y";
|
||||
case GLFW_KEY_Z: return "z";
|
||||
case GLFW_KEY_A: return "A";
|
||||
case GLFW_KEY_B: return "B";
|
||||
case GLFW_KEY_C: return "C";
|
||||
case GLFW_KEY_D: return "D";
|
||||
case GLFW_KEY_E: return "E";
|
||||
case GLFW_KEY_F: return "F";
|
||||
case GLFW_KEY_G: return "G";
|
||||
case GLFW_KEY_H: return "H";
|
||||
case GLFW_KEY_I: return "I";
|
||||
case GLFW_KEY_J: return "J";
|
||||
case GLFW_KEY_K: return "K";
|
||||
case GLFW_KEY_L: return "L";
|
||||
case GLFW_KEY_M: return "M";
|
||||
case GLFW_KEY_N: return "N";
|
||||
case GLFW_KEY_O: return "O";
|
||||
case GLFW_KEY_P: return "P";
|
||||
case GLFW_KEY_Q: return "Q";
|
||||
case GLFW_KEY_R: return "R";
|
||||
case GLFW_KEY_S: return "S";
|
||||
case GLFW_KEY_T: return "T";
|
||||
case GLFW_KEY_U: return "U";
|
||||
case GLFW_KEY_V: return "V";
|
||||
case GLFW_KEY_W: return "W";
|
||||
case GLFW_KEY_X: return "X";
|
||||
case GLFW_KEY_Y: return "Y";
|
||||
case GLFW_KEY_Z: return "Z";
|
||||
case GLFW_KEY_1: return "1";
|
||||
case GLFW_KEY_2: return "2";
|
||||
case GLFW_KEY_3: return "3";
|
||||
@ -83,23 +83,23 @@ static const char* get_key_name(int key)
|
||||
case GLFW_KEY_8: return "8";
|
||||
case GLFW_KEY_9: return "9";
|
||||
case GLFW_KEY_0: return "0";
|
||||
case GLFW_KEY_SPACE: return "space";
|
||||
case GLFW_KEY_MINUS: return "-";
|
||||
case GLFW_KEY_EQUAL: return "=";
|
||||
case GLFW_KEY_LEFT_SQUARE_BRACKET: return "[";
|
||||
case GLFW_KEY_RIGHT_SQUARE_BRACKET: return "]";
|
||||
case GLFW_KEY_BACKSLASH: return "\\";
|
||||
case GLFW_KEY_SEMICOLON: return ";";
|
||||
case GLFW_KEY_APOSTROPHE: return "'";
|
||||
case GLFW_KEY_GRAVE_ACCENT: return "`";
|
||||
case GLFW_KEY_COMMA: return ",";
|
||||
case GLFW_KEY_PERIOD: return ".";
|
||||
case GLFW_KEY_SLASH: return "/";
|
||||
case GLFW_KEY_WORLD_1: return "world 1";
|
||||
case GLFW_KEY_WORLD_2: return "world 2";
|
||||
case GLFW_KEY_SPACE: return "SPACE";
|
||||
case GLFW_KEY_MINUS: return "MINUS";
|
||||
case GLFW_KEY_EQUAL: return "EQUAL";
|
||||
case GLFW_KEY_LEFT_BRACKET: return "LEFT BRACKET";
|
||||
case GLFW_KEY_RIGHT_BRACKET: return "RIGHT BRACKET";
|
||||
case GLFW_KEY_BACKSLASH: return "BACKSLASH";
|
||||
case GLFW_KEY_SEMICOLON: return "SEMICOLON";
|
||||
case GLFW_KEY_APOSTROPHE: return "APOSTROPHE";
|
||||
case GLFW_KEY_GRAVE_ACCENT: return "GRAVE ACCENT";
|
||||
case GLFW_KEY_COMMA: return "COMMA";
|
||||
case GLFW_KEY_PERIOD: return "PERIOD";
|
||||
case GLFW_KEY_SLASH: return "SLASH";
|
||||
case GLFW_KEY_WORLD_1: return "WORLD 1";
|
||||
case GLFW_KEY_WORLD_2: return "WORLD 2";
|
||||
|
||||
// Special keys
|
||||
case GLFW_KEY_ESC: return "escape";
|
||||
// Function keys
|
||||
case GLFW_KEY_ESC: return "ESCAPE";
|
||||
case GLFW_KEY_F1: return "F1";
|
||||
case GLFW_KEY_F2: return "F2";
|
||||
case GLFW_KEY_F3: return "F3";
|
||||
@ -125,52 +125,52 @@ static const char* get_key_name(int key)
|
||||
case GLFW_KEY_F23: return "F23";
|
||||
case GLFW_KEY_F24: return "F24";
|
||||
case GLFW_KEY_F25: return "F25";
|
||||
case GLFW_KEY_UP: return "up";
|
||||
case GLFW_KEY_DOWN: return "down";
|
||||
case GLFW_KEY_LEFT: return "left";
|
||||
case GLFW_KEY_RIGHT: return "right";
|
||||
case GLFW_KEY_LEFT_SHIFT: return "left shift";
|
||||
case GLFW_KEY_RIGHT_SHIFT: return "right shift";
|
||||
case GLFW_KEY_LEFT_CONTROL: return "left control";
|
||||
case GLFW_KEY_RIGHT_CONTROL: return "right control";
|
||||
case GLFW_KEY_LEFT_ALT: return "left alt";
|
||||
case GLFW_KEY_RIGHT_ALT: return "right alt";
|
||||
case GLFW_KEY_TAB: return "tab";
|
||||
case GLFW_KEY_ENTER: return "enter";
|
||||
case GLFW_KEY_BACKSPACE: return "backspace";
|
||||
case GLFW_KEY_INSERT: return "insert";
|
||||
case GLFW_KEY_DELETE: return "delete";
|
||||
case GLFW_KEY_PAGE_UP: return "page up";
|
||||
case GLFW_KEY_PAGE_DOWN: return "page down";
|
||||
case GLFW_KEY_HOME: return "home";
|
||||
case GLFW_KEY_END: return "end";
|
||||
case GLFW_KEY_KP_0: return "keypad 0";
|
||||
case GLFW_KEY_KP_1: return "keypad 1";
|
||||
case GLFW_KEY_KP_2: return "keypad 2";
|
||||
case GLFW_KEY_KP_3: return "keypad 3";
|
||||
case GLFW_KEY_KP_4: return "keypad 4";
|
||||
case GLFW_KEY_KP_5: return "keypad 5";
|
||||
case GLFW_KEY_KP_6: return "keypad 6";
|
||||
case GLFW_KEY_KP_7: return "keypad 7";
|
||||
case GLFW_KEY_KP_8: return "keypad 8";
|
||||
case GLFW_KEY_KP_9: return "keypad 9";
|
||||
case GLFW_KEY_KP_DIVIDE: return "keypad divide";
|
||||
case GLFW_KEY_KP_MULTIPLY: return "keypad multiply";
|
||||
case GLFW_KEY_KP_SUBTRACT: return "keypad subtract";
|
||||
case GLFW_KEY_KP_ADD: return "keypad add";
|
||||
case GLFW_KEY_KP_DECIMAL: return "keypad decimal";
|
||||
case GLFW_KEY_KP_EQUAL: return "keypad equal";
|
||||
case GLFW_KEY_KP_ENTER: return "keypad enter";
|
||||
case GLFW_KEY_NUM_LOCK: return "num lock";
|
||||
case GLFW_KEY_CAPS_LOCK: return "caps lock";
|
||||
case GLFW_KEY_SCROLL_LOCK: return "scroll lock";
|
||||
case GLFW_KEY_PAUSE: return "pause";
|
||||
case GLFW_KEY_LEFT_SUPER: return "left super";
|
||||
case GLFW_KEY_RIGHT_SUPER: return "right super";
|
||||
case GLFW_KEY_MENU: return "menu";
|
||||
}
|
||||
case GLFW_KEY_UP: return "UP";
|
||||
case GLFW_KEY_DOWN: return "DOWN";
|
||||
case GLFW_KEY_LEFT: return "LEFT";
|
||||
case GLFW_KEY_RIGHT: return "RIGHT";
|
||||
case GLFW_KEY_LEFT_SHIFT: return "LEFT SHIFT";
|
||||
case GLFW_KEY_RIGHT_SHIFT: return "RIGHT SHIFT";
|
||||
case GLFW_KEY_LEFT_CONTROL: return "LEFT CONTROL";
|
||||
case GLFW_KEY_RIGHT_CONTROL: return "RIGHT CONTROL";
|
||||
case GLFW_KEY_LEFT_ALT: return "LEFT ALT";
|
||||
case GLFW_KEY_RIGHT_ALT: return "RIGHT ALT";
|
||||
case GLFW_KEY_TAB: return "TAB";
|
||||
case GLFW_KEY_ENTER: return "ENTER";
|
||||
case GLFW_KEY_BACKSPACE: return "BACKSPACE";
|
||||
case GLFW_KEY_INSERT: return "INSERT";
|
||||
case GLFW_KEY_DELETE: return "DELETE";
|
||||
case GLFW_KEY_PAGE_UP: return "PAGE UP";
|
||||
case GLFW_KEY_PAGE_DOWN: return "PAGE DOWN";
|
||||
case GLFW_KEY_HOME: return "HOME";
|
||||
case GLFW_KEY_END: return "END";
|
||||
case GLFW_KEY_KP_0: return "KEYPAD 0";
|
||||
case GLFW_KEY_KP_1: return "KEYPAD 1";
|
||||
case GLFW_KEY_KP_2: return "KEYPAD 2";
|
||||
case GLFW_KEY_KP_3: return "KEYPAD 3";
|
||||
case GLFW_KEY_KP_4: return "KEYPAD 4";
|
||||
case GLFW_KEY_KP_5: return "KEYPAD 5";
|
||||
case GLFW_KEY_KP_6: return "KEYPAD 6";
|
||||
case GLFW_KEY_KP_7: return "KEYPAD 7";
|
||||
case GLFW_KEY_KP_8: return "KEYPAD 8";
|
||||
case GLFW_KEY_KP_9: return "KEYPAD 9";
|
||||
case GLFW_KEY_KP_DIVIDE: return "KEYPAD DIVIDE";
|
||||
case GLFW_KEY_KP_MULTIPLY: return "KEYPAD MULTPLY";
|
||||
case GLFW_KEY_KP_SUBTRACT: return "KEYPAD SUBTRACT";
|
||||
case GLFW_KEY_KP_ADD: return "KEYPAD ADD";
|
||||
case GLFW_KEY_KP_DECIMAL: return "KEYPAD DECIMAL";
|
||||
case GLFW_KEY_KP_EQUAL: return "KEYPAD EQUAL";
|
||||
case GLFW_KEY_KP_ENTER: return "KEYPAD ENTER";
|
||||
case GLFW_KEY_NUM_LOCK: return "NUM LOCK";
|
||||
case GLFW_KEY_CAPS_LOCK: return "CAPS LOCK";
|
||||
case GLFW_KEY_SCROLL_LOCK: return "SCROLL LOCK";
|
||||
case GLFW_KEY_PAUSE: return "PAUSE";
|
||||
case GLFW_KEY_LEFT_SUPER: return "LEFT SUPER";
|
||||
case GLFW_KEY_RIGHT_SUPER: return "RIGHT SUPER";
|
||||
case GLFW_KEY_MENU: return "MENU";
|
||||
|
||||
return NULL;
|
||||
default: return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static const char* get_action_name(int action)
|
||||
|
Loading…
Reference in New Issue
Block a user