cancel
Showing results for 
Search instead for 
Did you mean: 

Program control reaching handleClickEvent, instead of handleDragEvent, upon drag action on touchscreen

kvkhekale
Associate II

Hello,

I am configuring ScrollWheel on touchgfx.

In order to select an option, I need to click on ScrollWheel.

In order to browse all the options, I need to drag on ScrollWheel.

So, I need both handleClickEvent() and handleDragEvent().

I also need to differentiate between a Click and a Drag action.

But, upon drag action, my program control goes in handleClickEvent() only.

It never reaches handleDragEvent() function.

Please suggest how can I detect Drag event?

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

Hi,

If you're debugging while trying to get both a click and a drag event you may run into some issues because you're releasing your mouse when you hit the first breakpoint.

The first event you'll get is a Click Event (PRESSED) then continuous drag events every tick with the delta for x and y, and then finally a Click Event (RELEASED) when releasing.

You could try printing things into the console rather than using breakpoints. You're doing it right, just overriding handleClick- and -Drag event methods.

/Martin

View solution in original post

5 REPLIES 5
Martin KJELDSEN
Chief III

Hi,

If you're debugging while trying to get both a click and a drag event you may run into some issues because you're releasing your mouse when you hit the first breakpoint.

The first event you'll get is a Click Event (PRESSED) then continuous drag events every tick with the delta for x and y, and then finally a Click Event (RELEASED) when releasing.

You could try printing things into the console rather than using breakpoints. You're doing it right, just overriding handleClick- and -Drag event methods.

/Martin

Thanks for your suggesstion.

I will try and let you know

Any update on this?

Yes.. It is indeed working as per your guess.

Its kind of difficult to trace the program flow in debug mode.

I did run the program and saw the output on the console.

It is reaching drag event handler as well

Thanks a lot!

No problem! :)