openMSX
|
Classes | |
struct | CmpKeys |
struct | P |
Enumerations | |
enum | KeyCode { K_MASK = 0x1FFFF , K_NONE = K_MASK , K_UNKNOWN = 0 , K_BACKSPACE = 8 , K_TAB = 9 , K_CLEAR = 12 , K_RETURN = 13 , K_PAUSE = 19 , K_ESCAPE = 27 , K_SPACE = ' ' , K_EXCLAIM = '!' , K_QUOTEDBL = '"' , K_HASH = '#' , K_DOLLAR = '$' , K_AMPERSAND = '&' , K_QUOTE = '\'' , K_LEFTPAREN = '(' , K_RIGHTPAREN = ')' , K_ASTERISK = '*' , K_PLUS = '+' , K_COMMA = ',' , K_MINUS = '-' , K_PERIOD = '.' , K_SLASH = '/' , K_0 = '0' , K_1 = '1' , K_2 = '2' , K_3 = '3' , K_4 = '4' , K_5 = '5' , K_6 = '6' , K_7 = '7' , K_8 = '8' , K_9 = '9' , K_COLON = ':' , K_SEMICOLON = ';' , K_LESS = '<' , K_EQUALS = '=' , K_GREATER = '>' , K_QUESTION = '?' , K_AT = '@' , K_LEFTBRACKET = '[' , K_BACKSLASH = '\\' , K_RIGHTBRACKET = ']' , K_CARET = '^' , K_UNDERSCORE = '_' , K_BACKQUOTE = '`' , K_A = 'a' , K_B = 'b' , K_C = 'c' , K_D = 'd' , K_E = 'e' , K_F = 'f' , K_G = 'g' , K_H = 'h' , K_I = 'i' , K_J = 'j' , K_K = 'k' , K_L = 'l' , K_M = 'm' , K_N = 'n' , K_O = 'o' , K_P = 'p' , K_Q = 'q' , K_R = 'r' , K_S = 's' , K_T = 't' , K_U = 'u' , K_V = 'v' , K_W = 'w' , K_X = 'x' , K_Y = 'y' , K_Z = 'z' , K_DELETE = 127 , K_KP0 = 0x100 , K_KP1 = 0x101 , K_KP2 = 0x102 , K_KP3 = 0x103 , K_KP4 = 0x104 , K_KP5 = 0x105 , K_KP6 = 0x106 , K_KP7 = 0x107 , K_KP8 = 0x108 , K_KP9 = 0x109 , K_KP_PERIOD = 0x10A , K_KP_DIVIDE = 0x10B , K_KP_MULTIPLY = 0x10C , K_KP_MINUS = 0x10D , K_KP_PLUS = 0x10E , K_KP_ENTER = 0x10F , K_KP_EQUALS = 0x110 , K_UP = 0x111 , K_DOWN = 0x112 , K_RIGHT = 0x113 , K_LEFT = 0x114 , K_INSERT = 0x115 , K_HOME = 0x116 , K_END = 0x117 , K_PAGEUP = 0x118 , K_PAGEDOWN = 0x119 , K_F1 = 0x11A , K_F2 = 0x11B , K_F3 = 0x11C , K_F4 = 0x11D , K_F5 = 0x11E , K_F6 = 0x11F , K_F7 = 0x120 , K_F8 = 0x121 , K_F9 = 0x122 , K_F10 = 0x123 , K_F11 = 0x124 , K_F12 = 0x125 , K_F13 = 0x126 , K_F14 = 0x127 , K_F15 = 0x128 , K_F16 = 0x129 , K_F17 = 0x12A , K_F18 = 0x12B , K_F19 = 0x144 , K_F20 = 0x145 , K_F21 = 0x146 , K_F22 = 0x147 , K_F23 = 0x148 , K_F24 = 0x149 , K_NUMLOCK = 0x12C , K_CAPSLOCK = 0x12D , K_SCROLLLOCK = 0x12E , K_RSHIFT = 0x12F , K_LSHIFT = 0x130 , K_RCTRL = 0x131 , K_LCTRL = 0x132 , K_RALT = 0x133 , K_LALT = 0x134 , K_LSUPER = 0x137 , K_RSUPER = 0x138 , K_MODE = 0x139 , K_HELP = 0x13B , K_PRINT = 0x13C , K_SYSREQ = 0x13D , K_MENU = 0x13F , K_POWER = 0x140 , K_UNDO = 0x142 , K_BACK = 0x143 , K_ZENKAKU_HENKAKU = 0x10000 , K_MUHENKAN = 0x10001 , K_HENKAN_MODE = 0x10002 , K_HIRAGANA_KATAKANA = 0x10003 , KM_SHIFT = 0x020000 , KM_CTRL = 0x040000 , KM_ALT = 0x080000 , KM_META = 0x100000 , KM_MODE = 0x200000 , KD_PRESS = 0 , KD_RELEASE = 0x400000 } |
Constants that identify keys and key modifiers. More... | |
Functions | |
KeyCode | getCode (std::string_view name) |
Translate key name to key code. More... | |
std::pair< KeyCode, KeyCode > | getCodes (SDL_Keycode keyCode, Uint16 mod=KMOD_NONE, SDL_Scancode scanCode=SDL_SCANCODE_UNKNOWN, bool release=false) |
Translate SDL_Keycode/SDL_Scancode into openMSX key/scan Keycode's. More... | |
std::string | getName (KeyCode keyCode) |
Translate key code to key name. More... | |
KeyCode | combine (KeyCode key, KeyCode modifier) |
Convenience method to create key combinations (hides ugly casts). More... | |
Constants that identify keys and key modifiers.
There are two special key codes:
Convenience method to create key combinations (hides ugly casts).
Definition at line 234 of file Keys.hh.
Referenced by openmsx::PixelOperations< Pixel >::blend(), getCodes(), and openmsx::PixelOperations< Pixel >::lerp().
KeyCode openmsx::Keys::getCode | ( | std::string_view | name | ) |
Translate key name to key code.
Returns K_NONE when the name is unknown.
Definition at line 330 of file Keys.cc.
References binary_find(), K_MASK, and K_NONE.
Referenced by openmsx::KeyCodeSetting::getKey(), and openmsx::KeyCodeSetting::KeyCodeSetting().
std::pair< KeyCode, KeyCode > openmsx::Keys::getCodes | ( | SDL_Keycode | sdlKeyCode, |
Uint16 | mod, | ||
SDL_Scancode | sdlScanCode, | ||
bool | release | ||
) |
Translate SDL_Keycode/SDL_Scancode into openMSX key/scan Keycode's.
Definition at line 357 of file Keys.cc.
References combine(), K_0, K_1, K_2, K_3, K_4, K_5, K_6, K_7, K_8, K_9, K_A, K_AMPERSAND, K_ASTERISK, K_AT, K_B, K_BACK, K_BACKQUOTE, K_BACKSLASH, K_BACKSPACE, K_C, K_CAPSLOCK, K_CARET, K_CLEAR, K_COLON, K_COMMA, K_D, K_DELETE, K_DOLLAR, K_DOWN, K_E, K_END, K_EQUALS, K_ESCAPE, K_EXCLAIM, K_F, K_F1, K_F10, K_F11, K_F12, K_F13, K_F14, K_F15, K_F16, K_F17, K_F18, K_F19, K_F2, K_F20, K_F21, K_F22, K_F23, K_F24, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_G, K_GREATER, K_H, K_HASH, K_HELP, K_HENKAN_MODE, K_HIRAGANA_KATAKANA, K_HOME, K_I, K_INSERT, K_J, K_K, K_KP0, K_KP1, K_KP2, K_KP3, K_KP4, K_KP5, K_KP6, K_KP7, K_KP8, K_KP9, K_KP_DIVIDE, K_KP_ENTER, K_KP_EQUALS, K_KP_MINUS, K_KP_MULTIPLY, K_KP_PERIOD, K_KP_PLUS, K_L, K_LALT, K_LCTRL, K_LEFT, K_LEFTBRACKET, K_LEFTPAREN, K_LESS, K_LSHIFT, K_LSUPER, K_M, K_MENU, K_MINUS, K_MODE, K_N, K_NUMLOCK, K_O, K_P, K_PAGEDOWN, K_PAGEUP, K_PAUSE, K_PERIOD, K_PLUS, K_POWER, K_PRINT, K_Q, K_QUESTION, K_QUOTE, K_QUOTEDBL, K_R, K_RALT, K_RCTRL, K_RETURN, K_RIGHT, K_RIGHTBRACKET, K_RIGHTPAREN, K_RSHIFT, K_RSUPER, K_S, K_SCROLLLOCK, K_SEMICOLON, K_SLASH, K_SPACE, K_SYSREQ, K_T, K_TAB, K_U, K_UNDERSCORE, K_UNDO, K_UNKNOWN, K_UP, K_V, K_W, K_X, K_Y, K_Z, K_ZENKAKU_HENKAKU, KD_RELEASE, KM_ALT, KM_CTRL, KM_META, KM_MODE, and KM_SHIFT.
std::string openmsx::Keys::getName | ( | KeyCode | keyCode | ) |
Translate key code to key name.
Returns the string "unknown" for unknown key codes.
Definition at line 730 of file Keys.cc.
References K_MASK, KD_RELEASE, KM_ALT, KM_CTRL, KM_META, KM_MODE, and KM_SHIFT.
Referenced by openmsx::ArchiveBase< Derived >::serializeBase(), openmsx::toTclList(), and openmsx::ChakkariCopy::writeIO().