diff options
Diffstat (limited to 'src/menu.cpp')
| -rw-r--r-- | src/menu.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/menu.cpp b/src/menu.cpp index 56fe6fa..a0cf323 100644 --- a/src/menu.cpp +++ b/src/menu.cpp | |||
| @@ -467,7 +467,8 @@ static void config_load() { | |||
| 467 | // --------------------------------------------------------------------------- | 467 | // --------------------------------------------------------------------------- |
| 468 | 468 | ||
| 469 | // SDL scancodes for navigation keys (matches the game's scancode set) | 469 | // SDL scancodes for navigation keys (matches the game's scancode set) |
| 470 | static constexpr int SCAN_INSERT = 73; | 470 | static constexpr int SCAN_INSERT = 73; // reserved for the GUI |
| 471 | static constexpr int SCAN_TEXT_MENU = 58; // F1 preview key for the old tree | ||
| 471 | static constexpr int SCAN_UP = 82; // these are SDL scancodes | 472 | static constexpr int SCAN_UP = 82; // these are SDL scancodes |
| 472 | static constexpr int SCAN_DOWN = 81; | 473 | static constexpr int SCAN_DOWN = 81; |
| 473 | static constexpr int SCAN_LEFT = 80; | 474 | static constexpr int SCAN_LEFT = 80; |
| @@ -637,7 +638,7 @@ static void menu_handle_input() { | |||
| 637 | // SDL state can be sampled several times per rendered frame (both ISurface | 638 | // SDL state can be sampled several times per rendered frame (both ISurface |
| 638 | // hooks call outer_draw). Use a physical-key latch instead of the one-poll | 639 | // hooks call outer_draw). Use a physical-key latch instead of the one-poll |
| 639 | // edge so one press cannot open and close the menu in the same frame. | 640 | // edge so one press cannot open and close the menu in the same frame. |
| 640 | bool insert_down = key_held(SCAN_INSERT); | 641 | bool insert_down = key_held(SCAN_TEXT_MENU); |
| 641 | bool insert_edge = insert_down && !g_insert_latch; | 642 | bool insert_edge = insert_down && !g_insert_latch; |
| 642 | if (insert_down) | 643 | if (insert_down) |
| 643 | g_insert_latch = true; | 644 | g_insert_latch = true; |
| @@ -662,8 +663,8 @@ static void menu_handle_input() { | |||
| 662 | for (int i = 0; i < MOUSE_BASE + 5; i++) { | 663 | for (int i = 0; i < MOUSE_BASE + 5; i++) { |
| 663 | if (!g_key_down[i]) | 664 | if (!g_key_down[i]) |
| 664 | continue; | 665 | continue; |
| 665 | if (i == SCAN_INSERT || i == SCAN_UP || i == SCAN_DOWN || | 666 | if (i == SCAN_INSERT || i == SCAN_TEXT_MENU || i == SCAN_UP || |
| 666 | i == SCAN_LEFT || i == SCAN_RIGHT) { | 667 | i == SCAN_DOWN || i == SCAN_LEFT || i == SCAN_RIGHT) { |
| 667 | g_bind_mode = false; | 668 | g_bind_mode = false; |
| 668 | return; // cancel bind select | 669 | return; // cancel bind select |
| 669 | } | 670 | } |
