mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 13:04:35 +00:00
Wayland: keyboard repeat rate is given in Hz
It was currently interpreted as ms, which is obviously wrong. Thanks to https://github.com/Smithay/client-toolkit/pull/62 for making me notice this issue.
This commit is contained in:
parent
ec3784f3d7
commit
5f9cbd0ebc
@ -589,8 +589,10 @@ static void keyboardHandleKey(void* data,
|
||||
{
|
||||
_glfw.wl.keyboardLastKey = keyCode;
|
||||
_glfw.wl.keyboardLastScancode = key;
|
||||
timer.it_interval.tv_sec = _glfw.wl.keyboardRepeatRate / 1000;
|
||||
timer.it_interval.tv_nsec = (_glfw.wl.keyboardRepeatRate % 1000) * 1000000;
|
||||
if (_glfw.wl.keyboardRepeatRate > 1)
|
||||
timer.it_interval.tv_nsec = 1000000000 / _glfw.wl.keyboardRepeatRate;
|
||||
else
|
||||
timer.it_interval.tv_sec = 1;
|
||||
timer.it_value.tv_sec = _glfw.wl.keyboardRepeatDelay / 1000;
|
||||
timer.it_value.tv_nsec = (_glfw.wl.keyboardRepeatDelay % 1000) * 1000000;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user