mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-20 21:03:16 +08:00
fix: caps lock state sometimes being out of sync
This commit is contained in:
parent
d957e7afec
commit
a6232beea5
1 changed files with 2 additions and 5 deletions
|
@ -22,11 +22,8 @@ function hide(): void {
|
|||
}
|
||||
|
||||
function update(event: JQuery.KeyDownEvent | JQuery.KeyUpEvent): void {
|
||||
if (event?.originalEvent?.key === "CapsLock" && capsState !== null) {
|
||||
capsState = !capsState;
|
||||
} else {
|
||||
capsState = event?.originalEvent?.getModifierState?.("CapsLock") ?? false;
|
||||
}
|
||||
capsState =
|
||||
event?.originalEvent?.getModifierState?.("CapsLock") ?? !capsState;
|
||||
|
||||
try {
|
||||
if (Config.capsLockWarning && capsState) {
|
||||
|
|
Loading…
Reference in a new issue