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)

1  
scope robot_safetyKeyReleaser.
2  
3  
static int #interval = 30000;
4  
static Map<Int, Long> #keysPressed = syncMap();
5  
6  
static ReliableSingleThread #rst = rstWithDelay(interval+500, r doIt);
7  
8  
static ReliableSingleThread robot_safetyKeyReleaser() {
9  
  ret rst;
10  
}
11  
12  
svoid #doIt {
13  
  for (int key, long since : cloneMap(keysPressed)) {
14  
    if (elapsedMS(since) >= interval) {
15  
      print("WARNING: Robot safety release of key " + key);
16  
      robot_keyRelease(key);
17  
    }
18  
  }
19  
}
20  
21  
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: 371 / 421
Version history: 3 change(s)
Referenced in: [show references]