Java Robot pressKeyCombo(Robot robot, int... codes)

Here you can find the source of pressKeyCombo(Robot robot, int... codes)

Description

press Key Combo

License

Open Source License

Declaration

public static void pressKeyCombo(Robot robot, int... codes) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.Robot;
import java.util.ArrayDeque;

import java.util.Deque;

public class Main {
    public static void pressKeyCombo(Robot robot, int... codes) {
        Deque<Integer> keyCodes = new ArrayDeque<Integer>();
        for (int code : codes) {
            robot.keyPress(code);//from w  ww. j a va 2  s . c o m
            keyCodes.push(code);
        }
        for (int key : keyCodes)
            robot.keyRelease(key);
    }
}

Related

  1. awtRobotKeyPress(final Robot robot, final int keyCode, final int msDelay)
  2. awtRobotKeyRelease(final Robot robot, final int keyCode, final int msDelay)
  3. keyPress(final int i, final Robot robot, final boolean press, final int keyCode, final int msDelay)
  4. keyPressWithCtrl(Robot r, int key)