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

21
LINES

< > BotCompany Repo | #1019921 // robot_safetyKeyReleaser (dev.)

JavaX fragment (include)

scope robot_safetyKeyReleaser.

static int #interval = 30000;
static Map<Int, Long> #keysPressed = syncMap();

static ReliableSingleThread #rst = rstWithDelay(interval+500, r doIt);

static ReliableSingleThread robot_safetyKeyReleaser() {
  ret rst;
}

svoid #doIt {
  for (int key, long since : cloneMap(keysPressed)) {
    if (elapsedMS(since) >= interval) {
      print("WARNING: Robot safety release of key " + key);
      robot_keyRelease(key);
    }
  }
}

end scope

download  show line numbers  debug dex  old transpilations   

Travelled to 11 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv

No comments. add comment

Snippet ID: #1019921
Snippet name: robot_safetyKeyReleaser (dev.)
Eternal ID of this version: #1019921/4
Text MD5: bdf705a878135a2f5fbeb6f0b6d3c620
Author: stefan
Category: javax / stefan's os
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-30 23:40:55
Source code size: 492 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 186 / 276
Version history: 3 change(s)
Referenced in: [show references]