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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user