# Key and mouse pressed with boolean

**URL:** https://discourse.processing.org/t/key-and-mouse-pressed-with-boolean/15274
**Category:** Coding Questions
**Created:** [November 6, 2019, 9:57am UTC](https://discourse.processing.org/t/key-and-mouse-pressed-with-boolean/15274 "2019-11-06T09:57:52Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![vincentstrebelle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/vincentstrebelle/32/6963_2.png) [@vincentstrebelle](https://discourse.processing.org/u/vincentstrebelle)
#### Post date: [November 6, 2019, 10:37am UTC](https://discourse.processing.org/t/key-and-mouse-pressed-with-boolean/15274/3 "2019-11-06T10:37:44Z")

</div>

a: yes sorry about that  
b: what do you mean by no answer ? it’s not possible ?  
c: sorry again, if i must, i will delete this post

> [@kll](#):
>
> but there is no key code i can see?

What do you mean ?

d: well i’m looking for a way to make a boolean act like rightClick++;

e: i use this code because i code in java with eclipse and it’s the only one working, [https://discourse.processing.org/t/keypressed-and-keyreleased-with-java-eclipse/12994/16](https://discourse.processing.org/t/keypressed-and-keyreleased-with-java-eclipse/12994/16), you gave me this solution and it’s work great.

So my question is: Is there a way, with the code i post, to use a boolean and it act like this:  
when i press a mouse button, the boolean is set to true and then it’s set to false before i release the mouse button.

---

_[View the full topic](https://discourse.processing.org/t/key-and-mouse-pressed-with-boolean/15274)._
