Skip to content

Commit ea50fbd

Browse files
authored
Merge pull request #5742 from Tyriar/5721
work around Safari sending keycode 13 (enter) when typing ctrl-c (take 2)
2 parents 413c87c + 87bf81c commit ea50fbd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/common/input/Keyboard.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ 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+
// HACK: Safari on iPad, iOS, AppleVisionPro sends key 13 when typing ctrl-c on hardware
104+
// keyboard
105+
result.key = C0.ETX;
106+
} else {
107+
result.key = ev.altKey ? C0.ESC + C0.CR : C0.CR;
108+
}
103109
result.cancel = true;
104110
break;
105111
case 27:

0 commit comments

Comments
 (0)