# Snapping the mouse to the center of the window?

**URL:** <https://discourse.processing.org/t/snapping-the-mouse-to-the-center-of-the-window/23896>\
**Category:** Coding Questions\
**Created:** [September 16, 2020, 5:36pm UTC](https://discourse.processing.org/t/snapping-the-mouse-to-the-center-of-the-window/23896 "2020-09-16T17:36:48Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Hyperion65](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hyperion65/32/10569_2.png) [@Hyperion65](https://discourse.processing.org/u/Hyperion65)\
**Post date:** [September 18, 2020, 6:47am UTC](https://discourse.processing.org/t/snapping-the-mouse-to-the-center-of-the-window/23896/2 "2020-09-18T06:47:54Z")

</div>

hello, it sounds a little confusing. if you position the mouse in the center every frame it basically means that the mouse becomes unusable to you, no ? in that case, you could ignore mouseX and mouseY as a means of interaction and use noCursor() to hide it.

if you use the mouse as a navigational tool as is usual in FPS games, you might simply not show the cursor (tickling your avatar in the back) and use mouseX to turn him left and right.

however, for your question, maybe this will be interesting to you:

> [@getLocation() of the sketch](https://discourse.processing.org/t/getlocation-of-the-sketch/5763):
>
> I try to catch the location of my sketch, but I don’t find any option to do that like surface.setLocation(). Any idea which method can be used to catch the sketch position, like before getLocationOnScreen()

---

_[View the full topic](https://discourse.processing.org/t/snapping-the-mouse-to-the-center-of-the-window/23896)._
