Here you can find the source of keyPressWithCtrl(Robot r, int key)
public static void keyPressWithCtrl(Robot r, int key)
//package com.java2s; //License from project: Open Source License import java.awt.*; import java.awt.event.KeyEvent; public class Main { public static void keyPressWithCtrl(Robot r, int key) { if (r == null) { return; }//from ww w .j ava2 s.c o m r.keyPress(KeyEvent.VK_CONTROL); r.keyPress(key); r.keyRelease(key); r.keyRelease(KeyEvent.VK_CONTROL); r.delay(100); } }