forked from enlightenment/efl
Fix keyrepeat going crazy ;)
Previously, if you were hold down shift for 1-2 seconds and then press a key, you would get superfluous key repeats (even tho you released the printable key). This was because the "key repeat" code was not checking for the same key before (re)starting the repeat timer. This fixes the repeating key issue by checking if the key pressed is different than the one already pressed. If so, it will (re)start the timer. If it is not different, then the timer is already running and we don't need to do anything. Fixes T552 Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
55c0dbb3c8
commit
445f2eb206
|
@ -760,7 +760,7 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN
|
|||
if (input->repeat.tmr) ecore_timer_del(input->repeat.tmr);
|
||||
input->repeat.tmr = NULL;
|
||||
}
|
||||
else if (state)
|
||||
else if ((state) && (keycode != input->repeat.key))
|
||||
{
|
||||
input->repeat.sym = sym;
|
||||
input->repeat.key = keycode;
|
||||
|
@ -770,8 +770,8 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN
|
|||
{
|
||||
input->repeat.tmr =
|
||||
ecore_timer_add(0.025, _ecore_wl_input_cb_keyboard_repeat, input);
|
||||
ecore_timer_delay(input->repeat.tmr, 0.4);
|
||||
}
|
||||
ecore_timer_delay(input->repeat.tmr, 0.4);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue