Open MarSoft opened 4 years ago
No, but it can be easily implemented.
Your question already identifies the core issue :-) The output generation should be trivially extensible to all relevant modifier keys. For input, one possibility is to define an escape syntax for modifier and other special keys. However, I feel that this violates the spirit of this tool that essentially implements an inverse keymap. I'd prefer to support hotkey combinations by special command-line options. For example, echo a | uinputchars -C
might emit a Control+a.
I'll consider patches or may even implement it myself someday if people want it.
What about stuff like Ctrl+F4? They don't have corresponding text for stdin at all. Or maybe pass them as modifiers? Like this: echo -n | uinputchars -m Ctrl+F4
вт, 18 февр. 2020 г., 0:41 Justus Piater notifications@github.com:
No, but it can be easily implemented.
Your question already identifies the core issue :-) The output generation should be trivially extensible to all relevant modifier keys. For input, one possibility is to define an escape syntax for modifier and other special keys. However, I feel that this violates the spirit of this tool that essentially implements an inverse keymap. I'd prefer to support hotkey combinations by special command-line options. For example, echo a | uinputchars -C might emit a Control+a.
I'll consider patches or may even implement it myself someday if people want it.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/piater/uinputchars/issues/1?email_source=notifications&email_token=AABJZ224PONXEYAEQJCJX23RDL77XA5CNFSM4KWYE2B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL7XPWY#issuecomment-587167707, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABJZ23EPQNANZHVC4VDVFLRDL77XANCNFSM4KWYE2BQ .
Good point. Technically, function keys are also subject to keymap translation, as are modifier keys. So maybe the best course of action is an escape syntax after all. Since key press and key release events are emitted separately, one might separate the issues of literal vs. escaped input and key press vs release events. Thinking aloud, how about:
\
: escape character\\
: literal backslash\(
: next token represents a key press event\)
: key pressed at corresponding \(
is released\K_...
: action code to be translated by inverse keymap to corresponding keycode KEY_...
to be emitted\KEY_...
: keycode to be emitted, bypassing the inverse keymap`: terminates
\K...` tokens; can be omitted if next token is also escaped\(
and \)
) not immediately preceded by \(
results in a key press and a key release event in immediate successionExamples:
\(\K_CTRL\K_F4\)
A
, \(\K_SHIFTL a\)
, \(\K_SHIFTL\(a\)\)
\(\K_CTRL xs\)
\(\K_CTRL\(\K_ALT\K_F2\)\)
Is it possible to send some hotkey combination with this tool? Something like
Control+Super+X
. If yes then how to prepare the correct stdin input for the tool?