The keyboard now works in TIA emulation mode. Still TODO is get ASCII

characters working, so the UI can be used.

SDL Window events are now sent to the EventHandler core.  For now, only
the window expose event is handled (redraws window if it's been hidden).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2872 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-03-09 19:22:04 +00:00
parent 0b3bf4b659
commit d0d04948c7
8 changed files with 536 additions and 381 deletions

View File

@ -57,10 +57,10 @@ void EventHandlerSDL2::pollEvent()
case SDL_KEYUP:
case SDL_KEYDOWN:
{
handleKeyEvent((StellaKey)event.key.keysym.sym,
if(!event.key.repeat)
handleKeyEvent((StellaKey)event.key.keysym.scancode,
(StellaMod)event.key.keysym.mod,
//FIXSDL event.key.keysym.unicode & 0x7f,
event.key.keysym.scancode,
'x', //FIXSDL event.key.keysym.scancode,
event.key.type == SDL_KEYDOWN);
break;
}
@ -133,17 +133,49 @@ void EventHandlerSDL2::pollEvent()
handleEvent(Event::Quit, 1);
break; // SDL_QUIT
#if 0 //FIXSDL
case SDL_ACTIVEEVENT:
if((event.active.state & SDL_APPACTIVE) && (event.active.gain == 0))
if(myState == S_EMULATE) enterMenuMode(S_MENU);
break; // SDL_ACTIVEEVENT
case SDL_VIDEOEXPOSE:
myOSystem->frameBuffer().refresh();
break; // SDL_VIDEOEXPOSE
#endif
case SDL_WINDOWEVENT:
switch(event.window.event)
{
case SDL_WINDOWEVENT_SHOWN:
handleSystemEvent(EVENT_WINDOW_SHOWN);
break;
case SDL_WINDOWEVENT_HIDDEN:
handleSystemEvent(EVENT_WINDOW_HIDDEN);
break;
case SDL_WINDOWEVENT_EXPOSED:
handleSystemEvent(EVENT_WINDOW_EXPOSED);
break;
case SDL_WINDOWEVENT_MOVED:
handleSystemEvent(EVENT_WINDOW_MOVED,
event.window.data1, event.window.data1);
break;
case SDL_WINDOWEVENT_RESIZED:
handleSystemEvent(EVENT_WINDOW_RESIZED,
event.window.data1, event.window.data1);
break;
case SDL_WINDOWEVENT_MINIMIZED:
handleSystemEvent(EVENT_WINDOW_MINIMIZED);
break;
case SDL_WINDOWEVENT_MAXIMIZED:
handleSystemEvent(EVENT_WINDOW_MAXIMIZED);
break;
case SDL_WINDOWEVENT_RESTORED:
handleSystemEvent(EVENT_WINDOW_RESTORED);
break;
case SDL_WINDOWEVENT_ENTER:
handleSystemEvent(EVENT_WINDOW_ENTER);
break;
case SDL_WINDOWEVENT_LEAVE:
handleSystemEvent(EVENT_WINDOW_LEAVE);
break;
case SDL_WINDOWEVENT_FOCUS_GAINED:
handleSystemEvent(EVENT_WINDOW_FOCUS_GAINED);
break;
case SDL_WINDOWEVENT_FOCUS_LOST:
handleSystemEvent(EVENT_WINDOW_FOCUS_LOST);
break;
}
break;
}
}
}

View File

