Empyreus / lanterna

Automatically exported from code.google.com/p/lanterna
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Add key chords to input system #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Specifically, the ability to read chars like Control/Alt/Meta+<char>, but 
ideally even arbitrary chords such as two letters (e.g. ",.")

Original issue reported on code.google.com by m...@bjeanes.com on 19 Aug 2012 at 3:41

GoogleCodeExporter commented 9 years ago
(should be type=enhancement but I can't seem to control that)

Original comment by m...@bjeanes.com on 19 Aug 2012 at 3:41

GoogleCodeExporter commented 9 years ago
Yeah, that's something the input system should support, I agree...

Original comment by mab...@gmail.com on 19 Aug 2012 at 6:54

GoogleCodeExporter commented 9 years ago
An overhall of the key reading system based on a state machine a la 
https://github.com/paultag/libansiescape/blob/master/src/StateMachine.cc is 
probably the best approach to opening up support for reading the full range of 
ansi escape codes.

Original comment by m...@bjeanes.com on 19 Aug 2012 at 6:00

GoogleCodeExporter commented 9 years ago
I've added experimental support for this now, you can call isAltPressed() and 
isCtrlPressed() on a Key object. Not all key combinations are supported though, 
alt only works with alpha-numeric (for now) and ctrl ony with a to z. 

One issue is that the control sequences associated with the ctrl key 
combinations (ctrl + c exits the program, ctrl + i puts tab character, etc) are 
still active, making it impossible to read these as raw keyboard events. I 
don't know how to fix this, if anyone does, please let me know!

Latest 2.1.0-SNAPSHOT with support for this has been deployed to Sonatype.

Original comment by mab...@gmail.com on 2 Sep 2012 at 12:58

GoogleCodeExporter commented 9 years ago
So I've managed to fix ctrl+c, ctrl+z, ctrl+s and ctrl+q, still not working 
are, to my knowledge, ctrl+j (equals to enter) and ctrl+i (equals to tab). Not 
sure how to fix them, or if it's even possible. 

Original comment by mab...@gmail.com on 8 Sep 2012 at 2:15