diff options
author | 2016-12-06 08:55:45 -0500 | |
---|---|---|
committer | 2016-12-06 09:02:20 -0500 | |
commit | 22397e0c5d1377f13dc5028aaea75ca3e540f139 (patch) | |
tree | 9d6caa7676b2d981522f50906f950ea256cace1a | |
parent | fcbbc0a0ac3e378742246dbcc28bec7a299ee8ec (diff) |
Double-check key state before UI autorepeat. Fixes #1169
-rw-r--r-- | src/emu/uiinput.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/emu/uiinput.cpp b/src/emu/uiinput.cpp index 952a5b371b3..9123a6af526 100644 --- a/src/emu/uiinput.cpp +++ b/src/emu/uiinput.cpp @@ -263,7 +263,14 @@ g_profiler.start(PROFILER_INPUT); /* if this is an autorepeat case, set a 1x delay and leave pressed = 1 */ else if (speed > 0 && (osd_ticks() + tps - m_next_repeat[code]) >= tps) - m_next_repeat[code] += 1 * speed * tps / 60; + { + // In the autorepeatcase, we need to double check the key is still pressed + // as there can be a delay between the key polling and our processing of the event + m_seqpressed[code] = machine().ioport().type_pressed(ioport_type(code)); + pressed = (m_seqpressed[code] == SEQ_PRESSED_TRUE); + if (pressed) + m_next_repeat[code] += 1 * speed * tps / 60; + } /* otherwise, reset pressed = 0 */ else |