feat: implement one-shot modifier keys for mobile terminal

- Redesign useSpecialKeys hook with modifier state tracking
- Add one-shot activation for Ctrl and Alt keys
- Visual feedback: active modifiers shown with yellow highlight
- Fix focusInput to use term.focus() instead of hidden input
- Always refocus terminal after sending any special key
- Add requestAnimationFrame for reliable focus restoration
This commit is contained in:
Fusion
2026-05-24 12:28:36 +02:00
parent 4f9aa7e3c2
commit 12378def4d
5 changed files with 121 additions and 25 deletions
+2 -2
View File
@@ -198,7 +198,7 @@ export const TerminalComponent: React.FC<TerminalProps> = ({
}
};
const focusInput = () => {
hiddenInputRef.current?.focus();
termRef.current?.focus();
};
onTerminalReadyRef.current(sendData, status, focusInput);
}
@@ -230,7 +230,7 @@ export const TerminalComponent: React.FC<TerminalProps> = ({
}
};
const focusInput = () => {
hiddenInputRef.current?.focus();
termRef.current?.focus();
};
onTerminalReady(sendData, status, focusInput);
}