Uses 1113K of libraries. Click here for Pure Java version (9939L/53K).
1 | !7 |
2 | |
3 | // fixes typing "|", "{", "[", "]", "}", "\", "@" and "~" in VNC on German keyboard |
4 | |
5 | cmodule2 VNCFixer > DynPrintLogAndEnabled { |
6 | transient new LS shouldSend; |
7 | transient S computerID; |
8 | switchable bool verbose; |
9 | |
10 | start { |
11 | dm_requireLinuxWindowList(); // inZOrder doesn't have to be set anymore |
12 | dm_startKeyLogger(); |
13 | dm_vmBus_onMessage keyUp(voidfunc(int keyCode, int modifiers) { |
14 | if (nempty(shouldSend) && keyCode == 56) { // Alt+Gr released |
15 | switch to q(); |
16 | LS sending = getAndClearList(shouldSend); |
17 | print("Sending " + sending + " to " + computerID); |
18 | for (S key : sending) |
19 | dm_evalOnOtherMachine(computerID, "robot_pressAndRelease_" + key + "_englishLayout();"); |
20 | } |
21 | }); |
22 | dm_vmBus_onMessage keyDown_raw(voidfunc(final int rawCode, int modifiers) { |
23 | if (enabled && modifiers == 128) { |
24 | switch to q(); |
25 | //robot_keyRelease(KeyEvent.VK_ALT_GRAPH); // doesn't work, wait for modifier release instead |
26 | //S activeWindow = getString(first((L) dm_call(dm_linuxWindowList(), 'getData)), 'windowTitle); |
27 | S activeWindowID = linux_activeWindowID(); |
28 | S activeWindow = (S) dm_call(dm_linuxWindowList(), 'titleForWindowID, activeWindowID); |
29 | if (cic(activeWindow, "X desktop (gazelle")) computerID = "ekrmjmnbrukm"; |
30 | else if (cic(activeWindow, "X desktop (onfire.")) computerID = "jozkyjcghlvl"; |
31 | else if (cic(activeWindow, "X desktop (vmd41736")) computerID = "whxojlpjdney"; |
32 | else if (cic(activeWindow, "X desktop (vm13548")) computerID = "hpgrupgrauku"; |
33 | else if (cic(activeWindow, "X desktop (c8.")) computerID = "mqqgnosmbjvj"; |
34 | else if (cicOneOf(activeWindow, "X desktop (big", "X desktop (ns57")) computerID = "pzhvpgtvlbxg"; |
35 | else if (cic(activeWindow, "X desktop (cruddie.")) computerID = "bhatertpkbcr"; |
36 | else { |
37 | if (verbose) print("No matching window (" + activeWindowID + "/" + activeWindow + ")"); |
38 | shouldSend.clear(); |
39 | ret; |
40 | } |
41 | print("Got computer ID: " + computerID + ", rawCode: " + rawCode); |
42 | |
43 | if (rawCode == 124) shouldSend.add("vbar"); |
44 | else if (rawCode == 123 || rawCode == 55) shouldSend.add("openingCurlyBracket"); |
45 | else if (rawCode == 125 || rawCode == 48) shouldSend.add("closingCurlyBracket"); |
46 | else if (rawCode == 91) shouldSend.add("openingSquareBracket"); |
47 | else if (rawCode == 93) shouldSend.add("closingSquareBracket"); |
48 | else if (rawCode == 64) shouldSend.add("at"); |
49 | else if (rawCode == 92) shouldSend.add("backslash"); |
50 | else if (rawCode == 126) shouldSend.add("tilde"); |
51 | } |
52 | }); |
53 | } |
54 | } |
download show line numbers debug dex old transpilations
Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1020495 |
Snippet name: | VNC Fixer [just for Stefan, WORKS, but only on Linux] |
Eternal ID of this version: | #1020495/56 |
Text MD5: | 5990a41946a84271e4c53701cff66543 |
Transpilation MD5: | 49715f027292ef5d84e00df3882104ec |
Author: | stefan |
Category: | |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-06-29 08:04:15 |
Source code size: | 2681 bytes / 54 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 423 / 35632 |
Version history: | 55 change(s) |
Referenced in: | [show references] |