Skip to content

Commit 3845008

Browse files
authored
Merge pull request #3728 from serkodev/fix-caps-lock-ime
Fix Caps lock bug when using some IME on macOS
2 parents 5d3a9e8 + 1801403 commit 3845008

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/browser/Terminal.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,14 @@ export class Terminal extends CoreTerminal implements ITerminal {
11401140
return true;
11411141
}
11421142

1143+
// HACK: Process A-Z in the keypress event to fix an issue with macOS IMEs where lower case
1144+
// letters cannot be input while caps lock is on.
1145+
if (event.key && !event.ctrlKey && !event.altKey && !event.metaKey && event.key.length === 1) {
1146+
if (event.key.charCodeAt(0) >= 65 && event.key.charCodeAt(0) <= 90) {
1147+
return true;
1148+
}
1149+
}
1150+
11431151
if (this._unprocessedDeadKey) {
11441152
this._unprocessedDeadKey = false;
11451153
return true;

0 commit comments

Comments
 (0)