Skip to content

Commit

Permalink
v 3.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Makowski committed Apr 20, 2022
1 parent 6ecff58 commit 53a14f5
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>
<groupId>acc_manager</groupId>
<artifactId>ACCManager</artifactId>
<version>3.0.8</version>
<version>3.0.9</version>
<name>ACCMAnager</name>
<packaging>jar</packaging>
<description>Rest and WebSocket ACC Manager</description>
Expand Down
26 changes: 24 additions & 2 deletions src/main/java/virtualKeyboard/VirtualKeyboardAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public String execute(Map<String, String> allParams) {
KeyboardKey keyboardKey = KeyboardKey.getByCodename(key);
if (Character.isUpperCase(key.charAt(0))) {
Runnable runnableTask = () -> {
System.out.println("isUpperCase");
try {
sendText(KeyboardKey.RSHIFT, DOWN, 0);
TimeUnit.MILLISECONDS.sleep(5);
Expand Down Expand Up @@ -106,8 +107,29 @@ public String execute(Map<String, String> allParams) {
} else {
String string = allParams.get("string");
if (string != null && KeyboardKey.getByCodename(string) != null) {
sendText(KeyboardKey.getByCodename(string), DOWN, 0);
sendText(KeyboardKey.getByCodename(string), UP, 0);
if (string.contains("SHIFT_")) {
System.out.println(string);
sendText(KeyboardKey.RSHIFT, DOWN, 0);
sendText(KeyboardKey.getByCodename(string), DOWN, 0);
sendText(KeyboardKey.getByCodename(string), UP, 0);
sendText(KeyboardKey.RSHIFT, UP, 0);
} else if (string.contains("RALT_")) {
System.out.println(string);
sendText(KeyboardKey.RMENU, DOWN, 0);
sendText(KeyboardKey.getByCodename(string), DOWN, 0);
sendText(KeyboardKey.getByCodename(string), UP, 0);
sendText(KeyboardKey.RMENU, UP, 0);
} else if (string.contains("LALT_")) {
System.out.println(string);
sendText(KeyboardKey.LMENU, DOWN, 0);
sendText(KeyboardKey.getByCodename(string), DOWN, 0);
sendText(KeyboardKey.getByCodename(string), UP, 0);
sendText(KeyboardKey.LMENU, UP, 0);
} else {
System.out.println(string);
sendText(KeyboardKey.getByCodename(string), DOWN, 0);
sendText(KeyboardKey.getByCodename(string), UP, 0);
}
}
}
/*
Expand Down
40 changes: 40 additions & 0 deletions src/main/java/virtualKeyboard/model/KeyboardKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,36 @@ public enum KeyboardKey {
NUM7(0x37, "7"),
NUM8(0x38, "8"),
NUM9(0x39, "9"),
SHIFT_NUM0(0x30, "SHIFT_NUM0"),
SHIFT_NUM1(0x31, "SHIFT_NUM1"),
SHIFT_NUM2(0x32, "SHIFT_NUM2"),
SHIFT_NUM3(0x33, "SHIFT_NUM3"),
SHIFT_NUM4(0x34, "SHIFT_NUM4"),
SHIFT_NUM5(0x35, "SHIFT_NUM5"),
SHIFT_NUM6(0x36, "SHIFT_NUM6"),
SHIFT_NUM7(0x37, "SHIFT_NUM7"),
SHIFT_NUM8(0x38, "SHIFT_NUM8"),
SHIFT_NUM9(0x39, "SHIFT_NUM9"),
RALT_NUM0(0x30, "RALT_NUM0"),
RALT_NUM1(0x31, "RALT_NUM1"),
RALT_NUM2(0x32, "RALT_NUM2"),
RALT_NUM3(0x33, "RALT_NUM3"),
RALT_NUM4(0x34, "RALT_NUM4"),
RALT_NUM5(0x35, "RALT_NUM5"),
RALT_NUM6(0x36, "RALT_NUM6"),
RALT_NUM7(0x37, "RALT_NUM7"),
RALT_NUM8(0x38, "RALT_NUM8"),
RALT_NUM9(0x39, "RALT_NUM9"),
LALT_NUM0(0x30, "LALT_NUM0"),
LALT_NUM1(0x31, "LALT_NUM1"),
LALT_NUM2(0x32, "LALT_NUM2"),
LALT_NUM3(0x33, "LALT_NUM3"),
LALT_NUM4(0x34, "LALT_NUM4"),
LALT_NUM5(0x35, "LALT_NUM5"),
LALT_NUM6(0x36, "LALT_NUM6"),
LALT_NUM7(0x37, "LALT_NUM7"),
LALT_NUM8(0x38, "LALT_NUM8"),
LALT_NUM9(0x39, "LALT_NUM9"),

A(0x41),
B(0x42),
Expand Down Expand Up @@ -101,6 +131,16 @@ public enum KeyboardKey {
NUMPAD7(0x67),
NUMPAD8(0x68),
NUMPAD9(0x69),
SHIFT_NUMPAD0(0x60, "SHIFT_NUMPAD0"),
SHIFT_NUMPAD1(0x61, "SHIFT_NUMPAD1"),
SHIFT_NUMPAD2(0x62, "SHIFT_NUMPAD2"),
SHIFT_NUMPAD3(0x63, "SHIFT_NUMPAD3"),
SHIFT_NUMPAD4(0x64, "SHIFT_NUMPAD4"),
SHIFT_NUMPAD5(0x65, "SHIFT_NUMPAD5"),
SHIFT_NUMPAD6(0x66, "SHIFT_NUMPAD6"),
SHIFT_NUMPAD7(0x67, "SHIFT_NUMPAD7"),
SHIFT_NUMPAD8(0x68, "SHIFT_NUMPAD8"),
SHIFT_NUMPAD9(0x69, "SHIFT_NUMPAD9"),
MULTIPLY(0x6A),
ADD(0x6B),
SEPARATOR(0x6C),
Expand Down

0 comments on commit 53a14f5

Please sign in to comment.