Skip to main content
kvkhekale
Associate III
March 14, 2019
Solved

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

  • March 14, 2019
  • 1 reply
  • 2563 views

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?

This topic has been closed for replies.
Best answer by Martin KJELDSEN

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

1 reply

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
March 14, 2019

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

kvkhekale
kvkhekaleAuthor
Associate III
March 15, 2019

Thanks for your suggesstion.

I will try and let you know

Martin KJELDSEN
Principal III
April 3, 2019

Any update on this?