# Canvas detect hold sprite (Not drag)

**URL:** <https://community.thunkable.com/t/canvas-detect-hold-sprite-not-drag/1005407>\
**Category:** Questions about Thunkable X\
**Tags:** help\
**Created:** [November 28, 2020, 2:43pm UTC](https://community.thunkable.com/t/canvas-detect-hold-sprite-not-drag/1005407 "2020-11-28T14:43:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![marine.bocquetpncnj](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@marine.bocquetpncnj](https://community.thunkable.com/u/marine.bocquetpncnj)\
**Post date:** [November 28, 2020, 2:43pm UTC](https://community.thunkable.com/t/canvas-detect-hold-sprite-not-drag/1005407/1 "2020-11-28T14:43:37Z")

</div>

Hello, I need some help

I’m trying to make a canvas game, with sprites to serve as buttons to move the character  
I would like to be able to detect when I release the sprite and when I hold them (but without dragging).

In short: if I tap the sprite-button the character does one step, but if I hold the sprite-button it keep going until I let go of the sprite-button.

I tried looking up google, the best I could find was this:

> [@Canvas and Stage Settings](http://community.thunkable.com/t/canvas-and-stage-settings/737673/8):
>
> If you use a loop forever, it will follow the pointer. You want it to go after the user lifts their finger, right? Going back to what actech said, you can then compare the X&Y of the last pointer position and if it has been that for x time then you can delete it. It may be incorrect to put the X to X check there, I’m still testing really. But do you see the direction of my thinking?

But it doesn’t work because it doesn’t detect the release of the sprite, it just allow me to check if the character is moving a few moments after clicking it, and if it is, to stop it. This does not work for me at all.

I’ve also found a post here named “Canvas and sprites release done?” (I can’t link it, I’m limited to 2 links)

Apparently Thunkable was supposed to have blocks for exactly what I want? But they were never released, looking at this post date.

This is my project so far:  
[https://x.thunkable.com/projectPage/5fb8f7186d856500111b81d1](https://x.thunkable.com/projectPage/5fb8f7186d856500111b81d1)

So yeah, anyone know a working solution?  
thanks in advance.

---

<div class="post-metadata">

**Author:** ![gm\_shack](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@gm\_shack](https://community.thunkable.com/u/gm_shack)\
**Post date:** [November 28, 2020, 3:15pm UTC](https://community.thunkable.com/t/canvas-detect-hold-sprite-not-drag/1005407/3 "2020-11-28T15:15:07Z")

</div>

Hi @marine.bocquetpncnj, I saw your project, I live tested the app on my phone, you can try gyroscopic sensor if you want i have a piece of code,I’ll send it in two minutes

---

<div class="post-metadata">

**Author:** ![gm\_shack](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@gm\_shack](https://community.thunkable.com/u/gm_shack)\
**Post date:** [November 28, 2020, 3:17pm UTC](https://community.thunkable.com/t/canvas-detect-hold-sprite-not-drag/1005407/4 "2020-11-28T15:17:24Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/9/7994bf984aec21d4f51876a2bd254c6e0122c622.png)  
you can try this instead of clicking buttons for changing the x-axis and y-axis, instead of ball you can put that sprite character, I hope this solved your problem

Thanks 😀

---

<div class="post-metadata">

**Author:** ![marine.bocquetpncnj](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@marine.bocquetpncnj](https://community.thunkable.com/u/marine.bocquetpncnj)\
**Post date:** [November 28, 2020, 6:15pm UTC](https://community.thunkable.com/t/canvas-detect-hold-sprite-not-drag/1005407/5 "2020-11-28T18:15:38Z")

</div>

Hey,  
thanks a lot for the answer, but while this does work, it doesn’t do what I want/need

I know there are other ways to do this, with accelerometer, or even with buttons that aren’t on the canvas  
But I would really like to know if there is a solution to do this entirely inside the canvas  
Aside from doing it for myself, I figure it would be very very useful for a lot of other things  
And the detection of touch-up is such a basic thing, I don’t even understand why Thunkable doesn’t already have it?

But thanks anyway, it was nice of you to help 😃

---

<div class="post-metadata">

**Author:** ![gm\_shack](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@gm\_shack](https://community.thunkable.com/u/gm_shack)\
**Post date:** [November 29, 2020, 3:44am UTC](https://community.thunkable.com/t/canvas-detect-hold-sprite-not-drag/1005407/6 "2020-11-29T03:44:27Z")

</div>

> [@marine.bocquetpncnj](#):
>
> But thanks anyway, it was nice of you to help 😃

Sure, feel free to ask anything to me by mentioning me if you have any question, I’ll be more than happy to answer

Thanks 😀 🙂

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 12:20pm UTC](https://community.thunkable.com/t/canvas-detect-hold-sprite-not-drag/1005407/7 "2024-11-08T12:20:07Z")

</div>


