You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently using your package for a mobile app and am absolutely loving it! I would like to further work on supporting software keyboards to add even more functionality to this package. The main feature I would like to implement at the moment is support for control keys (control, alt, meta) as software buttons.
@xtyxtyx Considering that this feature will require a few fundamental changes in how key-inputs are handled and given that you are way more familiar with the overall project architecture, I wanted to discuss how to best implement this feature.
Proposal
My initial implementation approach for this would be to introduce a TerminalKeyboard class. An instance of this class would be passed to TerminalView and expose an API for manually entering keys into the terminal from within the app.
This would make for a very short and readable syntax when adding custom key input methods:
Below the surface, this object would handle all logic related to text input from the software keyboard (i.e. TextInputClient) and store the state for whether ctrl, alt, meta are currently pressed on the virtual keyboard.
abstractclassTerminalKeyboard {
lateInputClient _inputClient;
Terminal? _terminal;
// control keysbool _isAltPressed;
boolget isAltPressed => _isAltPressed;
setsetAltPressed(bool value) => _isAltPressed = value;
bool _isControlPressed;
boolget isControlPressed => _isControlPressed;
setsetControlPressed(bool value) => _isControlPressed = value;
bool _isMetaPressed;
boolget isMetaPressed => _isMetaPressed;
setsetMetaPressed(bool value) => _isMetaPressed = value;
// Enter key into terminalvoidkeyInput(
TerminalKey key, {
bool isAltPressed =false,
bool isControlPressed =false,
bool isMetaPressed =false,
});
// creates input connection and attaches it to TextInput// (may only be called from within keyboard listener)void_attach();
// closes input connection// (may only be called from within keyboard listener)void_detach();
}
This is just a rough sketch of course.
Please let me know your thoughts on this!
The text was updated successfully, but these errors were encountered:
I am currently using your package for a mobile app and am absolutely loving it! I would like to further work on supporting software keyboards to add even more functionality to this package. The main feature I would like to implement at the moment is support for control keys (control, alt, meta) as software buttons.
@xtyxtyx Considering that this feature will require a few fundamental changes in how key-inputs are handled and given that you are way more familiar with the overall project architecture, I wanted to discuss how to best implement this feature.
Proposal
My initial implementation approach for this would be to introduce a
TerminalKeyboard
class. An instance of this class would be passed toTerminalView
and expose an API for manually entering keys into the terminal from within the app.This would make for a very short and readable syntax when adding custom key input methods:
Below the surface, this object would handle all logic related to text input from the software keyboard (i.e. TextInputClient) and store the state for whether ctrl, alt, meta are currently pressed on the virtual keyboard.
This is just a rough sketch of course.
Please let me know your thoughts on this!
The text was updated successfully, but these errors were encountered: