Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

22
LINES

< > BotCompany Repo | #1003542 // reactToWindowsKeyOpt

JavaX fragment (include)

// 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;
}

Author comment

Began life as a copy of #1003539

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1003542
Snippet name: reactToWindowsKeyOpt
Eternal ID of this version: #1003542/1
Text MD5: b037e3890159796d8c36b7d5db688fda
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-07-17 17:51:44
Source code size: 540 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 533 / 593
Referenced in: [show references]