Is there a way to capture ctrl+enter or ctrl+backspace?
panicz opened this issue · 2 comments
panicz commented
When I receive a KeyStoke
by invoking the readInput
method with the ctrl
key pressed, and I press a regular character, I get something that is printed as KeyStroke{keytype=Character, character='e', modifiers=[ctrl]}
, and for which the isCtrlPressed
method returns true
.
However, when I press enter
, the keystroke object is printed as KeyStroke{keytype=Enter, character='\n'}
, and the isCtrlPressed
method returns false
regardless of the actual state of the ctrl
button.
So I'd like to know if there's any way to obtain the state of modifier buttons for objects whose keytype is different than Character
?
avl42 commented
If you run lanterna in a terminal, you're constrained to the input the
terminal supports. they all support ctrl for letters, except that some
ctrl-letters are tab(ctrl-i), backspace(ctrl-h) or newline (ctrl-m/j) some
other keys like cursor home,end,pgup,pgdn,ins,del may depend on the
specific terminal, as to whether ctrl it is supported.
There's much legacy involved with terminals.
Panicz ***@***.***> schrieb am Di., 12. Sep. 2023, 00:11:
… When I receive a KeyStoke by invoking the readInput method with the ctrl
key pressed, and I press a regular character, I get something that is
printed as KeyStroke{keytype=Character, character='e', modifiers=[ctrl]},
and for which the isCtrlPressed method returns true.
However, when I press enter, the keystroke object is printed as KeyStroke{keytype=Enter,
character='\n'}, and the isCtrlPressed method returns false regardless of
the actual state of the ctrl button.
So I'd like to know if there's any way to obtain the state of modifier
buttons for objects whose keytype is different than Character?
—
Reply to this email directly, view it on GitHub
<#580>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABIDBMWHVXWEEHAKOODECE3XZ6D73ANCNFSM6AAAAAA4T7E7PQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
panicz commented
Thanks for clarification!