Skip to content

Commit

Permalink
Fix holding shift on Windows firing rapidly (arnog#2064)
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarhermoso committed Jul 21, 2023
1 parent 81ac5cd commit 9946122
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/virtual-keyboard/virtual-keyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ export class VirtualKeyboard implements VirtualKeyboardInterface, EventTarget {
if (typeof x === 'function') x(event);
else x?.handleEvent(event);
});

return !event.defaultPrevented;
}

Expand Down Expand Up @@ -608,7 +607,7 @@ export class VirtualKeyboard implements VirtualKeyboardInterface, EventTarget {
break;

case 'keydown': {
if (evt.key === 'Shift') this.shiftPressCount = 1;
if (evt.key === 'Shift' && !evt.repeat) this.shiftPressCount = 1;
break;
}

Expand Down

0 comments on commit 9946122

Please sign in to comment.