Fixed CapsLock triggering input twice in MacOS.

This commit is contained in:
cweijan
2025-01-07 22:57:40 +08:00
parent ce095b3593
commit 0433fb8a4b
+2 -1
View File
@@ -93,7 +93,8 @@ export class CompositionHelper {
*/
public keydown(ev: KeyboardEvent): boolean {
if (this._isComposing || this._isSendingComposition) {
if (ev.keyCode === 229) {
if (ev.keyCode === 20 || ev.keyCode === 229) {
// 20 is CapsLock, 229 is Enter
// Continue composing if the keyCode is the "composition character"
return false;
}