Prevent retrigger of screen touch

enonod

Well-Known Member
Licensed User
Longtime User
Holding the finger on the screen too long causes retrigger of this Touch code.
Can I do anything to accept only the first triggering please?
This acts a bit like the PC keyboard queue.
[Edit] Is there a queue I can empty at some point in the code?

B4X:
Sub pnl_Touch(Action As Int, X As Float, Y As Float)
Dim col,row As Byte
   If Action=0
      col=X/(kCellwh+1) : row=Y/(kCellwh+1)
      ...

   End If
End Sub
 
Last edited:

enonod

Well-Known Member
Licensed User
Longtime User
Seems that changing Action 0 Down to Action 1 Up has cured the problem, if anybody else experiences it.
 
Upvote 0

enonod

Well-Known Member
Licensed User
Longtime User
Thank you for that advice Erel.
Unfortunately what I thought was a solution was not.
I need help here. Whatever code runs as a result of the Touch runs multiple times, randomly, and is definitely due to recalling the Touch event due to either finger bounce or something.
I need a way to lock the Touch event until it is again required or something.
Can you help please?
 
Upvote 0

enonod

Well-Known Member
Licensed User
Longtime User
Thank you Erel, and I apologise because it should have been obvious to me.
I think I was blinded by the fact that this was an event, which of course makes no difference.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…