From 4810c2fc5f69d5f24af09f7d1c5c78eea3c32728 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Wed, 12 Jun 2024 12:56:52 +0200 Subject: [PATCH] [ui_sdl] tweaks --- src/ui_sdl.c | 70 +--------------------------------------------------- 1 file changed, 1 insertion(+), 69 deletions(-) diff --git a/src/ui_sdl.c b/src/ui_sdl.c index 85fe8e0..41998c4 100644 --- a/src/ui_sdl.c +++ b/src/ui_sdl.c @@ -56,7 +56,7 @@ typedef struct sdl_ann_struct_t { static unsigned KEYBOARD_HEIGHT, KEYBOARD_WIDTH, TOP_SKIP, SIDE_SKIP, BOTTOM_SKIP, DISP_KBD_SKIP, DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISP_FRAME, KEYBOARD_OFFSET_X, KEYBOARD_OFFSET_Y, KBD_UPLINE; -static unsigned int ARGBColors[ BLACK + 1 ]; +static unsigned int ARGBColors[ NB_COLORS ]; static button_t* buttons = 0; static sdl_button_t sdl_buttons[ NB_KEYS ] = { @@ -311,202 +311,137 @@ static int sdlkey_to_hpkey( SDLKey k ) switch ( k ) { case SDLK_0: return HPKEY_0; - break; case SDLK_1: return HPKEY_1; - break; case SDLK_2: return HPKEY_2; - break; case SDLK_3: return HPKEY_3; - break; case SDLK_4: return HPKEY_4; - break; case SDLK_5: return HPKEY_5; - break; case SDLK_6: return HPKEY_6; - break; case SDLK_7: return HPKEY_7; - break; case SDLK_8: return HPKEY_8; - break; case SDLK_9: return HPKEY_9; - break; case SDLK_KP0: return HPKEY_0; - break; case SDLK_KP1: return HPKEY_1; - break; case SDLK_KP2: return HPKEY_2; - break; case SDLK_KP3: return HPKEY_3; - break; case SDLK_KP4: return HPKEY_4; - break; case SDLK_KP5: return HPKEY_5; - break; case SDLK_KP6: return HPKEY_6; - break; case SDLK_KP7: return HPKEY_7; - break; case SDLK_KP8: return HPKEY_8; - break; case SDLK_KP9: return HPKEY_9; - break; case SDLK_a: return HPKEY_A; - break; case SDLK_b: return HPKEY_B; - break; case SDLK_c: return HPKEY_C; - break; case SDLK_d: return HPKEY_D; - break; case SDLK_e: return HPKEY_E; - break; case SDLK_f: return HPKEY_F; - break; case SDLK_g: return HPKEY_MTH; - break; case SDLK_h: return HPKEY_PRG; - break; case SDLK_i: return HPKEY_CST; - break; case SDLK_j: return HPKEY_VAR; - break; case SDLK_k: return HPKEY_UP; - break; case SDLK_UP: return HPKEY_UP; - break; case SDLK_l: return HPKEY_NXT; - break; case SDLK_m: return HPKEY_COLON; - break; case SDLK_n: return HPKEY_STO; - break; case SDLK_o: return HPKEY_EVAL; - break; case SDLK_p: return HPKEY_LEFT; - break; case SDLK_LEFT: return HPKEY_LEFT; - break; case SDLK_q: return HPKEY_DOWN; - break; case SDLK_DOWN: return HPKEY_DOWN; - break; case SDLK_r: return HPKEY_RIGHT; - break; case SDLK_RIGHT: return HPKEY_RIGHT; - break; case SDLK_s: return HPKEY_SIN; - break; case SDLK_t: return HPKEY_COS; - break; case SDLK_u: return HPKEY_TAN; - break; case SDLK_v: return HPKEY_SQRT; - break; case SDLK_w: return HPKEY_POWER; - break; case SDLK_x: return HPKEY_INV; - break; case SDLK_y: return HPKEY_NEG; - break; case SDLK_z: return HPKEY_EEX; - break; case SDLK_SPACE: return HPKEY_SPC; - break; case SDLK_F1: case SDLK_RETURN: case SDLK_KP_ENTER: return HPKEY_ENTER; - break; case SDLK_BACKSPACE: return HPKEY_BS; - break; case SDLK_DELETE: return HPKEY_DEL; - break; case SDLK_PERIOD: return HPKEY_PERIOD; - break; case SDLK_KP_PERIOD: return HPKEY_PERIOD; - break; case SDLK_PLUS: return HPKEY_PLUS; - break; case SDLK_KP_PLUS: return HPKEY_PLUS; - break; case SDLK_MINUS: return HPKEY_MINUS; - break; case SDLK_KP_MINUS: return HPKEY_MINUS; - break; case SDLK_ASTERISK: return HPKEY_MUL; - break; case SDLK_KP_MULTIPLY: return HPKEY_MUL; - break; case SDLK_SLASH: return HPKEY_DIV; - break; case SDLK_KP_DIVIDE: return HPKEY_DIV; - break; case SDLK_F5: case SDLK_ESCAPE: return HPKEY_ON; - break; case SDLK_LSHIFT: if ( !config.leave_shift_keys ) return HPKEY_SHL; @@ -518,16 +453,13 @@ static int sdlkey_to_hpkey( SDLKey k ) case SDLK_F2: case SDLK_RCTRL: return HPKEY_SHL; - break; case SDLK_F3: case SDLK_LCTRL: return HPKEY_SHR; - break; case SDLK_F4: case SDLK_LALT: case SDLK_RALT: return HPKEY_ALPHA; - break; case SDLK_F7: case SDLK_F10: please_exit = true;