# Simulate Mouse click and Key (Robot class)

**URL:** <https://discourse.processing.org/t/simulate-mouse-click-and-key-robot-class/27709>\
**Category:** Coding Questions\
**Created:** [February 10, 2021, 5:29pm UTC](https://discourse.processing.org/t/simulate-mouse-click-and-key-robot-class/27709 "2021-02-10T17:29:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarlo](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@amarlo](https://discourse.processing.org/u/amarlo)\
**Post date:** [February 10, 2021, 5:29pm UTC](https://discourse.processing.org/t/simulate-mouse-click-and-key-robot-class/27709/1 "2021-02-10T17:29:45Z")

</div>

Hello,  
I have found some information about simulate click mouse and simulate a keypressed using Robot library. I am using Processing 3 and I dont find this library. Please, can you tell me where to download and information about this simulates?  
thank you very much

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [February 10, 2021, 5:52pm UTC](https://discourse.processing.org/t/simulate-mouse-click-and-key-robot-class/27709/2 "2021-02-10T17:52:01Z")

</div>

I think that you mean the `java.awt.Robot` class. It is part of the Java programming language so to use it simply add this include statement at top of your sketch code.

`import java.awt.Robot;`

---

<div class="post-metadata">

**Author:** ![CodeMasterX](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/codemasterx/32/2942_2.png) [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Post date:** [February 10, 2021, 6:22pm UTC](https://discourse.processing.org/t/simulate-mouse-click-and-key-robot-class/27709/3 "2021-02-10T18:22:13Z")

</div>

@quark  
The library seems to be really interesting!  
However I can’t seem to get it working.

Would you mind pointing me towards a processing-friendly source for the robot library?  
Like how to create a screen capture program?

Thanks.

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [February 11, 2021, 8:57am UTC](https://discourse.processing.org/t/simulate-mouse-click-and-key-robot-class/27709/4 "2021-02-11T08:57:51Z")

</div>

> [@CodeMasterX](#):
>
> Would you mind pointing me towards a processing-friendly source for the robot library?

I would if I could but I have never used the Robot class in Processing, in fact I am not sure if I have ever used it. Several times I thought about using it to create a help//demo system for Processing sketches to promote my libraries but have never got round to it LOL.

Any way I have seen many references to the Robot class in this forum so if you search for “Robot class” from the main Processing website home page (not discourse) you get this [result]([https://robot](https://robot) class site:processing.org).

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 11, 2021, 12:24pm UTC](https://discourse.processing.org/t/simulate-mouse-click-and-key-robot-class/27709/5 "2021-02-11T12:24:30Z")

</div>

link [robot class site:processing.org - Google Search](https://www.google.com/search?q=robot+class+site%3Aprocessing.org)

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [February 11, 2021, 3:55pm UTC](https://discourse.processing.org/t/simulate-mouse-click-and-key-robot-class/27709/6 "2021-02-11T15:55:24Z")

</div>

[Forum.Processing.org/two/discussions/tagged/robot](http://Forum.Processing.org/two/discussions/tagged/robot)
