# How to detect click event for Canvas component?

**URL:** <https://community.thunkable.com/t/how-to-detect-click-event-for-canvas-component/3133550>\
**Category:** Canvas / Gaming\
**Created:** [August 9, 2024, 12:22pm UTC](https://community.thunkable.com/t/how-to-detect-click-event-for-canvas-component/3133550 "2024-08-09T12:22:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![preetimomayaknbghw](https://avatars.discourse-cdn.com/v4/letter/p/a9adbd/32.png) [@preetimomayaknbghw](https://community.thunkable.com/u/preetimomayaknbghw)\
**Post date:** [August 9, 2024, 12:22pm UTC](https://community.thunkable.com/t/how-to-detect-click-event-for-canvas-component/3133550/1 "2024-08-09T12:22:18Z")

</div>

I am making a smash the mole game in Thunkable. I have added a canvas and a mole sprite which is moving randomly on the canvas.  
If i am able to click the mole my Hit count increases but if i miss the mole that is i click on canvas, my miss count will increase.  
Please help me how to track Canvas click event?

---

<div class="post-metadata">

**Author:** ![matt\_conroy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/matt_conroy/32/150843_2.png) [@matt\_conroy](https://community.thunkable.com/u/matt_conroy)\
**Post date:** [August 9, 2024, 3:09pm UTC](https://community.thunkable.com/t/how-to-detect-click-event-for-canvas-component/3133550/2 "2024-08-09T15:09:19Z")

</div>

Hi preetimomayaknbghw, welcome to Thunkable! 🎉

Be sure to check out [How to ask Great Questions v2.0](https://community.thunkable.com/t/how-to-ask-great-questions-v2-0/2689983/1), the [Community Guidelines](https://community.thunkable.com/t/community-guidelines/78/8), and our [Getting Started Guide](https://docs.thunkable.com/getting-started/get-started) to make the best of your Thunkable Community experience!

It sounds like you are referring to the `when canvas touched` block, which is the event block for when a user clicks on the canvas.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/f/4fc4c3172eec93e841a993616878a7f70e8a74f4.png)

> **[Events | Thunkable Docs](https://docs.thunkable.com/gaming/gaming-blocks/events#when-canvas-touched)**
>
> Events Blocks: Blocks that program the canvas to respond

---

<div class="post-metadata">

**Author:** ![preetimomayaknbghw](https://avatars.discourse-cdn.com/v4/letter/p/a9adbd/32.png) [@preetimomayaknbghw](https://community.thunkable.com/u/preetimomayaknbghw)\
**Post date:** [August 10, 2024, 7:52am UTC](https://community.thunkable.com/t/how-to-detect-click-event-for-canvas-component/3133550/3 "2024-08-10T07:52:31Z")

</div>

Thanks for the reply.  
But, if my sprite is moving on the canvas and I clicked on the sprite then both the following events are triggered:

1. When Sprite clicked
2. When Pointer is down on Canvas  
If need to capture both the events separately, how can I do that?
