Closed panicz closed 9 months ago
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 https://github.com/mabe02/lanterna/issues/580, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIDBMWHVXWEEHAKOODECE3XZ6D73ANCNFSM6AAAAAA4T7E7PQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Thanks for clarification!
When I receive a
KeyStoke
by invoking thereadInput
method with thectrl
key pressed, and I press a regular character, I get something that is printed asKeyStroke{keytype=Character, character='e', modifiers=[ctrl]}
, and for which theisCtrlPressed
method returnstrue
.However, when I press
enter
, the keystroke object is printed asKeyStroke{keytype=Enter, character='\n'}
, and theisCtrlPressed
method returnsfalse
regardless of the actual state of thectrl
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
?