Opened 8 years ago
Last modified 7 years ago
#1586 new bug
Win client: handle special keys properly
Reported by: | PowerWyrm | Owned by: | |
---|---|---|---|
Milestone: | Future | Keywords: | |
Cc: |
Description
With the old keymap system, special keys were handled with a static array:
static const byte special_key_list[] = {VK_CLEAR, VK_PAUSE, ...};
When a key was pressed, the main window procedure was intercepting these special keys and handled them directly:
if (special_key) {...; return 0;} else break;
return DefWindowProc?(hWnd, uMsg, wParam, lParam);
With the new keymap system, everything is handled in the new "handle_keydown" function:
if (special key) ...
However, the main window function now just calls handle_keydown():
handle_keydown(); break;
return DefWindowProc?(hWnd, uMsg, wParam, lParam);
This leads to special keys being processed by Windows using the default Windows behavior. For example, assigning a keymap to F10 will execute the corresponding keymap, then pop the menu up. Very annoying...
Fix:
- make handle_keydown() return a boolean value (TRUE if the key was handled, FALSE otherwise
- return immediately in window procs if the key was handled
Assigning open bugs to 3.5 for fixing.