# mousePressed always true

**URL:** <https://discourse.processing.org/t/mousepressed-always-true/5594>\
**Category:** Beginners\
**Created:** [November 16, 2018, 11:27am UTC](https://discourse.processing.org/t/mousepressed-always-true/5594 "2018-11-16T11:27:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FerrariLuigi](https://avatars.discourse-cdn.com/v4/letter/f/5f8ce5/32.png) [@FerrariLuigi](https://discourse.processing.org/u/FerrariLuigi)\
**Post date:** [November 16, 2018, 11:27am UTC](https://discourse.processing.org/t/mousepressed-always-true/5594/1 "2018-11-16T11:27:22Z")

</div>

Dear all  
I developed a Processing sketch that handle mouse and its buttons.  
It works but, after a while, the mousePressed attribute becomes always true.  
Did you have any similar problem ?  
How did you fix it ?  
Thank you very much for your help and ooperation  
regards

---

<div class="post-metadata">

**Author:** ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)\
**Post date:** [November 16, 2018, 6:32pm UTC](https://discourse.processing.org/t/mousepressed-always-true/5594/2 "2018-11-16T18:32:42Z")

</div>

I have never heard of this problem before. Are you trying to use the boolean value of `mousepressed` inside the mousePressed()` function? Are you assigning a value to mousepressed somewhere? Those are just a couple of thinks that might be the issue. Without seeing some code that demonstrates the problem, we’re at a loss.

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [November 16, 2018, 9:37pm UTC](https://discourse.processing.org/t/mousepressed-always-true/5594/3 "2018-11-16T21:37:53Z")

</div>

Can you please post your code in the form of a [MCVE](https://stackoverflow.com/help/mcve)?

More info here:

> [@Guidelines—Asking Questions](https://discourse.processing.org/t/guidelines-tips-on-asking-questions/2147):
>
> Summary (TL;DR) Ask complete questions to get better answers! Be specific. For example: I want to load an image. I tried using createImg() , and I expected the image to be on canvas, but what happened instead was the image showing up below the canvas. Isolate your problem and work in small steps. Share only the code directly related to your problem if it is part of a bigger project, and if something isn’t working, try the smallest code that could do the thing you want. Can we run your code to …