@ -34,278 +34,362 @@
@author Stephen Anthony
*/
// This comes directly from SDL_keysym.h
typedef enum {
/** @name ASCII mapped keysyms
* The keyboard syms have been cleverly chosen to map to ASCII
*/
/*@{*/
// This comes directly from SDL_scancode.h
typedef enum
{
KBDK_UNKNOWN = 0,
KBDK_FIRST = 0,
KBDK_BACKSPACE = 8,
KBDK_TAB = 9,
KBDK_CLEAR = 12,
KBDK_RETURN = 13,
KBDK_PAUSE = 19,
KBDK_ESCAPE = 27,
KBDK_SPACE = 32,
KBDK_EXCLAIM = 33,
KBDK_QUOTEDBL = 34,
KBDK_HASH = 35,
KBDK_DOLLAR = 36,
KBDK_AMPERSAND = 38,
KBDK_QUOTE = 39,
KBDK_LEFTPAREN = 40,
KBDK_RIGHTPAREN = 41,
KBDK_ASTERISK = 42,
KBDK_PLUS = 43,
KBDK_COMMA = 44,
KBDK_MINUS = 45,
KBDK_PERIOD = 46,
KBDK_SLASH = 47,
KBDK_0 = 48,
KBDK_1 = 49,
KBDK_2 = 50,
KBDK_3 = 51,
KBDK_4 = 52,
KBDK_5 = 53,
KBDK_6 = 54,
KBDK_7 = 55,
KBDK_8 = 56,
KBDK_9 = 57,
KBDK_COLON = 58,
KBDK_SEMICOLON = 59,
KBDK_LESS = 60,
KBDK_EQUALS = 61,
KBDK_GREATER = 62,
KBDK_QUESTION = 63,
KBDK_AT = 64,
/*
Skip uppercase letters
/**
* \name Usage page 0x07
*
* These values are from usage page 0x07 (USB keyboard page).
*/
KBDK_LEFTBRACKET = 91,
KBDK_BACKSLASH = 92,
KBDK_RIGHTBRACKET = 93,
KBDK_CARET = 94,
KBDK_UNDERSCORE = 95,
KBDK_BACKQUOTE = 96,
KBDK_a = 97,
KBDK_b = 98,
KBDK_c = 99,
KBDK_d = 100,
KBDK_e = 101,
KBDK_f = 102,
KBDK_g = 103,
KBDK_h = 104,
KBDK_i = 105,
KBDK_j = 106,
KBDK_k = 107,
KBDK_l = 108,
KBDK_m = 109,
KBDK_n = 110,
KBDK_o = 111,
KBDK_p = 112,
KBDK_q = 113,
KBDK_r = 114,
KBDK_s = 115,
KBDK_t = 116,
KBDK_u = 117,
KBDK_v = 118,
KBDK_w = 119,
KBDK_x = 120,
KBDK_y = 121,
KBDK_z = 122,
KBDK_DELETE = 127,
/* End of ASCII mapped keysyms */
/*@}*/
/** @name International keyboard syms */
/* @{ */
KBDK_WORLD_0 = 160, /* 0xA0 */
KBDK_WORLD_1 = 161,
KBDK_WORLD_2 = 162,
KBDK_WORLD_3 = 163,
KBDK_WORLD_4 = 164,
KBDK_WORLD_5 = 165,
KBDK_WORLD_6 = 166,
KBDK_WORLD_7 = 167,
KBDK_WORLD_8 = 168,
KBDK_WORLD_9 = 169,
KBDK_WORLD_10 = 170,
KBDK_WORLD_11 = 171,
KBDK_WORLD_12 = 172,
KBDK_WORLD_13 = 173,
KBDK_WORLD_14 = 174,
KBDK_WORLD_15 = 175,
KBDK_WORLD_16 = 176,
KBDK_WORLD_17 = 177,
KBDK_WORLD_18 = 178,
KBDK_WORLD_19 = 179,
KBDK_WORLD_20 = 180,
KBDK_WORLD_21 = 181,
KBDK_WORLD_22 = 182,
KBDK_WORLD_23 = 183,
KBDK_WORLD_24 = 184,
KBDK_WORLD_25 = 185,
KBDK_WORLD_26 = 186,
KBDK_WORLD_27 = 187,
KBDK_WORLD_28 = 188,
KBDK_WORLD_29 = 189,
KBDK_WORLD_30 = 190,
KBDK_WORLD_31 = 191,
KBDK_WORLD_32 = 192,
KBDK_WORLD_33 = 193,
KBDK_WORLD_34 = 194,
KBDK_WORLD_35 = 195,
KBDK_WORLD_36 = 196,
KBDK_WORLD_37 = 197,
KBDK_WORLD_38 = 198,
KBDK_WORLD_39 = 199,
KBDK_WORLD_40 = 200,
KBDK_WORLD_41 = 201,
KBDK_WORLD_42 = 202,
KBDK_WORLD_43 = 203,
KBDK_WORLD_44 = 204,
KBDK_WORLD_45 = 205,
KBDK_WORLD_46 = 206,
KBDK_WORLD_47 = 207,
KBDK_WORLD_48 = 208,
KBDK_WORLD_49 = 209,
KBDK_WORLD_50 = 210,
KBDK_WORLD_51 = 211,
KBDK_WORLD_52 = 212,
KBDK_WORLD_53 = 213,
KBDK_WORLD_54 = 214,
KBDK_WORLD_55 = 215,
KBDK_WORLD_56 = 216,
KBDK_WORLD_57 = 217,
KBDK_WORLD_58 = 218,
KBDK_WORLD_59 = 219,
KBDK_WORLD_60 = 220,
KBDK_WORLD_61 = 221,
KBDK_WORLD_62 = 222,
KBDK_WORLD_63 = 223,
KBDK_WORLD_64 = 224,
KBDK_WORLD_65 = 225,
KBDK_WORLD_66 = 226,
KBDK_WORLD_67 = 227,
KBDK_WORLD_68 = 228,
KBDK_WORLD_69 = 229,
KBDK_WORLD_70 = 230,
KBDK_WORLD_71 = 231,
KBDK_WORLD_72 = 232,
KBDK_WORLD_73 = 233,
KBDK_WORLD_74 = 234,
KBDK_WORLD_75 = 235,
KBDK_WORLD_76 = 236,
KBDK_WORLD_77 = 237,
KBDK_WORLD_78 = 238,
KBDK_WORLD_79 = 239,
KBDK_WORLD_80 = 240,
KBDK_WORLD_81 = 241,
KBDK_WORLD_82 = 242,
KBDK_WORLD_83 = 243,
KBDK_WORLD_84 = 244,
KBDK_WORLD_85 = 245,
KBDK_WORLD_86 = 246,
KBDK_WORLD_87 = 247,
KBDK_WORLD_88 = 248,
KBDK_WORLD_89 = 249,
KBDK_WORLD_90 = 250,
KBDK_WORLD_91 = 251,
KBDK_WORLD_92 = 252,
KBDK_WORLD_93 = 253,
KBDK_WORLD_94 = 254,
KBDK_WORLD_95 = 255, /* 0xFF */
/*@}*/
/** @name Numeric keypad */
KBDK_A = 4,
KBDK_B = 5,
KBDK_C = 6,
KBDK_D = 7,
KBDK_E = 8,
KBDK_F = 9,
KBDK_G = 10,
KBDK_H = 11,
KBDK_I = 12,
KBDK_J = 13,
KBDK_K = 14,
KBDK_L = 15,
KBDK_M = 16,
KBDK_N = 17,
KBDK_O = 18,
KBDK_P = 19,
KBDK_Q = 20,
KBDK_R = 21,
KBDK_S = 22,
KBDK_T = 23,
KBDK_U = 24,
KBDK_V = 25,
KBDK_W = 26,
KBDK_X = 27,
KBDK_Y = 28,
KBDK_Z = 29,
KBDK_1 = 30,
KBDK_2 = 31,
KBDK_3 = 32,
KBDK_4 = 33,
KBDK_5 = 34,
KBDK_6 = 35,
KBDK_7 = 36,
KBDK_8 = 37,
KBDK_9 = 38,
KBDK_0 = 39,
KBDK_RETURN = 40,
KBDK_ESCAPE = 41,
KBDK_BACKSPACE = 42,
KBDK_TAB = 43,
KBDK_SPACE = 44,
KBDK_MINUS = 45,
KBDK_EQUALS = 46,
KBDK_LEFTBRACKET = 47,
KBDK_RIGHTBRACKET = 48,
KBDK_BACKSLASH = 49, /**< Located at the lower left of the return
* key on ISO keyboards and at the right end
* of the QWERTY row on ANSI keyboards.
* Produces REVERSE SOLIDUS (backslash) and
* VERTICAL LINE in a US layout, REVERSE
* SOLIDUS and VERTICAL LINE in a UK Mac
* layout, NUMBER SIGN and TILDE in a UK
* Windows layout, DOLLAR SIGN and POUND SIGN
* in a Swiss German layout, NUMBER SIGN and
* APOSTROPHE in a German layout, GRAVE
* ACCENT and POUND SIGN in a French Mac
* layout, and ASTERISK and MICRO SIGN in a
* French Windows layout.
*/
KBDK_NONUSHASH = 50, /**< ISO USB keyboards actually use this code
* instead of 49 for the same key, but all
* OSes I've seen treat the two codes
* identically. So, as an implementor, unless
* your keyboard generates both of those
* codes and your OS treats them differently,
* you should generate KBDK_BACKSLASH
* instead of this code. As a user, you
* should not rely on this code because SDL
* will never generate it with most (all?)
* keyboards.
*/
KBDK_SEMICOLON = 51,
KBDK_APOSTROPHE = 52,
KBDK_GRAVE = 53, /**< Located in the top left corner (on both ANSI
* and ISO keyboards). Produces GRAVE ACCENT and
* TILDE in a US Windows layout and in US and UK
* Mac layouts on ANSI keyboards, GRAVE ACCENT
* and NOT SIGN in a UK Windows layout, SECTION
* SIGN and PLUS-MINUS SIGN in US and UK Mac
* layouts on ISO keyboards, SECTION SIGN and
* DEGREE SIGN in a Swiss German layout (Mac:
* only on ISO keyboards), CIRCUMFLEX ACCENT and
* DEGREE SIGN in a German layout (Mac: only on
* ISO keyboards), SUPERSCRIPT TWO and TILDE in a
* French Windows layout, COMMERCIAL AT and
* NUMBER SIGN in a French Mac layout on ISO
* keyboards, and LESS-THAN SIGN and GREATER-THAN
* SIGN in a Swiss German, German, or French Mac
* layout on ANSI keyboards.
*/
KBDK_COMMA = 54,
KBDK_PERIOD = 55,
KBDK_SLASH = 56,
KBDK_CAPSLOCK = 57,
KBDK_F1 = 58,
KBDK_F2 = 59,
KBDK_F3 = 60,
KBDK_F4 = 61,
KBDK_F5 = 62,
KBDK_F6 = 63,
KBDK_F7 = 64,
KBDK_F8 = 65,
KBDK_F9 = 66,
KBDK_F10 = 67,
KBDK_F11 = 68,
KBDK_F12 = 69,
KBDK_PRINTSCREEN = 70,
KBDK_SCROLLLOCK = 71,
KBDK_PAUSE = 72,
KBDK_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but
does send code 73, not 117) */
KBDK_HOME = 74,
KBDK_PAGEUP = 75,
KBDK_DELETE = 76,
KBDK_END = 77,
KBDK_PAGEDOWN = 78,
KBDK_RIGHT = 79,
KBDK_LEFT = 80,
KBDK_DOWN = 81,
KBDK_UP = 82,
KBDK_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards
*/
KBDK_KP_DIVIDE = 84,
KBDK_KP_MULTIPLY = 85,
KBDK_KP_MINUS = 86,
KBDK_KP_PLUS = 87,
KBDK_KP_ENTER = 88,
KBDK_KP_1 = 89,
KBDK_KP_2 = 90,
KBDK_KP_3 = 91,
KBDK_KP_4 = 92,
KBDK_KP_5 = 93,
KBDK_KP_6 = 94,
KBDK_KP_7 = 95,
KBDK_KP_8 = 96,
KBDK_KP_9 = 97,
KBDK_KP_0 = 98,
KBDK_KP_PERIOD = 99,
KBDK_NONUSBACKSLASH = 100, /**< This is the additional key that ISO
* keyboards have over ANSI ones,
* located between left shift and Y.
* Produces GRAVE ACCENT and TILDE in a
* US or UK Mac layout, REVERSE SOLIDUS
* (backslash) and VERTICAL LINE in a
* US or UK Windows layout, and
* LESS-THAN SIGN and GREATER-THAN SIGN
* in a Swiss German, German, or French
* layout. */
KBDK_APPLICATION = 101, /**< windows contextual menu, compose */
KBDK_POWER = 102, /**< The USB document says this is a status flag,
* not a physical key - but some Mac keyboards
* do have a power key. */
KBDK_KP_EQUALS = 103,
KBDK_F13 = 104,
KBDK_F14 = 105,
KBDK_F15 = 106,
KBDK_F16 = 107,
KBDK_F17 = 108,
KBDK_F18 = 109,
KBDK_F19 = 110,
KBDK_F20 = 111,
KBDK_F21 = 112,
KBDK_F22 = 113,
KBDK_F23 = 114,
KBDK_F24 = 115,
KBDK_EXECUTE = 116,
KBDK_HELP = 117,
KBDK_MENU = 118,
KBDK_SELECT = 119,
KBDK_STOP = 120,
KBDK_AGAIN = 121, /**< redo */
KBDK_UNDO = 122,
KBDK_CUT = 123,
KBDK_COPY = 124,
KBDK_PASTE = 125,
KBDK_FIND = 126,
KBDK_MUTE = 127,
KBDK_VOLUMEUP = 128,
KBDK_VOLUMEDOWN = 129,
/* not sure whether there's a reason to enable these */
/* KBDK_LOCKINGCAPSLOCK = 130, */
/* KBDK_LOCKINGNUMLOCK = 131, */
/* KBDK_LOCKINGSCROLLLOCK = 132, */
KBDK_KP_COMMA = 133,
KBDK_KP_EQUALSAS400 = 134,
KBDK_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see
footnotes in USB doc */
KBDK_INTERNATIONAL2 = 136,
KBDK_INTERNATIONAL3 = 137, /**< Yen */
KBDK_INTERNATIONAL4 = 138,
KBDK_INTERNATIONAL5 = 139,
KBDK_INTERNATIONAL6 = 140,
KBDK_INTERNATIONAL7 = 141,
KBDK_INTERNATIONAL8 = 142,
KBDK_INTERNATIONAL9 = 143,
KBDK_LANG1 = 144, /**< Hangul/English toggle */
KBDK_LANG2 = 145, /**< Hanja conversion */
KBDK_LANG3 = 146, /**< Katakana */
KBDK_LANG4 = 147, /**< Hiragana */
KBDK_LANG5 = 148, /**< Zenkaku/Hankaku */
KBDK_LANG6 = 149, /**< reserved */
KBDK_LANG7 = 150, /**< reserved */
KBDK_LANG8 = 151, /**< reserved */
KBDK_LANG9 = 152, /**< reserved */
KBDK_ALTERASE = 153, /**< Erase-Eaze */
KBDK_SYSREQ = 154,
KBDK_CANCEL = 155,
KBDK_CLEAR = 156,
KBDK_PRIOR = 157,
KBDK_RETURN2 = 158,
KBDK_SEPARATOR = 159,
KBDK_OUT = 160,
KBDK_OPER = 161,
KBDK_CLEARAGAIN = 162,
KBDK_CRSEL = 163,
KBDK_EXSEL = 164,
KBDK_KP_00 = 176,
KBDK_KP_000 = 177,
KBDK_THOUSANDSSEPARATOR = 178,
KBDK_DECIMALSEPARATOR = 179,
KBDK_CURRENCYUNIT = 180,
KBDK_CURRENCYSUBUNIT = 181,
KBDK_KP_LEFTPAREN = 182,
KBDK_KP_RIGHTPAREN = 183,
KBDK_KP_LEFTBRACE = 184,
KBDK_KP_RIGHTBRACE = 185,
KBDK_KP_TAB = 186,
KBDK_KP_BACKSPACE = 187,
KBDK_KP_A = 188,
KBDK_KP_B = 189,
KBDK_KP_C = 190,
KBDK_KP_D = 191,
KBDK_KP_E = 192,
KBDK_KP_F = 193,
KBDK_KP_XOR = 194,
KBDK_KP_POWER = 195,
KBDK_KP_PERCENT = 196,
KBDK_KP_LESS = 197,
KBDK_KP_GREATER = 198,
KBDK_KP_AMPERSAND = 199,
KBDK_KP_DBLAMPERSAND = 200,
KBDK_KP_VERTICALBAR = 201,
KBDK_KP_DBLVERTICALBAR = 202,
KBDK_KP_COLON = 203,
KBDK_KP_HASH = 204,
KBDK_KP_SPACE = 205,
KBDK_KP_AT = 206,
KBDK_KP_EXCLAM = 207,
KBDK_KP_MEMSTORE = 208,
KBDK_KP_MEMRECALL = 209,
KBDK_KP_MEMCLEAR = 210,
KBDK_KP_MEMADD = 211,
KBDK_KP_MEMSUBTRACT = 212,
KBDK_KP_MEMMULTIPLY = 213,
KBDK_KP_MEMDIVIDE = 214,
KBDK_KP_PLUSMINUS = 215,
KBDK_KP_CLEAR = 216,
KBDK_KP_CLEARENTRY = 217,
KBDK_KP_BINARY = 218,
KBDK_KP_OCTAL = 219,
KBDK_KP_DECIMAL = 220,
KBDK_KP_HEXADECIMAL = 221,
KBDK_LCTRL = 224,
KBDK_LSHIFT = 225,
KBDK_LALT = 226, /**< alt, option */
KBDK_LGUI = 227, /**< windows, command (apple), meta */
KBDK_RCTRL = 228,
KBDK_RSHIFT = 229,
KBDK_RALT = 230, /**< alt gr, option */
KBDK_RGUI = 231, /**< windows, command (apple), meta */
KBDK_MODE = 257, /**< I'm not sure if this is really not covered
* by any of the above, but since there's a
* special KMOD_MODE for it I'm adding it here
*/
/* @} *//* Usage page 0x07 */
/**
* \name Usage page 0x0C
*
* These values are mapped from usage page 0x0C (USB consumer page).
*/
/* @{ */
KBDK_KP0 = 256,
KBDK_KP1 = 257,
KBDK_KP2 = 258,
KBDK_KP3 = 259,
KBDK_KP4 = 260,
KBDK_KP5 = 261,
KBDK_KP6 = 262,
KBDK_KP7 = 263,
KBDK_KP8 = 264,
KBDK_KP9 = 265,
KBDK_KP_PERIOD = 266,
KBDK_KP_DIVIDE = 267,
KBDK_KP_MULTIPLY = 268,
KBDK_KP_MINUS = 269,
KBDK_KP_PLUS = 270,
KBDK_KP_ENTER = 271,
KBDK_KP_EQUALS = 272,
/*@}*/
/** @name Arrows + Home/End pad */
KBDK_AUDIONEXT = 258,
KBDK_AUDIOPREV = 259,
KBDK_AUDIOSTOP = 260,
KBDK_AUDIOPLAY = 261,
KBDK_AUDIOMUTE = 262,
KBDK_MEDIASELECT = 263,
KBDK_WWW = 264,
KBDK_MAIL = 265,
KBDK_CALCULATOR = 266,
KBDK_COMPUTER = 267,
KBDK_AC_SEARCH = 268,
KBDK_AC_HOME = 269,
KBDK_AC_BACK = 270,
KBDK_AC_FORWARD = 271,
KBDK_AC_STOP = 272,
KBDK_AC_REFRESH = 273,
KBDK_AC_BOOKMARKS = 274,
/* @} *//* Usage page 0x0C */
/**
* \name Walther keys
*
* These are values that Christian Walther added (for mac keyboard?).
*/
/* @{ */
KBDK_UP = 273,
KBDK_DOWN = 274,
KBDK_RIGHT = 275,
KBDK_LEFT = 276,
KBDK_INSERT = 277,
KBDK_HOME = 278,
KBDK_END = 279,
KBDK_PAGEUP = 280,
KBDK_PAGEDOWN = 281,
/*@}*/
/** @name Function keys */
/*@{*/
KBDK_F1 = 282,
KBDK_F2 = 283,
KBDK_F3 = 284,
KBDK_F4 = 285,
KBDK_F5 = 286,
KBDK_F6 = 287,
KBDK_F7 = 288,
KBDK_F8 = 289,
KBDK_F9 = 290,
KBDK_F10 = 291,
KBDK_F11 = 292,
KBDK_F12 = 293,
KBDK_F13 = 294,
KBDK_F14 = 295,
KBDK_F15 = 296,
/*@}*/
KBDK_BRIGHTNESSDOWN = 275,
KBDK_BRIGHTNESSUP = 276,
KBDK_DISPLAYSWITCH = 277, /**< display mirroring/dual display
switch, video mode switch */
KBDK_KBDILLUMTOGGLE = 278,
KBDK_KBDILLUMDOWN = 279,
KBDK_KBDILLUMUP = 280,
KBDK_EJECT = 281,
KBDK_SLEEP = 282,
/** @name Key state modifier keys */
/*@{*/
KBDK_NUMLOCK = 300,
KBDK_CAPSLOCK = 301,
KBDK_SCROLLOCK = 302,
KBDK_RSHIFT = 303,
KBDK_LSHIFT = 304,
KBDK_RCTRL = 305,
KBDK_LCTRL = 306,
KBDK_RALT = 307,
KBDK_LALT = 308,
KBDK_RMETA = 309,
KBDK_LMETA = 310,
KBDK_LSUPER = 311, /**< Left "Windows" key */
KBDK_RSUPER = 312, /**< Right "Windows" key */
KBDK_MODE = 313, /**< "Alt Gr" key */
KBDK_COMPOSE = 314, /**< Multi-key compose key */
/*@}*/
KBDK_APP1 = 283,
KBDK_APP2 = 284,
/** @name Miscellaneous function keys */
/*@{*/
KBDK_HELP = 315,
KBDK_PRINT = 316,
KBDK_SYSREQ = 317,
KBDK_BREAK = 318,
KBDK_MENU = 319,
KBDK_POWER = 320, /**< Power Macintosh power key */
KBDK_EURO = 321, /**< Some european keyboards */
KBDK_UNDO = 322, /**< Atari keyboard has Undo */
/*@}*/
/* @} *//* Walther keys */
/* Add any other keys here */
/* Add any other keys here. */
KBDK_LAST
KBDK_LAST = 512 /**< not a key, just marks the number of scancodes
for array bounds */
} StellaKey;
// Just pass SDLMod directly as int (placeholder for now)

