Don't send break code on key repeat
This commit is contained in:
parent
0611ffc694
commit
30d4a56669
|
@ -387,7 +387,7 @@ function KeyboardAdapter(bus)
|
|||
return;
|
||||
}
|
||||
|
||||
handle_code(code, keydown);
|
||||
handle_code(code, keydown, e.repeat);
|
||||
|
||||
e.preventDefault && e.preventDefault();
|
||||
|
||||
|
@ -397,12 +397,13 @@ function KeyboardAdapter(bus)
|
|||
/**
|
||||
* @param {number} code
|
||||
* @param {boolean} keydown
|
||||
* @param {boolean=} is_repeat
|
||||
*/
|
||||
function handle_code(code, keydown)
|
||||
function handle_code(code, keydown, is_repeat)
|
||||
{
|
||||
if(keydown)
|
||||
{
|
||||
if(keys_pressed[code])
|
||||
if(keys_pressed[code] && !is_repeat)
|
||||
{
|
||||
handle_code(code, false);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue