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

9
LINES

< > BotCompany Repo | #1010726 // automate_ctrlX

JavaX fragment (include)

static void automate_ctrlX(char c) {
  assertAutomationAllowed();
  int kc = KeyEvent.getExtendedKeyCodeForChar(Character.toLowerCase(c));
  if (kc == KeyEvent.VK_UNDEFINED) fail("" + c);
  awtRobot().keyPress(KeyEvent.VK_CONTROL);
  awtRobot().keyPress(kc);
  awtRobot().keyRelease(kc);
  awtRobot().keyRelease(KeyEvent.VK_CONTROL);
}

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: 540 / 557
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1010755 - automate_type
#1026857 - automate_ctrlPgDn - not working?