mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-29 11:26:13 +08:00
fix: caps-lock warning stuck on linux (@fehmer) (#7195)
Just pressing caps-lock on linux (firefox, chrome) activates the caps-lock warning but does not clear the caps-lock warning until pressing another key.
This commit is contained in:
parent
d1011bd1f5
commit
64a0bdc3e2
1 changed files with 7 additions and 3 deletions
|
|
@ -22,9 +22,13 @@ function hide(): void {
|
|||
}
|
||||
|
||||
function update(event: JQuery.KeyDownEvent | JQuery.KeyUpEvent): void {
|
||||
const modState = event?.originalEvent?.getModifierState?.("CapsLock");
|
||||
if (modState !== undefined) {
|
||||
capsState = modState;
|
||||
if (event?.originalEvent?.key === "CapsLock" && capsState !== null) {
|
||||
capsState = !capsState;
|
||||
} else {
|
||||
const modState = event?.originalEvent?.getModifierState?.("CapsLock");
|
||||
if (modState !== undefined) {
|
||||
capsState = modState;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue