Questions tagged [awtrobot]

The Robot class (java.awt.Robot) is used to programmatically trigger input events such as key press events and mouse actions & can also perform screenshot capture.

The Robot class (java.awt.Robot) is used to programmatically trigger input events, such as key press events and mouse actions & can also perform capture.

For Example:

Example of Java Robot Programming

662 questions
0
votes
0 answers

Robot keyPress pulses and does not give consistent press

In Processing I am using a Java Robot class in my processing script to press keys for a game. In whatever way I use it, the key press flashes and pulses unsteadily for whatever duration I've told it to press, thus pressing A in an emulated game four…
Ty Underwood
  • 897
  • 1
  • 6
  • 9
0
votes
0 answers

Hold key down for a certain amount of time with Robot

I want to hold down a key for a certain amount of time using the Java Robot. I have read other similar threads, but none of them work. Repeatedly pressing the key will only result in the key not releasing. Here's my code so far (it does not work…
Ewen W.
  • 199
  • 1
  • 8
0
votes
1 answer

How to make Java Robot hold down a key?

I want to hold down a key for a certain amount of time using the Java robot. I have read other similar threads, but none of them work. Repeatedly pressing the key will only result in the key not releasing. Here's my code so far (It does not work…
Ewen W.
  • 199
  • 1
  • 8
0
votes
1 answer

Robot to hold multiple key down using Java

I'm trying to build some robot class in JAVA. I need to robot hold 3 keys at the same time -> (CTRL + SHIFT + DELETE) I have to achieve this beacuse this accelerator opens a new windows and saves a lot of time. Here is my code below: Robot robot =…
Ertuğrul Çetin
  • 5,131
  • 5
  • 37
  • 76
0
votes
0 answers

Sending keyevents to java.awt.Robot via text file

I'm using java.awt.Robot I was wondering if it is possible for java to scan a constantly updating log.txt file and output those key events to an external program. example: if text.txt has the string "up" within it, java.awt.Robot will output this…
0
votes
0 answers

Robot.Delay(ms) freezes my application - Java

I have been trying to delay a simple piece of code in Java for a while, unfortunately if use a thread then the following code will not work as it is apart of the thread and i get lots of exceptions. I am trying to delay another way like this: …
user2826304
  • 97
  • 1
  • 2
  • 10
0
votes
1 answer

Taking screenshots in headless Linux environment possible?

I am working on a project on the comparatively slow Raspberry Pi system. I run the rpix86 DOS emulator in basic console mode (without X!) to maximize its speed. I need to take screenshots (640x480) from it. My java implementation throws…
Theo H.
  • 141
  • 1
  • 3
  • 8
0
votes
2 answers

Java awt Robot still cant press non-numpad arrows on windows?

This bug is known for years, yet is is still present in Java 1.7.0_25 version which I'm using on Windows 8. The following result are same regardless of wether i have numlock turned on or not: Robot bot = new Robot(); bot.keyPress(KeyEvent.VK_UP);…
kajacx
  • 12,361
  • 5
  • 43
  • 70
0
votes
1 answer

Java mouse controller

I have made an application which control my mouse coordinate on screen with the usual Robot mouseControler ; try { mouseControler = new Robot(); } catch (AWTException e)…
Orion
  • 301
  • 3
  • 12
0
votes
0 answers

Using the robot class in an if statement

Hi im creating a game accessibility app which will take mouse input and convert it to arrow key press. I have a window split up into 4 sections and it prints out which sector the mouse is in now what i would like to do is take one of these …
0
votes
2 answers

Robot Keypress for the "control" key on mac

Can anyone tell me what the Robot Keypress is for the "control" key on mac? I've tried VK_Control, VK_META, CTRL_MASK and CTRL_DOWN_MASK still nothing. Please note: Its the only control key on mac next to the "fn" key lefthand side. Not option or…
Laser Hawk
  • 1,988
  • 2
  • 23
  • 29
0
votes
1 answer

How to get RGB value from the returned value of the method com.sun.glass.ui.Robot.getPixelColor()?

I am trying to get the pixel colour below the mouse cursor in JavaFX. Since AWT Robot is having issue with JavaFX in Mac OS, I am planning to use com.sun.glass.ui.Robot.getPixelColor(). This method com.sun.glass.ui.Robot.getPixelColor() is found to…
Angom
  • 721
  • 1
  • 11
  • 27
0
votes
3 answers

Java robot keyboard

I am trying to make a application in Java, where you can control someones keyboard from a distance, but I am facing a problem. I thought something like this would be possible: //the message is the key input String[] parts =…
user2988879
  • 379
  • 2
  • 6
  • 18
0
votes
3 answers

Java Robot: Repeating every 30 minutes

What I want to do is run this bot every 30 minutes. What it does it take a screenshot so that I can look at things. I tried using thread.sleep(); But that wasn't working for me. I set it to some small interval to see if it would actually work,…
0
votes
1 answer

Change the theme of computer while taking robot screenshot

I want to take continuos screenshots using robot and transfer it to the other computer.I am using socket for transfereing images.But it is very slow.So i want to reduce the quality and size of the images.So Like teamviewer while taking screenshots…
Raja
  • 239
  • 1
  • 5
  • 18