Commit 1512614
committed
gmenu: return an indication of handled keys from
This patch updates the function `gmenu_presskeys()` to return `true`
if the keys are actually handled. This allows the caller function
`PressKey()` to continue processing keys and not silently drop them,
even when the game menu is active.
Why bother? First of all, there should not be any reasons not to
handle keys once the game menu is open. For example, why not handle
the "Quick Load" shortcut once the player is dead and the menu is
shown on the screen?
The other reason is more practical. In headless mode, once the game is
controlled by a 3rd party application (training of an AI agent, for
example), lost key presses lead to a broken training procedure.
Therefore, even if the menu is raised, it is crucial not to lose a
keystroke.
Signed-off-by: Roman Penyaev <[email protected]>gmenu_presskeys()
1 parent 4eb63dd commit 1512614
File tree
1 file changed
+3
-1
lines changed- Source
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
| 302 | + | |
| 303 | + | |
303 | 304 | | |
| 305 | + | |
304 | 306 | | |
305 | 307 | | |
306 | 308 | | |
| |||
0 commit comments