!7 // fixes typing "|", "{", "[", "]" and "}" in VNC on German keyboard module VNCFixer > DynPrintLogAndEnabled { S computerID; transient new LS shouldSend; visualize { ret centerAndSouth(super.visualize(), withMargin(withLabel("Computer ID:", dm_fieldTextField('computerID)))); } start { dm_requireLinuxWindowList(); dm_vmBus_onMessage('keyUp, voidfunc(int keyCode, int modifiers) { if (nempty(shouldSend) && keyCode == 56) { // Alt+Gr released switch to q(); LS sending = getAndClearList(shouldSend); print("Sending " + sending + " to VNC"); for (S key : sending) dm_evalOnOtherMachine(computerID, "robot_pressAndRelease_" + key + "_englishLayout();"); } }); dm_vmBus_onMessage('keyDown_raw, voidfunc(final int rawCode, int modifiers) { if (enabled && isComputerID(computerID) && modifiers == 128) { //robot_keyRelease(KeyEvent.VK_ALT_GRAPH); // doesn't work, wait for modifier release instead switch to q(); S activeWindow = getString(first((L) dm_call(dm_linuxWindowList(), 'getData)), 'windowTitle); ret unless cic(activeWindow, "X desktop (smartbot."); if (rawCode == 124) shouldSend.add("vbar"); else if (rawCode == 123) shouldSend.add("openingCurlyBracket"); else if (rawCode == 125) shouldSend.add("closingCurlyBracket"); else if (rawCode == 91) shouldSend.add("openingSquareBracket"); else if (rawCode == 93) shouldSend.add("closingSquareBracket"); } }); } }