From ad7c26ff02719bd16ac05e3f8dd03c6fd11ce5aa Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 9 Jan 2017 11:58:01 -0800 Subject: [PATCH] We only need the first few keymaps corresponding to the following constants: K_NORMTAB, K_SHIFTTAB, K_ALTTAB, K_ALTSHIFTTAB In the normal case we'll load all the keymaps from the kernel, but this reduces the size of the SDL library for the fallback case when we can't get to the tty. --- src/core/linux/SDL_evdev_kbd_default_keymap.h | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) diff --git a/src/core/linux/SDL_evdev_kbd_default_keymap.h b/src/core/linux/SDL_evdev_kbd_default_keymap.h index a02931878..220e75064 100644 --- a/src/core/linux/SDL_evdev_kbd_default_keymap.h +++ b/src/core/linux/SDL_evdev_kbd_default_keymap.h @@ -155,6 +155,7 @@ static unsigned short default_key_map_3[NR_KEYS] = { 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, }; +#ifdef INCLUDE_EXTENDED_KEYMAP static unsigned short default_key_map_4[NR_KEYS] = { 0xf200, 0xf01b, 0xf200, 0xf000, 0xf200, 0xf200, 0xf200, 0xf01e, 0xf200, 0xf200, 0xf200, 0xf200, 0xf01f, 0xf200, 0xf008, 0xf009, @@ -4371,12 +4372,14 @@ static unsigned short default_key_map_127[NR_KEYS] = { 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, }; +#endif /* INCLUDE_EXTENDED_KEYMAP */ static unsigned short *default_key_maps[MAX_NR_KEYMAPS] = { default_key_map_0, default_key_map_1, default_key_map_2, default_key_map_3, +#ifdef INCLUDE_EXTENDED_KEYMAP default_key_map_4, default_key_map_5, default_key_map_6, @@ -4501,6 +4504,132 @@ static unsigned short *default_key_maps[MAX_NR_KEYMAPS] = { default_key_map_125, default_key_map_126, default_key_map_127, +#else /* !INCLUDE_EXTENDED_KEYMAP */ + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, +#endif /* INCLUDE_EXTENDED_KEYMAP */ NULL, NULL, NULL,