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

9
LINES

< > BotCompany Repo | #1010726 // automate_ctrlX

JavaX fragment (include)

1  
static void automate_ctrlX(char c) {
2  
  assertAutomationAllowed();
3  
  int kc = KeyEvent.getExtendedKeyCodeForChar(Character.toLowerCase(c));
4  
  if (kc == KeyEvent.VK_UNDEFINED) fail("" + c);
5  
  awtRobot().keyPress(KeyEvent.VK_CONTROL);
6  
  awtRobot().keyPress(kc);
7  
  awtRobot().keyRelease(kc);
8  
  awtRobot().keyRelease(KeyEvent.VK_CONTROL);
9  
}

Author comment

Began life as a copy of #1010725

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1010726
Snippet name: automate_ctrlX
Eternal ID of this version: #1010726/2
Text MD5: e193a54bdeb27333a82400e36cb267cd
Author: stefan
Category: javax / automation
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-28 10:37:12
Source code size: 343 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 539 / 557
Version history: 1 change(s)
Referenced in: [show references]