mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-22 10:17:22 +00:00
AGS: in the new key input mode, only update key state once a frame
From upstream 8c456d2e4b3c9e24f883522b59b4c73d422e4c28 Not sure if this will actually do so, since there may be other places in the ScummVM event handler where event polling may be done.
This commit is contained in:
parent
a302d96a28
commit
ae0609ae51
@ -79,7 +79,7 @@ Common::Event ags_get_next_keyevent() {
|
||||
}
|
||||
|
||||
int ags_iskeydown(eAGSKeyCode ags_key) {
|
||||
return ::AGS::g_events->isKeyPressed(ags_key);
|
||||
return ::AGS::g_events->isKeyPressed(ags_key, _GP(game).options[OPT_KEYHANDLEAPI] == 0);
|
||||
}
|
||||
|
||||
void ags_simulate_keypress(eAGSKeyCode ags_key) {
|
||||
|
@ -157,8 +157,9 @@ void EventsManager::updateKeys(const Common::Event &event, bool isDown) {
|
||||
_keys[event.kbd.keycode] = isDown;
|
||||
}
|
||||
|
||||
bool EventsManager::isKeyPressed(AGS3::eAGSKeyCode key) {
|
||||
pollEvents();
|
||||
bool EventsManager::isKeyPressed(AGS3::eAGSKeyCode key, bool poll) {
|
||||
if (poll)
|
||||
pollEvents();
|
||||
|
||||
Common::KeyCode kc[3];
|
||||
if (!ags_key_to_scancode(key, kc))
|
||||
|
@ -105,7 +105,7 @@ public:
|
||||
/**
|
||||
* Returns true if a given key is pressed
|
||||
*/
|
||||
bool isKeyPressed(AGS3::eAGSKeyCode key);
|
||||
bool isKeyPressed(AGS3::eAGSKeyCode key, bool poll = true);
|
||||
|
||||
void clearEvents() {
|
||||
_pendingEvents.clear();
|
||||
|
Loading…
x
Reference in New Issue
Block a user