Skip to content

Commit 0fa197c

Browse files
committed
handle uppercase latin characters better on mobile
1 parent a9272cf commit 0fa197c

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

addons/gst-web-core/lib/input.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,10 +1526,23 @@ export class Input {
15261526
return;
15271527
}
15281528
for (let i = 0; i < text.length; i++) {
1529-
const keysym = Keysyms.lookup(text.charCodeAt(i));
1530-
if (keysym) {
1531-
this.send("kd," + keysym);
1532-
this.send("ku," + keysym);
1529+
const char = text[i];
1530+
const isUpperCase = char >= 'A' && char <= 'Z';
1531+
if (isUpperCase) {
1532+
this.send("kd," + KeyTable.XK_Shift_L);
1533+
const lowerChar = char.toLowerCase();
1534+
const letterKeysym = Keysyms.lookup(lowerChar.charCodeAt(0));
1535+
if (letterKeysym) {
1536+
this.send("kd," + letterKeysym);
1537+
this.send("ku," + letterKeysym);
1538+
}
1539+
this.send("ku," + KeyTable.XK_Shift_L);
1540+
} else {
1541+
const keysym = Keysyms.lookup(char.charCodeAt(0));
1542+
if (keysym) {
1543+
this.send("kd," + keysym);
1544+
this.send("ku," + keysym);
1545+
}
15331546
}
15341547
}
15351548
event.target.value = '';

0 commit comments

Comments
 (0)