View File

@ -404,7 +404,7 @@ bool DataGridWidget::handleKeyDown(StellaKey key, StellaMod mod, char ascii)
}
break;
case KBDK_n: // negate
case KBDK_N: // negate
if(_editable)
negateCell();
break;

View File

@ -90,9 +90,9 @@ void CompuMate::update()
{
case 0:
if (myKeyTable[KBDK_7]) lp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_u]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_j]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_m]) rp.myDigitalPinState[Controller::Four] = false;
if (myKeyTable[KBDK_U]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_J]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_M]) rp.myDigitalPinState[Controller::Four] = false;
break;
case 1:
if (myKeyTable[KBDK_6]) lp.myDigitalPinState[Controller::Six] = false;
@ -102,9 +102,9 @@ void CompuMate::update()
rp.myAnalogPinValue[Controller::Five] = Controller::minimumResistance;
lp.myDigitalPinState[Controller::Six] = false;
}
if (myKeyTable[KBDK_y]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_h]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_n]) rp.myDigitalPinState[Controller::Four] = false;
if (myKeyTable[KBDK_Y]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_H]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_N]) rp.myDigitalPinState[Controller::Four] = false;
break;
case 2:
if (myKeyTable[KBDK_8]) lp.myDigitalPinState[Controller::Six] = false;
@ -114,8 +114,8 @@ void CompuMate::update()
rp.myAnalogPinValue[Controller::Five] = Controller::minimumResistance;
lp.myDigitalPinState[Controller::Six] = false;
}
if (myKeyTable[KBDK_i]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_k]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_I]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_K]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_COMMA]) rp.myDigitalPinState[Controller::Four] = false;
break;
case 3:
@ -126,25 +126,25 @@ void CompuMate::update()
rp.myAnalogPinValue[Controller::Five] = Controller::minimumResistance;
lp.myDigitalPinState[Controller::Six] = false;
}
if (myKeyTable[KBDK_w]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_s]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_x]) rp.myDigitalPinState[Controller::Four] = false;
if (myKeyTable[KBDK_W]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_S]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_X]) rp.myDigitalPinState[Controller::Four] = false;
break;
case 4:
if (myKeyTable[KBDK_3]) lp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_e]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_d]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_c]) rp.myDigitalPinState[Controller::Four] = false;
if (myKeyTable[KBDK_E]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_D]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_C]) rp.myDigitalPinState[Controller::Four] = false;
break;
case 5:
if (myKeyTable[KBDK_0]) lp.myDigitalPinState[Controller::Six] = false;
// Emulate the quote character (Shift-0) with the actual quote key
if (myKeyTable[KBDK_QUOTE] && (myKeyTable[KBDK_LSHIFT] || myKeyTable[KBDK_RSHIFT]))
if (myKeyTable[KBDK_APOSTROPHE] && (myKeyTable[KBDK_LSHIFT] || myKeyTable[KBDK_RSHIFT]))
{
rp.myAnalogPinValue[Controller::Five] = Controller::minimumResistance;
lp.myDigitalPinState[Controller::Six] = false;
}
if (myKeyTable[KBDK_p]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_P]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_RETURN] || myKeyTable[KBDK_KP_ENTER])
rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_SPACE]) rp.myDigitalPinState[Controller::Four] = false;
@ -163,8 +163,8 @@ void CompuMate::update()
rp.myAnalogPinValue[Controller::Five] = Controller::minimumResistance;
lp.myDigitalPinState[Controller::Six] = false;
}
if (myKeyTable[KBDK_o]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_l]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_O]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_L]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_PERIOD]) rp.myDigitalPinState[Controller::Four] = false;
break;
case 7:
@ -175,9 +175,9 @@ void CompuMate::update()
rp.myAnalogPinValue[Controller::Five] = Controller::minimumResistance;
lp.myDigitalPinState[Controller::Six] = false;
}
if (myKeyTable[KBDK_t]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_g]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_b]) rp.myDigitalPinState[Controller::Four] = false;
if (myKeyTable[KBDK_T]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_G]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_B]) rp.myDigitalPinState[Controller::Four] = false;
break;
case 8:
if (myKeyTable[KBDK_1]) lp.myDigitalPinState[Controller::Six] = false;
@ -187,9 +187,9 @@ void CompuMate::update()
rp.myAnalogPinValue[Controller::Five] = Controller::minimumResistance;
lp.myDigitalPinState[Controller::Six] = false;
}
if (myKeyTable[KBDK_q]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_a]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_z]) rp.myDigitalPinState[Controller::Four] = false;
if (myKeyTable[KBDK_Q]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_A]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_Z]) rp.myDigitalPinState[Controller::Four] = false;
break;
case 9:
if (myKeyTable[KBDK_4]) lp.myDigitalPinState[Controller::Six] = false;
@ -199,9 +199,9 @@ void CompuMate::update()
rp.myAnalogPinValue[Controller::Five] = Controller::minimumResistance;
lp.myDigitalPinState[Controller::Six] = false;
}
if (myKeyTable[KBDK_r]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_f]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_v]) rp.myDigitalPinState[Controller::Four] = false;
if (myKeyTable[KBDK_R]) rp.myDigitalPinState[Controller::Three] = false;
if (myKeyTable[KBDK_F]) rp.myDigitalPinState[Controller::Six] = false;
if (myKeyTable[KBDK_V]) rp.myDigitalPinState[Controller::Four] = false;
break;
default:
break;

