Skip to content

Commit

Permalink
Release Alt Graph before attempting to type chars as unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
RetGal committed Nov 21, 2021
1 parent 41c2e23 commit f15f1c7
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private void pressKey(NetworkKeyControlMessage message) {
if (message.getKeyCode() == VK_ALT_GRAPH && File.separatorChar != UNIX_SEPARATOR_CHAR) {
robot.keyPress(VK_CONTROL);
robot.keyPress(VK_ALT);
Log.debug("KeyCode ALT_GRAPH" + message);
Log.debug("KeyCode ALT_GRAPH " + message);
return;
}
Log.debug("KeyCode " + message);
Expand Down Expand Up @@ -136,9 +136,12 @@ private boolean isRegularKey(NetworkKeyControlMessage message) {

private void typeUnicode(int keyCode) {
if (File.separatorChar == UNIX_SEPARATOR_CHAR) {
robot.keyRelease(VK_ALT_GRAPH);
typeLinuxUnicode(keyCode);
return;
}
robot.keyRelease(VK_ALT);
robot.keyRelease(VK_CONTROL);
typeWindowsUnicode(keyCode);
}

Expand All @@ -147,7 +150,7 @@ private void releaseKey(NetworkKeyControlMessage message) {
if (message.getKeyCode() == VK_ALT_GRAPH && File.separatorChar != UNIX_SEPARATOR_CHAR) {
robot.keyRelease(VK_ALT);
robot.keyRelease(VK_CONTROL);
Log.debug("KeyCode ALT_GRAPH" + message);
Log.debug("KeyCode ALT_GRAPH " + message);
return;
}
Log.debug("KeyCode " + message);
Expand Down

0 comments on commit f15f1c7

Please sign in to comment.