diff options
Diffstat (limited to 'src/setup')
-rw-r--r-- | src/setup/display.c | 4 | ||||
-rw-r--r-- | src/setup/keyboard.c | 7 | ||||
-rw-r--r-- | src/setup/txt_keyinput.c | 12 |
3 files changed, 22 insertions, 1 deletions
diff --git a/src/setup/display.c b/src/setup/display.c index 4918d045..9fd0963b 100644 --- a/src/setup/display.c +++ b/src/setup/display.c @@ -22,6 +22,10 @@ #include <stdlib.h> #include <string.h> +#ifdef _WIN32_WCE +#include "libc_wince.h" +#endif + #include "textscreen.h" #include "m_config.h" #include "mode.h" diff --git a/src/setup/keyboard.c b/src/setup/keyboard.c index cd5eb4f5..6e746ee9 100644 --- a/src/setup/keyboard.c +++ b/src/setup/keyboard.c @@ -43,6 +43,7 @@ static int *controls[] = { &key_left, &key_right, &key_up, &key_down, &key_flyup, &key_flydown, &key_flycenter, &key_lookup, &key_lookdown, &key_lookcenter, &key_invleft, &key_invright, &key_useartifact, + &key_pause, &key_weapon1, &key_weapon2, &key_weapon3, &key_weapon4, &key_weapon5, &key_weapon6, &key_weapon7, &key_weapon8, @@ -56,7 +57,8 @@ static int *shortcuts[] = { &key_menu_help, &key_menu_save, &key_menu_load, &key_menu_volume, &key_menu_detail, &key_menu_qsave, &key_menu_endgame, &key_menu_messages, &key_menu_qload, &key_menu_quit, &key_menu_gamma, - &key_menu_incscreen, &key_menu_decscreen, NULL }; + &key_menu_incscreen, &key_menu_decscreen, + &key_message_refresh, NULL }; static int *map_keys[] = { &key_map_north, &key_map_south, &key_map_east, &key_map_west, &key_map_zoomin, &key_map_zoomout, @@ -246,6 +248,7 @@ static void OtherKeysDialog(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused)) AddSectionLabel(table, "Shortcut keys", true); + AddKeyControl(table, "Pause game", &key_pause); AddKeyControl(table, "Help screen", &key_menu_help); AddKeyControl(table, "Save game", &key_menu_save); AddKeyControl(table, "Load game", &key_menu_load); @@ -261,6 +264,8 @@ static void OtherKeysDialog(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused)) AddKeyControl(table, "Increase screen size", &key_menu_incscreen); AddKeyControl(table, "Decrease screen size", &key_menu_decscreen); + AddKeyControl(table, "Display last message", &key_message_refresh); + AddSectionLabel(table, "Map", true); AddKeyControl(table, "Toggle map", &key_map_toggle); diff --git a/src/setup/txt_keyinput.c b/src/setup/txt_keyinput.c index b7e68f44..e385cc59 100644 --- a/src/setup/txt_keyinput.c +++ b/src/setup/txt_keyinput.c @@ -57,6 +57,11 @@ static int KeyPressCallback(txt_window_t *window, int key, } } +static void ReleaseGrab(TXT_UNCAST_ARG(window), TXT_UNCAST_ARG(unused)) +{ + SDL_WM_GrabInput(SDL_GRAB_OFF); +} + static void OpenPromptWindow(txt_key_input_t *key_input) { txt_window_t *window; @@ -78,6 +83,13 @@ static void OpenPromptWindow(txt_key_input_t *key_input) // Disable key mappings while we prompt for the key press TXT_EnableKeyMapping(0); + + // Grab input while reading the key. On Windows Mobile + // handheld devices, the hardware keypresses are only + // detected when input is grabbed. + + SDL_WM_GrabInput(SDL_GRAB_ON); + TXT_SignalConnect(window, "closed", ReleaseGrab, NULL); } static void TXT_KeyInputSizeCalc(TXT_UNCAST_ARG(key_input)) |