Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Native Source for java.awt.Robot

I am trying to find the native implementations of Java Robot functions. I found the Windows implementation here. Where can I find the mac and linux versions. I'm mainly trying to find out what it's doing to see how I can implement this functionality myself in C++.

like image 906
Dave Avatar asked Feb 17 '13 03:02

Dave


People also ask

What is Java AWT Robot?

The Robot class in the Java AWT package is used to generate native system input events for the purposes of test automation, self-running demos, and other applications where control of the mouse and keyboard is needed. The primary purpose of Robot is to facilitate automated testing of Java platform implementations.

In which package Robot class is available?

Robot class is present in the AWT package of JDK. Step 1: MouseMove() method takes the x and y coordinates as its parameters robot.

What is VK in Robot class?

VK_META and META_MASK are defined in KeyEvent and InputEvent classes. They both define the META key as a standalone key pressed and as a modifier used pressing another key respectively. The META key is a key used in old keyboards and now can be emulated using the Windows Key.

What is the use of Robot class in selenium?

Robot Class in Selenium is used to enable automated testing for implementations of Java platform. It generates input events in native systems for test automation, self-running demos and other applications where users need control over mouse and keyboard.


2 Answers

Okay so I did some digging around and found what I was looking for. These may not be the latest versions but the metadata is there.

  • Linux: awt_robot.c
  • Mac: CRobot.m
  • Win: awt_robot.cpp
like image 124
Dave Avatar answered Sep 21 '22 06:09

Dave


The source code of this class seems having no any native methods, probably calls are delegated somewhere else. In any case, OpenJDK seems a proper place to search as this is a complete project and not just part that is written in Java.

like image 30
Audrius Meškauskas Avatar answered Sep 24 '22 06:09

Audrius Meškauskas