# Noob need to record mouse when on another window

**URL:** https://discourse.processing.org/t/noob-need-to-record-mouse-when-on-another-window/10009
**Category:** Coding Questions
**Created:** [April 5, 2019, 5:52pm UTC](https://discourse.processing.org/t/noob-need-to-record-mouse-when-on-another-window/10009 "2019-04-05T17:52:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Coriandre](https://avatars.discourse-cdn.com/v4/letter/c/ecb155/32.png) [@Coriandre](https://discourse.processing.org/u/Coriandre)
#### Post date: [April 5, 2019, 5:52pm UTC](https://discourse.processing.org/t/noob-need-to-record-mouse-when-on-another-window/10009/1 "2019-04-05T17:52:29Z")

</div>

Hi!

I would like to record the mouse’s mouvement when working on a software like photoshop.

The code below is perfect but how to use it when the mouse is on another window ?

```auto
void setup() {
  size(640, 360);
  background(102);
}

void draw() {
  stroke(255);
  if (mousePressed == true) {
    line(mouseX, mouseY, pmouseX, pmouseY);
  }
}

```

Hope we can find a solution !  
I have never use code before beware !

---

<div class="post-metadata">

### Author: ![zenemig](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/zenemig/32/4418_2.png) [@zenemig](https://discourse.processing.org/u/zenemig)
#### Post date: [April 5, 2019, 7:15pm UTC](https://discourse.processing.org/t/noob-need-to-record-mouse-when-on-another-window/10009/2 "2019-04-05T19:15:10Z")

</div>

Hi, you will need to use some extra Java functions.

Maybe you can look at this:  
[https://forum.processing.org/one/topic/global-mouse.html](https://forum.processing.org/one/topic/global-mouse.html)

And this:

> <https://gist.github.com/colinowens/3816229>
