# How to fix button double click?

**URL:** <https://phaser.discourse.group/t/how-to-fix-button-double-click/4224>\
**Category:** Phaser 3\
**Created:** [November 11, 2019, 9:18am UTC](https://phaser.discourse.group/t/how-to-fix-button-double-click/4224 "2019-11-11T09:18:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Van\_Hu](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/van_hu/32/2178_2.png) [@Van\_Hu](https://phaser.discourse.group/u/Van_Hu)\
**Post date:** [November 11, 2019, 9:18am UTC](https://phaser.discourse.group/t/how-to-fix-button-double-click/4224/1 "2019-11-11T09:18:31Z")

</div>

![image](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/c/c1ff3542eccd9ef9e216769a176ab01926733e4e.png)

+) It catches the event clicked twice

---

<div class="post-metadata">

**Author:** ![tac](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/tac/32/2296_2.png) [@tac](https://phaser.discourse.group/u/tac)\
**Post date:** [November 11, 2019, 9:26am UTC](https://phaser.discourse.group/t/how-to-fix-button-double-click/4224/2 "2019-11-11T09:26:31Z")

</div>

```
	if(Phaser.Input.Keyboard.JustDown(this.X)){
		//do something
	}

```

or you can set a boolean and set to **true** if it’s already been clicked, once your process is finished, reset it to **false**

---

<div class="post-metadata">

**Author:** ![Van\_Hu](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/van_hu/32/2178_2.png) [@Van\_Hu](https://phaser.discourse.group/u/Van_Hu)\
**Post date:** [November 11, 2019, 9:28am UTC](https://phaser.discourse.group/t/how-to-fix-button-double-click/4224/3 "2019-11-11T09:28:56Z")

</div>

I’m new phaser 3, can you explain in detail for me?

Thanks tac !

---

<div class="post-metadata">

**Author:** ![tac](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/tac/32/2296_2.png) [@tac](https://phaser.discourse.group/u/tac)\
**Post date:** [November 11, 2019, 9:33am UTC](https://phaser.discourse.group/t/how-to-fix-button-double-click/4224/4 "2019-11-11T09:33:58Z")

</div>

**this.input.keyboard.on(‘some\_key’, function(event){** will fire as long as your finger is on the key (I found this out the hard way ☹ ). while on the contrary, **Keyboard.JustDown** only fires once

---

<div class="post-metadata">

**Author:** ![Van\_Hu](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/van_hu/32/2178_2.png) [@Van\_Hu](https://phaser.discourse.group/u/Van_Hu)\
**Post date:** [November 11, 2019, 10:12am UTC](https://phaser.discourse.group/t/how-to-fix-button-double-click/4224/5 "2019-11-11T10:12:54Z")

</div>

Thanks tac !

I still haven’t fixed the problem ☹

+) your suggestions are very good