View File

@ -351,7 +351,7 @@ void EventHandler::handleKeyEvent(StellaKey key, StellaMod mod, char ascii, bool
{
#ifdef BSPF_MAC_OSX
// These keys work in all states
if(key == KBDK_q)
if(key == KBDK_Q)
{
handleEvent(Event::Quit, 1);
}
@ -449,49 +449,49 @@ void EventHandler::handleKeyEvent(StellaKey key, StellaMod mod, char ascii, bool
}
break;
case KBDK_z:
case KBDK_Z:
if(mod & KMOD_SHIFT)
myOSystem->console().toggleP0Collision();
else
myOSystem->console().toggleP0Bit();
break;
case KBDK_x:
case KBDK_X:
if(mod & KMOD_SHIFT)
myOSystem->console().toggleP1Collision();
else
myOSystem->console().toggleP1Bit();
break;
case KBDK_c:
case KBDK_C:
if(mod & KMOD_SHIFT)
myOSystem->console().toggleM0Collision();
else
myOSystem->console().toggleM0Bit();
break;
case KBDK_v:
case KBDK_V:
if(mod & KMOD_SHIFT)
myOSystem->console().toggleM1Collision();
else
myOSystem->console().toggleM1Bit();
break;
case KBDK_b:
case KBDK_B:
if(mod & KMOD_SHIFT)
myOSystem->console().toggleBLCollision();
else
myOSystem->console().toggleBLBit();
break;
case KBDK_n:
case KBDK_N:
if(mod & KMOD_SHIFT)
myOSystem->console().togglePFCollision();
else
myOSystem->console().togglePFBit();
break;
case KBDK_m:
case KBDK_M:
myOSystem->console().toggleHMOVE();
break;
@ -506,15 +506,15 @@ void EventHandler::handleKeyEvent(StellaKey key, StellaMod mod, char ascii, bool
myOSystem->console().toggleBits();
break;
case KBDK_p: // Alt-p toggles phosphor effect
case KBDK_P: // Alt-p toggles phosphor effect
myOSystem->console().togglePhosphor();
break;
case KBDK_l:
case KBDK_L:
myOSystem->frameBuffer().toggleFrameStats();
break;
case KBDK_s:
case KBDK_S:
if(myContSnapshotInterval == 0)
{
ostringstream buf;
@ -545,7 +545,7 @@ void EventHandler::handleKeyEvent(StellaKey key, StellaMod mod, char ascii, bool
else if(kbdControl(mod) && state && myUseCtrlKeyFlag)
{
// These keys work in all states
if(key == KBDK_q)
if(key == KBDK_Q)
{
handleEvent(Event::Quit, 1);
}
@ -563,24 +563,24 @@ void EventHandler::handleKeyEvent(StellaKey key, StellaMod mod, char ascii, bool
toggleSAPortOrder();
break;
case KBDK_f: // (Shift) Ctrl-f toggles NTSC/PAL/SECAM mode
case KBDK_F: // (Shift) Ctrl-f toggles NTSC/PAL/SECAM mode
myOSystem->console().toggleFormat(mod & KMOD_SHIFT ? -1 : 1);
break;
case KBDK_g: // Ctrl-g (un)grabs mouse
case KBDK_G: // Ctrl-g (un)grabs mouse
if(!myOSystem->frameBuffer().fullScreen())
myOSystem->frameBuffer().toggleGrabMouse();
break;
case KBDK_l: // Ctrl-l toggles PAL color-loss effect
case KBDK_L: // Ctrl-l toggles PAL color-loss effect
myOSystem->console().toggleColorLoss();
break;
case KBDK_p: // Ctrl-p toggles different palettes
case KBDK_P: // Ctrl-p toggles different palettes
myOSystem->console().togglePalette();
break;
case KBDK_r: // Ctrl-r reloads the currently loaded ROM
case KBDK_R: // Ctrl-r reloads the currently loaded ROM
myOSystem->reloadConsole();
break;
@ -592,7 +592,7 @@ void EventHandler::handleKeyEvent(StellaKey key, StellaMod mod, char ascii, bool
myOSystem->console().changeHeight(-1);
break;
case KBDK_s: // Ctrl-s saves properties to a file
case KBDK_S: // Ctrl-s saves properties to a file
{
string filename = myOSystem->baseDir() +
myOSystem->console().properties().get(Cartridge_Name) + ".pro";
@ -889,6 +889,26 @@ void EventHandler::handleJoyHatEvent(int stick, int hat, int value)
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::handleSystemEvent(SystemEvent e, int data1, int data2)
{
switch(e)
{
case EVENT_WINDOW_EXPOSED:
myOSystem->frameBuffer().refresh();
break;
default: // handle other events as testing requires
// cerr << "handleSystemEvent: " << e << endl;
break;
}
#if 0 //FIXSDL
case SDL_ACTIVEEVENT:
if((event.active.state & SDL_APPACTIVE) && (event.active.gain == 0))
if(myState == S_EMULATE) enterMenuMode(S_MENU);
break; // SDL_ACTIVEEVENT
#endif
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::handleEvent(Event::Type event, int state)
{
@ -1505,24 +1525,24 @@ void EventHandler::setDefaultKeymap(Event::Type event, EventMode mode)
SET_DEFAULT_KEY(KBDK_1, mode, Event::KeyboardZero1, event);
SET_DEFAULT_KEY(KBDK_2, mode, Event::KeyboardZero2, event);
SET_DEFAULT_KEY(KBDK_3, mode, Event::KeyboardZero3, event);
SET_DEFAULT_KEY(KBDK_q, mode, Event::KeyboardZero4, event);
SET_DEFAULT_KEY(KBDK_w, mode, Event::KeyboardZero5, event);
SET_DEFAULT_KEY(KBDK_e, mode, Event::KeyboardZero6, event);
SET_DEFAULT_KEY(KBDK_a, mode, Event::KeyboardZero7, event);
SET_DEFAULT_KEY(KBDK_s, mode, Event::KeyboardZero8, event);
SET_DEFAULT_KEY(KBDK_d, mode, Event::KeyboardZero9, event);
SET_DEFAULT_KEY(KBDK_z, mode, Event::KeyboardZeroStar, event);
SET_DEFAULT_KEY(KBDK_x, mode, Event::KeyboardZero0, event);
SET_DEFAULT_KEY(KBDK_c, mode, Event::KeyboardZeroPound, event);
SET_DEFAULT_KEY(KBDK_Q, mode, Event::KeyboardZero4, event);
SET_DEFAULT_KEY(KBDK_W, mode, Event::KeyboardZero5, event);
SET_DEFAULT_KEY(KBDK_E, mode, Event::KeyboardZero6, event);
SET_DEFAULT_KEY(KBDK_A, mode, Event::KeyboardZero7, event);
SET_DEFAULT_KEY(KBDK_S, mode, Event::KeyboardZero8, event);
SET_DEFAULT_KEY(KBDK_S, mode, Event::KeyboardZero9, event);
SET_DEFAULT_KEY(KBDK_Z, mode, Event::KeyboardZeroStar, event);
SET_DEFAULT_KEY(KBDK_X, mode, Event::KeyboardZero0, event);
SET_DEFAULT_KEY(KBDK_C, mode, Event::KeyboardZeroPound, event);
SET_DEFAULT_KEY(KBDK_8, mode, Event::KeyboardOne1, event);
SET_DEFAULT_KEY(KBDK_9, mode, Event::KeyboardOne2, event);
SET_DEFAULT_KEY(KBDK_0, mode, Event::KeyboardOne3, event);
SET_DEFAULT_KEY(KBDK_i, mode, Event::KeyboardOne4, event);
SET_DEFAULT_KEY(KBDK_o, mode, Event::KeyboardOne5, event);
SET_DEFAULT_KEY(KBDK_p, mode, Event::KeyboardOne6, event);
SET_DEFAULT_KEY(KBDK_k, mode, Event::KeyboardOne7, event);
SET_DEFAULT_KEY(KBDK_l, mode, Event::KeyboardOne8, event);
SET_DEFAULT_KEY(KBDK_I, mode, Event::KeyboardOne4, event);
SET_DEFAULT_KEY(KBDK_O, mode, Event::KeyboardOne5, event);
SET_DEFAULT_KEY(KBDK_P, mode, Event::KeyboardOne6, event);
SET_DEFAULT_KEY(KBDK_K, mode, Event::KeyboardOne7, event);
SET_DEFAULT_KEY(KBDK_L, mode, Event::KeyboardOne8, event);
SET_DEFAULT_KEY(KBDK_SEMICOLON, mode, Event::KeyboardOne9, event);
SET_DEFAULT_KEY(KBDK_COMMA, mode, Event::KeyboardOneStar, event);
SET_DEFAULT_KEY(KBDK_PERIOD, mode, Event::KeyboardOne0, event);
@ -1537,11 +1557,11 @@ void EventHandler::setDefaultKeymap(Event::Type event, EventMode mode)
SET_DEFAULT_KEY(KBDK_4, mode, Event::JoystickZeroFire5, event);
SET_DEFAULT_KEY(KBDK_5, mode, Event::JoystickZeroFire9, event);
SET_DEFAULT_KEY(KBDK_y, mode, Event::JoystickOneUp, event);
SET_DEFAULT_KEY(KBDK_h, mode, Event::JoystickOneDown, event);
SET_DEFAULT_KEY(KBDK_g, mode, Event::JoystickOneLeft, event);
SET_DEFAULT_KEY(KBDK_j, mode, Event::JoystickOneRight, event);
SET_DEFAULT_KEY(KBDK_f, mode, Event::JoystickOneFire, event);
SET_DEFAULT_KEY(KBDK_Y, mode, Event::JoystickOneUp, event);
SET_DEFAULT_KEY(KBDK_H, mode, Event::JoystickOneDown, event);
SET_DEFAULT_KEY(KBDK_G, mode, Event::JoystickOneLeft, event);
SET_DEFAULT_KEY(KBDK_J, mode, Event::JoystickOneRight, event);
SET_DEFAULT_KEY(KBDK_F, mode, Event::JoystickOneFire, event);
SET_DEFAULT_KEY(KBDK_6, mode, Event::JoystickOneFire5, event);
SET_DEFAULT_KEY(KBDK_7, mode, Event::JoystickOneFire9, event);
@ -1562,7 +1582,7 @@ void EventHandler::setDefaultKeymap(Event::Type event, EventMode mode)
SET_DEFAULT_KEY(KBDK_PAUSE, mode, Event::PauseMode, event);
SET_DEFAULT_KEY(KBDK_TAB, mode, Event::MenuMode, event);
SET_DEFAULT_KEY(KBDK_BACKSLASH, mode, Event::CmdMenuMode, event);
SET_DEFAULT_KEY(KBDK_BACKQUOTE, mode, Event::DebuggerMode, event);
SET_DEFAULT_KEY(KBDK_GRAVE, mode, Event::DebuggerMode, event);
SET_DEFAULT_KEY(KBDK_ESCAPE, mode, Event::LauncherMode, event);
break;
@ -2115,6 +2135,7 @@ uInt32 EventHandler::resetEventsCallback(uInt32 interval, void* param)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::setKeyNames()
{
#if 0//FIXSDL
ourKBDKNames[ KBDK_BACKSPACE ] = "BACKSPACE";
ourKBDKNames[ KBDK_TAB ] = "TAB";
ourKBDKNames[ KBDK_CLEAR ] = "CLEAR";
@ -2159,32 +2180,32 @@ void EventHandler::setKeyNames()
ourKBDKNames[ KBDK_CARET ] = "^";
ourKBDKNames[ KBDK_UNDERSCORE ] = "_";
ourKBDKNames[ KBDK_BACKQUOTE ] = "`";
ourKBDKNames[ KBDK_a ] = "A";
ourKBDKNames[ KBDK_b ] = "B";
ourKBDKNames[ KBDK_c ] = "C";
ourKBDKNames[ KBDK_d ] = "D";
ourKBDKNames[ KBDK_e ] = "E";
ourKBDKNames[ KBDK_f ] = "F";
ourKBDKNames[ KBDK_g ] = "G";
ourKBDKNames[ KBDK_h ] = "H";
ourKBDKNames[ KBDK_i ] = "I";
ourKBDKNames[ KBDK_j ] = "J";
ourKBDKNames[ KBDK_k ] = "K";
ourKBDKNames[ KBDK_l ] = "L";
ourKBDKNames[ KBDK_m ] = "M";
ourKBDKNames[ KBDK_n ] = "N";
ourKBDKNames[ KBDK_o ] = "O";
ourKBDKNames[ KBDK_p ] = "P";
ourKBDKNames[ KBDK_q ] = "Q";
ourKBDKNames[ KBDK_r ] = "R";
ourKBDKNames[ KBDK_s ] = "S";
ourKBDKNames[ KBDK_t ] = "T";
ourKBDKNames[ KBDK_u ] = "U";
ourKBDKNames[ KBDK_v ] = "V";
ourKBDKNames[ KBDK_w ] = "W";
ourKBDKNames[ KBDK_x ] = "X";
ourKBDKNames[ KBDK_y ] = "Y";
ourKBDKNames[ KBDK_z ] = "Z";
ourKBDKNames[ KBDK_A ] = "A";
ourKBDKNames[ KBDK_B ] = "B";
ourKBDKNames[ KBDK_C ] = "C";
ourKBDKNames[ KBDK_D ] = "D";
ourKBDKNames[ KBDK_E ] = "E";
ourKBDKNames[ KBDK_F ] = "F";
ourKBDKNames[ KBDK_G ] = "G";
ourKBDKNames[ KBDK_H ] = "H";
ourKBDKNames[ KBDK_I ] = "I";
ourKBDKNames[ KBDK_J ] = "J";
ourKBDKNames[ KBDK_K ] = "K";
ourKBDKNames[ KBDK_L ] = "L";
ourKBDKNames[ KBDK_M ] = "M";
ourKBDKNames[ KBDK_N ] = "N";
ourKBDKNames[ KBDK_O ] = "O";
ourKBDKNames[ KBDK_P ] = "P";
ourKBDKNames[ KBDK_Q ] = "Q";
ourKBDKNames[ KBDK_R ] = "R";
ourKBDKNames[ KBDK_S ] = "S";
ourKBDKNames[ KBDK_T ] = "T";
ourKBDKNames[ KBDK_U ] = "U";
ourKBDKNames[ KBDK_V ] = "V";
ourKBDKNames[ KBDK_W ] = "W";
ourKBDKNames[ KBDK_X ] = "X";
ourKBDKNames[ KBDK_Y ] = "Y";
ourKBDKNames[ KBDK_Z ] = "Z";
ourKBDKNames[ KBDK_DELETE ] = "DELETE";
ourKBDKNames[ KBDK_WORLD_0 ] = "WORLD_0";
ourKBDKNames[ KBDK_WORLD_1 ] = "WORLD_1";
@ -2346,6 +2367,7 @@ void EventHandler::setKeyNames()
ourKBDKNames[ KBDK_POWER ] = "POWER";
ourKBDKNames[ KBDK_EURO ] = "EURO";
ourKBDKNames[ KBDK_UNDO ] = "UNDO";
#endif
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -343,6 +343,23 @@ class EventHandler
*/
virtual void pollEvent() = 0;
// Other events that can be received from the underlying event handler
enum SystemEvent {
EVENT_WINDOW_SHOWN,
EVENT_WINDOW_HIDDEN,
EVENT_WINDOW_EXPOSED,
EVENT_WINDOW_MOVED,
EVENT_WINDOW_RESIZED,
EVENT_WINDOW_MINIMIZED,
EVENT_WINDOW_MAXIMIZED,
EVENT_WINDOW_RESTORED,
EVENT_WINDOW_ENTER,
EVENT_WINDOW_LEAVE,
EVENT_WINDOW_FOCUS_GAINED,
EVENT_WINDOW_FOCUS_LOST
};
void handleSystemEvent(SystemEvent e, int data1 = 0, int data2 = 0);
// An abstraction of joystick in Stella.
// A StellaJoystick holds its own event mapping information, space for
// which is dynamically allocated based on the actual number of buttons,

View File

@ -256,40 +256,40 @@ bool EditableWidget::specialKeys(StellaKey key, char ascii)
switch (key)
{
case KBDK_a:
case KBDK_A:
setCaretPos(0);
break;
case KBDK_c:
case KBDK_C:
copySelectedText();
if(handled) sendCommand(EditableWidget::kChangedCmd, ascii, _id);
break;
case KBDK_e:
case KBDK_E:
setCaretPos(_editString.size());
break;
case KBDK_d:
case KBDK_D:
handled = killChar(+1);
if(handled) sendCommand(EditableWidget::kChangedCmd, ascii, _id);
break;
case KBDK_k:
case KBDK_K:
handled = killLine(+1);
if(handled) sendCommand(EditableWidget::kChangedCmd, ascii, _id);
break;
case KBDK_u:
case KBDK_U:
handled = killLine(-1);
if(handled) sendCommand(EditableWidget::kChangedCmd, ascii, _id);
break;
case KBDK_v:
case KBDK_V:
pasteSelectedText();
if(handled) sendCommand(EditableWidget::kChangedCmd, ascii, _id);
break;
case KBDK_w:
case KBDK_W:
handled = killLastWord();
if(handled) sendCommand(EditableWidget::kChangedCmd, ascii, _id);
break;

View File

@ -457,7 +457,7 @@ void LauncherDialog::handleKeyDown(StellaKey key, StellaMod mod, char ascii)
{
// Grab the key before passing it to the actual dialog and check for
// Control-R (reload ROM listing)
if(instance().eventHandler().kbdControl(mod) && key == KBDK_r)
if(instance().eventHandler().kbdControl(mod) && key == KBDK_R)
updateListing();
else
Dialog::handleKeyDown(key, mod, ascii);