[wesnoth-commits] [wesnoth/wesnoth] 948987: Fix #2573: hotkeys may not activate on first press

GitHub noreply at github.com
Thu Mar 1 19:47:48 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 948987504581fc3c28f1ed3b715a87dd93f9b33e
      https://github.com/wesnoth/wesnoth/commit/948987504581fc3c28f1ed3b715a87dd93f9b33e
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2018-03-01 (Thu, 01 Mar 2018)

  Changed paths:
    M src/controller_base.cpp
    M src/controller_base.hpp
    M src/hotkey/command_executor.cpp
    M src/hotkey/command_executor.hpp

  Log Message:
  -----------
  Fix #2573: hotkeys may not activate on first press

Regression from commit ecc0dca665737bcb411fbd355edd37df8a9038b8.

In that commit I set the input system to not consider key press events as
real key presses if a key release event hadn't been received in between.
The problem was that if the hotkey created a modal dialog, that dialog
became the active event context and consumed the key release event.
The hotkey system had no idea that the player had released the key.

Fixed by using a global event handler to listen to key release events.




More information about the Commits mailing list