Skip to content

Commit f155c65

Browse files
sergezlotoTyriar
authored andcommitted
work around Safari sending keycode 13 (enter) when typing ctrl-c on iphone, iPad, AppleVisionPro
1 parent 413c87c commit f155c65

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/common/input/Keyboard.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@ export function evaluateKeyboardEvent(
9999
break;
100100
case 13:
101101
// return/enter
102-
result.key = ev.altKey ? C0.ESC + C0.CR : C0.CR;
102+
if (ev.key == 'c' && ev.ctrlKey) {
103+
// Safari on iPad, iOS, AppleVisionPro sends key 13 when typing ctrl-c on hardware keyboard
104+
result.key = C0.ETX;
105+
} else {
106+
result.key = ev.altKey ? C0.ESC + C0.CR : C0.CR;
107+
}
103108
result.cancel = true;
104109
break;
105110
case 27:

0 commit comments

Comments
 (0)