Skip to content

Commit

Permalink
Merge pull request #1881 from Tyriar/1880_key_repeat
Browse files Browse the repository at this point in the history
Don't print keys that print more than a single char
  • Loading branch information
Tyriar committed Jan 7, 2019
2 parents 0b8c320 + 7a416aa commit 509ce5f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/input/Keyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,8 @@ export function evaluateKeyboardEvent(
if (ev.keyCode === 65) { // cmd + a
result.type = KeyboardResultType.SELECT_ALL;
}
} else if (ev.key && !ev.ctrlKey && !ev.altKey && !ev.metaKey &&
ev.keyCode >= 48 && ev.keyCode !== 144 && ev.keyCode !== 145) {
// Include only keys that that result in a character; don't include num lock and scroll lock
} else if (ev.key && !ev.ctrlKey && !ev.altKey && !ev.metaKey && ev.keyCode >= 48 && ev.key.length === 1) {
// Include only keys that that result in a _single_ character; don't include num lock, volume up, etc.
result.key = ev.key;
}
break;
Expand Down

0 comments on commit 509ce5f

Please sign in to comment.