mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-09 02:12:47 +00:00
Hotkey Bind: quick hack to allow dialog to function even without fix from 585ce88 (now reverted)
This commit is contained in:
parent
5ae33e1f02
commit
3ad798f0a1
@ -48,6 +48,14 @@ void hotkey_bind::pre_show(window& window)
|
||||
|
||||
void hotkey_bind::key_press_callback(window& window, const SDL_Keycode key)
|
||||
{
|
||||
/* HACK: SDL_KEYDOWN and SDL_TEXTINPUT events forward to the same GUI2 event (SDL_KEY_DOWN), meaning
|
||||
* this even gets fired twice, causing problems since 'key' will be 0 in the latter case. SDLK_UNKNOWN
|
||||
* is the key value used by SDL_TEXTINPUT handling, so exit here if that's detected.
|
||||
*/
|
||||
if(key == SDLK_UNKNOWN) {
|
||||
return;
|
||||
}
|
||||
|
||||
new_binding_ = hotkey::create_hotkey(hotkey_id_, SDL_GetScancodeFromKey(key));
|
||||
|
||||
window.set_retval(window::OK);
|
||||
|
Loading…
x
Reference in New Issue
Block a user