openMSX
Namespaces | Enumerations | Functions
Keys.hh File Reference
#include "string_view.hh"
#include <SDL_stdinc.h>
#include <SDL_keysym.h>
#include <string>
Include dependency graph for Keys.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 openmsx
 Thanks to enen for testing this on a real cartridge:
 
 openmsx::Keys
 

Enumerations

enum  openmsx::Keys::KeyCode {
  openmsx::Keys::K_NONE = -1, openmsx::Keys::K_UNKNOWN = SDLK_UNKNOWN, openmsx::Keys::K_BACKSPACE = SDLK_BACKSPACE, openmsx::Keys::K_TAB = SDLK_TAB,
  openmsx::Keys::K_CLEAR = SDLK_CLEAR, openmsx::Keys::K_RETURN = SDLK_RETURN, openmsx::Keys::K_PAUSE = SDLK_PAUSE, openmsx::Keys::K_ESCAPE = SDLK_ESCAPE,
  openmsx::Keys::K_SPACE = SDLK_SPACE, openmsx::Keys::K_EXCLAIM = SDLK_EXCLAIM, openmsx::Keys::K_QUOTEDBL = SDLK_QUOTEDBL, openmsx::Keys::K_HASH = SDLK_HASH,
  openmsx::Keys::K_DOLLAR = SDLK_DOLLAR, openmsx::Keys::K_AMPERSAND = SDLK_AMPERSAND, openmsx::Keys::K_QUOTE = SDLK_QUOTE, openmsx::Keys::K_LEFTPAREN = SDLK_LEFTPAREN,
  openmsx::Keys::K_RIGHTPAREN = SDLK_RIGHTPAREN, openmsx::Keys::K_ASTERISK = SDLK_ASTERISK, openmsx::Keys::K_PLUS = SDLK_PLUS, openmsx::Keys::K_COMMA = SDLK_COMMA,
  openmsx::Keys::K_MINUS = SDLK_MINUS, openmsx::Keys::K_PERIOD = SDLK_PERIOD, openmsx::Keys::K_SLASH = SDLK_SLASH, openmsx::Keys::K_0 = SDLK_0,
  openmsx::Keys::K_1 = SDLK_1, openmsx::Keys::K_2 = SDLK_2, openmsx::Keys::K_3 = SDLK_3, openmsx::Keys::K_4 = SDLK_4,
  openmsx::Keys::K_5 = SDLK_5, openmsx::Keys::K_6 = SDLK_6, openmsx::Keys::K_7 = SDLK_7, openmsx::Keys::K_8 = SDLK_8,
  openmsx::Keys::K_9 = SDLK_9, openmsx::Keys::K_COLON = SDLK_COLON, openmsx::Keys::K_SEMICOLON = SDLK_SEMICOLON, openmsx::Keys::K_LESS = SDLK_LESS,
  openmsx::Keys::K_EQUALS = SDLK_EQUALS, openmsx::Keys::K_GREATER = SDLK_GREATER, openmsx::Keys::K_QUESTION = SDLK_QUESTION, openmsx::Keys::K_AT = SDLK_AT,
  openmsx::Keys::K_LEFTBRACKET = SDLK_LEFTBRACKET, openmsx::Keys::K_BACKSLASH = SDLK_BACKSLASH, openmsx::Keys::K_RIGHTBRACKET = SDLK_RIGHTBRACKET, openmsx::Keys::K_CARET = SDLK_CARET,
  openmsx::Keys::K_UNDERSCORE = SDLK_UNDERSCORE, openmsx::Keys::K_BACKQUOTE = SDLK_BACKQUOTE, openmsx::Keys::K_A = SDLK_a, openmsx::Keys::K_B = SDLK_b,
  openmsx::Keys::K_C = SDLK_c, openmsx::Keys::K_D = SDLK_d, openmsx::Keys::K_E = SDLK_e, openmsx::Keys::K_F = SDLK_f,
  openmsx::Keys::K_G = SDLK_g, openmsx::Keys::K_H = SDLK_h, openmsx::Keys::K_I = SDLK_i, openmsx::Keys::K_J = SDLK_j,
  openmsx::Keys::K_K = SDLK_k, openmsx::Keys::K_L = SDLK_l, openmsx::Keys::K_M = SDLK_m, openmsx::Keys::K_N = SDLK_n,
  openmsx::Keys::K_O = SDLK_o, openmsx::Keys::K_P = SDLK_p, openmsx::Keys::K_Q = SDLK_q, openmsx::Keys::K_R = SDLK_r,
  openmsx::Keys::K_S = SDLK_s, openmsx::Keys::K_T = SDLK_t, openmsx::Keys::K_U = SDLK_u, openmsx::Keys::K_V = SDLK_v,
  openmsx::Keys::K_W = SDLK_w, openmsx::Keys::K_X = SDLK_x, openmsx::Keys::K_Y = SDLK_y, openmsx::Keys::K_Z = SDLK_z,
  openmsx::Keys::K_DELETE = SDLK_DELETE, openmsx::Keys::K_WORLD_0 = SDLK_WORLD_0, openmsx::Keys::K_WORLD_1 = SDLK_WORLD_1, openmsx::Keys::K_WORLD_2 = SDLK_WORLD_2,
  openmsx::Keys::K_WORLD_3 = SDLK_WORLD_3, openmsx::Keys::K_WORLD_4 = SDLK_WORLD_4, openmsx::Keys::K_WORLD_5 = SDLK_WORLD_5, openmsx::Keys::K_WORLD_6 = SDLK_WORLD_6,
  openmsx::Keys::K_WORLD_7 = SDLK_WORLD_7, openmsx::Keys::K_WORLD_8 = SDLK_WORLD_8, openmsx::Keys::K_WORLD_9 = SDLK_WORLD_9, openmsx::Keys::K_WORLD_10 = SDLK_WORLD_10,
  openmsx::Keys::K_WORLD_11 = SDLK_WORLD_11, openmsx::Keys::K_WORLD_12 = SDLK_WORLD_12, openmsx::Keys::K_WORLD_13 = SDLK_WORLD_13, openmsx::Keys::K_WORLD_14 = SDLK_WORLD_14,
  openmsx::Keys::K_WORLD_15 = SDLK_WORLD_15, openmsx::Keys::K_WORLD_16 = SDLK_WORLD_16, openmsx::Keys::K_WORLD_17 = SDLK_WORLD_17, openmsx::Keys::K_WORLD_18 = SDLK_WORLD_18,
  openmsx::Keys::K_WORLD_19 = SDLK_WORLD_19, openmsx::Keys::K_WORLD_20 = SDLK_WORLD_20, openmsx::Keys::K_WORLD_21 = SDLK_WORLD_21, openmsx::Keys::K_WORLD_22 = SDLK_WORLD_22,
  openmsx::Keys::K_WORLD_23 = SDLK_WORLD_23, openmsx::Keys::K_WORLD_24 = SDLK_WORLD_24, openmsx::Keys::K_WORLD_25 = SDLK_WORLD_25, openmsx::Keys::K_WORLD_26 = SDLK_WORLD_26,
  openmsx::Keys::K_WORLD_27 = SDLK_WORLD_27, openmsx::Keys::K_WORLD_28 = SDLK_WORLD_28, openmsx::Keys::K_WORLD_29 = SDLK_WORLD_29, openmsx::Keys::K_WORLD_30 = SDLK_WORLD_30,
  openmsx::Keys::K_WORLD_31 = SDLK_WORLD_31, openmsx::Keys::K_WORLD_32 = SDLK_WORLD_32, openmsx::Keys::K_WORLD_33 = SDLK_WORLD_33, openmsx::Keys::K_WORLD_34 = SDLK_WORLD_34,
  openmsx::Keys::K_WORLD_35 = SDLK_WORLD_35, openmsx::Keys::K_WORLD_36 = SDLK_WORLD_36, openmsx::Keys::K_WORLD_37 = SDLK_WORLD_37, openmsx::Keys::K_WORLD_38 = SDLK_WORLD_38,
  openmsx::Keys::K_WORLD_39 = SDLK_WORLD_39, openmsx::Keys::K_WORLD_40 = SDLK_WORLD_40, openmsx::Keys::K_WORLD_41 = SDLK_WORLD_41, openmsx::Keys::K_WORLD_42 = SDLK_WORLD_42,
  openmsx::Keys::K_WORLD_43 = SDLK_WORLD_43, openmsx::Keys::K_WORLD_44 = SDLK_WORLD_44, openmsx::Keys::K_WORLD_45 = SDLK_WORLD_45, openmsx::Keys::K_WORLD_46 = SDLK_WORLD_46,
  openmsx::Keys::K_WORLD_47 = SDLK_WORLD_47, openmsx::Keys::K_WORLD_48 = SDLK_WORLD_48, openmsx::Keys::K_WORLD_49 = SDLK_WORLD_49, openmsx::Keys::K_WORLD_50 = SDLK_WORLD_50,
  openmsx::Keys::K_WORLD_51 = SDLK_WORLD_51, openmsx::Keys::K_WORLD_52 = SDLK_WORLD_52, openmsx::Keys::K_WORLD_53 = SDLK_WORLD_53, openmsx::Keys::K_WORLD_54 = SDLK_WORLD_54,
  openmsx::Keys::K_WORLD_55 = SDLK_WORLD_55, openmsx::Keys::K_WORLD_56 = SDLK_WORLD_56, openmsx::Keys::K_WORLD_57 = SDLK_WORLD_57, openmsx::Keys::K_WORLD_58 = SDLK_WORLD_58,
  openmsx::Keys::K_WORLD_59 = SDLK_WORLD_59, openmsx::Keys::K_WORLD_60 = SDLK_WORLD_60, openmsx::Keys::K_WORLD_61 = SDLK_WORLD_61, openmsx::Keys::K_WORLD_62 = SDLK_WORLD_62,
  openmsx::Keys::K_WORLD_63 = SDLK_WORLD_63, openmsx::Keys::K_WORLD_64 = SDLK_WORLD_64, openmsx::Keys::K_WORLD_65 = SDLK_WORLD_65, openmsx::Keys::K_WORLD_66 = SDLK_WORLD_66,
  openmsx::Keys::K_WORLD_67 = SDLK_WORLD_67, openmsx::Keys::K_WORLD_68 = SDLK_WORLD_68, openmsx::Keys::K_WORLD_69 = SDLK_WORLD_69, openmsx::Keys::K_WORLD_70 = SDLK_WORLD_70,
  openmsx::Keys::K_WORLD_71 = SDLK_WORLD_71, openmsx::Keys::K_WORLD_72 = SDLK_WORLD_72, openmsx::Keys::K_WORLD_73 = SDLK_WORLD_73, openmsx::Keys::K_WORLD_74 = SDLK_WORLD_74,
  openmsx::Keys::K_WORLD_75 = SDLK_WORLD_75, openmsx::Keys::K_WORLD_76 = SDLK_WORLD_76, openmsx::Keys::K_WORLD_77 = SDLK_WORLD_77, openmsx::Keys::K_WORLD_78 = SDLK_WORLD_78,
  openmsx::Keys::K_WORLD_79 = SDLK_WORLD_79, openmsx::Keys::K_WORLD_80 = SDLK_WORLD_80, openmsx::Keys::K_WORLD_81 = SDLK_WORLD_81, openmsx::Keys::K_WORLD_82 = SDLK_WORLD_82,
  openmsx::Keys::K_WORLD_83 = SDLK_WORLD_83, openmsx::Keys::K_WORLD_84 = SDLK_WORLD_84, openmsx::Keys::K_WORLD_85 = SDLK_WORLD_85, openmsx::Keys::K_WORLD_86 = SDLK_WORLD_86,
  openmsx::Keys::K_WORLD_87 = SDLK_WORLD_87, openmsx::Keys::K_WORLD_88 = SDLK_WORLD_88, openmsx::Keys::K_WORLD_89 = SDLK_WORLD_89, openmsx::Keys::K_WORLD_90 = SDLK_WORLD_90,
  openmsx::Keys::K_WORLD_91 = SDLK_WORLD_91, openmsx::Keys::K_WORLD_92 = SDLK_WORLD_92, openmsx::Keys::K_WORLD_93 = SDLK_WORLD_93, openmsx::Keys::K_WORLD_94 = SDLK_WORLD_94,
  openmsx::Keys::K_WORLD_95 = SDLK_WORLD_95, openmsx::Keys::K_KP0 = SDLK_KP0, openmsx::Keys::K_KP1 = SDLK_KP1, openmsx::Keys::K_KP2 = SDLK_KP2,
  openmsx::Keys::K_KP3 = SDLK_KP3, openmsx::Keys::K_KP4 = SDLK_KP4, openmsx::Keys::K_KP5 = SDLK_KP5, openmsx::Keys::K_KP6 = SDLK_KP6,
  openmsx::Keys::K_KP7 = SDLK_KP7, openmsx::Keys::K_KP8 = SDLK_KP8, openmsx::Keys::K_KP9 = SDLK_KP9, openmsx::Keys::K_KP_PERIOD = SDLK_KP_PERIOD,
  openmsx::Keys::K_KP_DIVIDE = SDLK_KP_DIVIDE, openmsx::Keys::K_KP_MULTIPLY = SDLK_KP_MULTIPLY, openmsx::Keys::K_KP_MINUS = SDLK_KP_MINUS, openmsx::Keys::K_KP_PLUS = SDLK_KP_PLUS,
  openmsx::Keys::K_KP_ENTER = SDLK_KP_ENTER, openmsx::Keys::K_KP_EQUALS = SDLK_KP_EQUALS, openmsx::Keys::K_UP = SDLK_UP, openmsx::Keys::K_DOWN = SDLK_DOWN,
  openmsx::Keys::K_RIGHT = SDLK_RIGHT, openmsx::Keys::K_LEFT = SDLK_LEFT, openmsx::Keys::K_INSERT = SDLK_INSERT, openmsx::Keys::K_HOME = SDLK_HOME,
  openmsx::Keys::K_END = SDLK_END, openmsx::Keys::K_PAGEUP = SDLK_PAGEUP, openmsx::Keys::K_PAGEDOWN = SDLK_PAGEDOWN, openmsx::Keys::K_F1 = SDLK_F1,
  openmsx::Keys::K_F2 = SDLK_F2, openmsx::Keys::K_F3 = SDLK_F3, openmsx::Keys::K_F4 = SDLK_F4, openmsx::Keys::K_F5 = SDLK_F5,
  openmsx::Keys::K_F6 = SDLK_F6, openmsx::Keys::K_F7 = SDLK_F7, openmsx::Keys::K_F8 = SDLK_F8, openmsx::Keys::K_F9 = SDLK_F9,
  openmsx::Keys::K_F10 = SDLK_F10, openmsx::Keys::K_F11 = SDLK_F11, openmsx::Keys::K_F12 = SDLK_F12, openmsx::Keys::K_F13 = SDLK_F13,
  openmsx::Keys::K_F14 = SDLK_F14, openmsx::Keys::K_F15 = SDLK_F15, openmsx::Keys::K_NUMLOCK = SDLK_NUMLOCK, openmsx::Keys::K_CAPSLOCK = SDLK_CAPSLOCK,
  openmsx::Keys::K_SCROLLOCK = SDLK_SCROLLOCK, openmsx::Keys::K_RSHIFT = SDLK_RSHIFT, openmsx::Keys::K_LSHIFT = SDLK_LSHIFT, openmsx::Keys::K_RCTRL = SDLK_RCTRL,
  openmsx::Keys::K_LCTRL = SDLK_LCTRL, openmsx::Keys::K_RALT = SDLK_RALT, openmsx::Keys::K_LALT = SDLK_LALT, openmsx::Keys::K_RMETA = SDLK_RMETA,
  openmsx::Keys::K_LMETA = SDLK_LMETA, openmsx::Keys::K_LSUPER = SDLK_LSUPER, openmsx::Keys::K_RSUPER = SDLK_RSUPER, openmsx::Keys::K_MODE = SDLK_MODE,
  openmsx::Keys::K_COMPOSE = SDLK_COMPOSE, openmsx::Keys::K_HELP = SDLK_HELP, openmsx::Keys::K_PRINT = SDLK_PRINT, openmsx::Keys::K_SYSREQ = SDLK_SYSREQ,
  openmsx::Keys::K_BREAK = SDLK_BREAK, openmsx::Keys::K_MENU = SDLK_MENU, openmsx::Keys::K_POWER = SDLK_POWER, openmsx::Keys::K_EURO = SDLK_EURO,
  openmsx::Keys::K_UNDO = SDLK_UNDO, openmsx::Keys::K_ZENKAKU_HENKAKU = 0x10000, openmsx::Keys::K_MUHENKAN = 0x10001, openmsx::Keys::K_HENKAN_MODE = 0x10002,
  openmsx::Keys::K_HIRAGANA_KATAKANA = 0x10003, openmsx::Keys::K_MASK = 0x1FFFF, openmsx::Keys::KM_SHIFT = 0x020000, openmsx::Keys::KM_CTRL = 0x040000,
  openmsx::Keys::KM_ALT = 0x080000, openmsx::Keys::KM_META = 0x100000, openmsx::Keys::KM_MODE = 0x200000, openmsx::Keys::KD_PRESS = 0,
  openmsx::Keys::KD_RELEASE = 0x400000
}
 Constants that identify keys and key modifiers. More...
 

Functions

KeyCode openmsx::Keys::getCode (string_view name)
 Translate key name to key code. More...
 
KeyCode openmsx::Keys::getCode (SDLKey key, SDLMod mod, Uint8 scancode, bool release)
 
const string openmsx::Keys::getName (KeyCode keyCode)
 Translate key code to key name. More...
 
KeyCode openmsx::Keys::combine (KeyCode key, KeyCode modifier)
 Convenience method to create key combinations (hides ugly casts). More...