fix: handle terminal keyboard input on Android tablet (#1133)
* fix: handle terminal keyboard input on Android with desktop UA - Detect Android via navigator.userAgentData.platform when UA is spoofed by Chrome's "Desktop site" mode, so the <input> overlay (useTextInput) is used instead of <textarea>. - Handle Ctrl+letter and Alt+letter combos in the hidden input overlay's keydown handler, so terminal control sequences (^C, ^D, ^S, M-x, etc.) work through the touch input path. - Skip global keyboard shortcuts (sidebar toggle, etc.) when focus is inside the terminal viewport, preventing shortcut steal. * fix: preserve terminal keyboard shortcuts --------- Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
Bohdan Triapitsyn
parent
d5b3590901
commit
b65edc3436
@@ -64,7 +64,6 @@ export const useKeyboardShortcuts = () => {
|
||||
target.getAttribute('data-terminal-hidden-input') === 'true'
|
||||
);
|
||||
};
|
||||
|
||||
const handleTerminalShortcutCapture = (e: KeyboardEvent) => {
|
||||
if (!isTerminalEventTarget(e.target)) {
|
||||
return;
|
||||
@@ -94,6 +93,10 @@ export const useKeyboardShortcuts = () => {
|
||||
};
|
||||
|
||||
const handleKeyDown = (e: KeyboardEvent) => {
|
||||
if (isTerminalEventTarget(e.target)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (eventMatchesShortcut(e, combo('open_command_palette'))) {
|
||||
e.preventDefault();
|
||||
toggleCommandPalette();
|
||||
|
||||
Reference in New Issue
Block a user