Skip to content

Commit

Permalink
AltGr characters are discarded, fixes #158
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Aug 3, 2017
1 parent 8e451a7 commit 7d766fb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ protected String getEscapeSequenceFromConsoleInput(final boolean isKeyDown, fina
final int ctrlState = 0x0008 | 0x0004;
final int shiftState = 0x0010;
final boolean isCtrl = (controlKeyState & ctrlState) > 0;
final boolean isAlt = (controlKeyState & altState) > 0;
// Pressing "Alt Gr" is translated to Alt-Ctrl, hence it has to be checked that Ctrl is _not_ pressed,
// otherwise inserting of "Alt Gr" codes on non-US keyboards would yield errors
final boolean isAlt = (controlKeyState & altState) > 0 && !isCtrl;
final boolean isShift = (controlKeyState & shiftState) > 0;
char ch = uchar;
StringBuilder sb = new StringBuilder(32);
Expand Down

0 comments on commit 7d766fb

Please sign in to comment.