mirror of
https://github.com/holub/mame
synced 2025-07-05 01:48:29 +03:00
Merge pull request #1804 from bradhugh/autorepeat_fix
Double-check key state before UI autorepeat. Fixes #1169
This commit is contained in:
commit
d44a1ac1fa
@ -263,7 +263,14 @@ g_profiler.start(PROFILER_INPUT);
|
|||||||
|
|
||||||
/* if this is an autorepeat case, set a 1x delay and leave pressed = 1 */
|
/* 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)
|
else if (speed > 0 && (osd_ticks() + tps - m_next_repeat[code]) >= tps)
|
||||||
|
{
|
||||||
|
// 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;
|
m_next_repeat[code] += 1 * speed * tps / 60;
|
||||||
|
}
|
||||||
|
|
||||||
/* otherwise, reset pressed = 0 */
|
/* otherwise, reset pressed = 0 */
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user