// returns true if success static bool reactToWindowsKeyOpt(final Runnable r) { new Android3 a; a.startPort = 4989; a.useMultiPort = false; // We want the real port! a.responder = makeResponder(new O { S answer(S s) { new Matches m; if "windows key pressed" r.run(); null; } }); makeBot(a); if (a.port == a.startPort) { print("Windows key assigned."); true; } a.dispose(); print("Could not assign Windows key (port " + a.startPort + " taken)"); false; }