!7 cmodule KeyMouseRobot > DynPrintLog { switchable int port = 8084; start-thread { startDialogServer(port, new DialogHandler { public void run(DialogIO io) { while (io.isStillConnected()) { if (io.waitForLine()) { String line = io.readLineNoBlock(); print(line); if (eq(line, "bye")) ret with io.sendLine("bye stranger"); try { S answer = answer(line); io.sendLine(str(answer)); } catch print e { io.sendLine(str(e)); } } } } }); ownResource(startDialogServer_serverSocket); startDialogServer_serverSocket = null; print("Listening to socket port " + port); } S answer(S s) { new Matches m; if (swic_trim(s, "mouseWheel ", m)) { awtRobot().mouseWheel(parseInt(m.rest())); ret "OK"; } null; } }