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:
Chris Michael 2013-11-25 07:47:52 +00:00
parent 55c0dbb3c8
commit 445f2eb206
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}
}