jwill / lanterna

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

Escape key gets reported as normal key in SwingTerminal running on Windows 7 #60

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This issue is quite strange, as it seems it happens only under my Windows 7 
laptop.

When a key event is handled by an interactable component, the key event is 
reported twice: once with a type Escape, once with a type NormalKey.

I am attaching a small test class I am using for reproduction.

Test use case: start the app. Press "Escape" key once.

Its output when starting from eclipse on Windows is as follows:
Char value:92
Key kind:Escape
Char value:27
Key kind:NormalKey

When doing the same on macosx, I only get the escape key reported:
Char value:92
Key kind:Escape

Original issue reported on code.google.com by jli...@gmail.com on 5 Jan 2013 at 3:35

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by jli...@gmail.com on 5 Jan 2013 at 3:37

Attachments:

GoogleCodeExporter commented 9 years ago
Adding '\33' (esc char code) to the typedIgnore HashSet on line 364 in 
SwingTerminal.java fixes this, although I am not sure if it is the 'correct' 
way.

Original comment by nachjoc...@gmail.com on 17 Jan 2013 at 2:26

GoogleCodeExporter commented 9 years ago
Thank you, I can reproduce this too. I'm adding \33 to the typedIgnore hashset, 
it seems ok to me. Just need to check on Linux if it's still working and ask 
someone to test on Mac. 

Original comment by mab...@gmail.com on 20 Jan 2013 at 1:45