[Scummvm-git-logs] scummvm master -> d2865e7dc6c78587b91a0c4fa76eafd80f64bf0c
sev-
noreply at scummvm.org
Mon Aug 28 19:59:33 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
d2865e7dc6 GUI: Add allowKdbRepeats() to up/down/left/right actions in launcher
Commit: d2865e7dc6c78587b91a0c4fa76eafd80f64bf0c
https://github.com/scummvm/scummvm/commit/d2865e7dc6c78587b91a0c4fa76eafd80f64bf0c
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2023-08-28T21:59:30+02:00
Commit Message:
GUI: Add allowKdbRepeats() to up/down/left/right actions in launcher
This matches also the behavior as set in engines/metaengine.cpp MetaEngine::initKeymaps()
This change is needed at least to avoid a hack on Android. Setting the "kdbRepeat" flag
for events of keeping the arrow keys pressed (on the touch virtual keyboard), as Android supports,
would not work to eg. keep going through a list upwards or downwards with the respective
arrow key pressed. Instead we had to hack the behavior of a physical keyboard which
sents multiple keypresses (keydown and keyup events), without setting the kbdRepeat flag.
However, this hack would work poorly in some game engines (eg. in LBA while rotating Twinsen,
the movement becomes "stuttering"). In-games the kbdRepeat flags is respected already due
to the setting in engines/metaengine.cpp (as far as I can tell) and resulting movement is
more fluid.
Changed paths:
gui/gui-manager.cpp
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index 30a22e358ad..6a8495ee8ab 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -168,21 +168,25 @@ Common::Keymap *GuiManager::getKeymap() const {
act = new Action(kStandardActionMoveUp, _("Up"));
act->setKeyEvent(KEYCODE_UP);
act->addDefaultInputMapping("JOY_UP");
+ act->allowKbdRepeats();
guiMap->addAction(act);
act = new Action(kStandardActionMoveDown, _("Down"));
act->setKeyEvent(KEYCODE_DOWN);
act->addDefaultInputMapping("JOY_DOWN");
+ act->allowKbdRepeats();
guiMap->addAction(act);
act = new Action(kStandardActionMoveLeft, _("Left"));
act->setKeyEvent(KEYCODE_LEFT);
act->addDefaultInputMapping("JOY_LEFT");
+ act->allowKbdRepeats();
guiMap->addAction(act);
act = new Action(kStandardActionMoveRight, _("Right"));
act->setKeyEvent(KEYCODE_RIGHT);
act->addDefaultInputMapping("JOY_RIGHT");
+ act->allowKbdRepeats();
guiMap->addAction(act);
act = new Action(kStandardActionEE, _("???"));
More information about the Scummvm-git-logs
mailing list