# Mouse position is tracked beyond sketch window while dragging

**URL:** <https://discourse.processing.org/t/mouse-position-is-tracked-beyond-sketch-window-while-dragging/12283>\
**Category:** Coding Questions\
**Created:** [June 25, 2019, 1:23pm UTC](https://discourse.processing.org/t/mouse-position-is-tracked-beyond-sketch-window-while-dragging/12283 "2019-06-25T13:23:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gyula](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@gyula](https://discourse.processing.org/u/gyula)\
**Post date:** [June 25, 2019, 1:23pm UTC](https://discourse.processing.org/t/mouse-position-is-tracked-beyond-sketch-window-while-dragging/12283/1 "2019-06-25T13:23:21Z")

</div>

This is not a question but a statement.  
According to the reference, Processing can only track [mouseX](https://processing.org/reference/mouseX.html) and [mouseY](https://processing.org/reference/mouseY.html) when the pointer is over the current window. Once the mouse moves away from the window, _mouseX_ and _mouseY_ will continue to report their most recent position.  
I’ve found that while **dragging** away from the window, _mouseX_ and _mouseY_ will continue to report their **current** position.

This simple code can demonstrate the difference between moving away and dragging away from the window:

```auto
void draw() {
  background(204);
  line(width/2, height/2, mouseX, mouseY);
}

```
