From f15f1c75a3d0e6bf162e1d931a43f1aa12914bb4 Mon Sep 17 00:00:00 2001 From: RetGal Date: Sun, 21 Nov 2021 17:08:10 +0100 Subject: [PATCH] Release Alt Graph before attempting to type chars as unicode --- .../control/RobotNetworkControlMessageHandler.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/mpo/dayon/assisted/control/RobotNetworkControlMessageHandler.java b/src/main/java/mpo/dayon/assisted/control/RobotNetworkControlMessageHandler.java index 5947eae4..4bd95ca1 100644 --- a/src/main/java/mpo/dayon/assisted/control/RobotNetworkControlMessageHandler.java +++ b/src/main/java/mpo/dayon/assisted/control/RobotNetworkControlMessageHandler.java @@ -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); @@ -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); } @@ -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);