Wednesday, April 25th 2018, 6:33am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

entik

Beginner

Date of registration: Jun 10th 2016

Posts: 6

1

Monday, June 13th 2016, 9:39am

widget over widget touch events

Hi,
I would like to ask if there is any way how to prevent unwanted touch events when there is one widget over another, the top widget reacts on touch event by closing itself and the bottom widget still "receives" touch and fires its own event.
As an example, I have a bgr window with listview, and an error dialog with confirmation button. Something happens, I show the dialog and when the button is pressed, dialog is closed AND the item in the listview at the touch location is selected.
Basically I am looking for something similar to button widget's REACT_ON_LEVEL = 1 functionality for other widgets. In other words, touch should be processed only once. After it triggers some event on the dialog and that dialog is closed, it should not be processed any further until the touch is released.

Is there any way how to achieve this in emWin? I am not using emWin touch drivers, so touch events are passed to emWin by GUI_TOUCH_StoreStateEx. The behavior I described could be achieved by filtering the touch events on my side, but I would rather use some built-in principle if available.

Thanks
Petr

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 562

2

Friday, July 1st 2016, 4:25pm

Hi Petr,

I did a test and it worked flawless.

How do you react on the touch imput to close the top widget?

Do react just on WM_TOUCH or do differentiate between clicked and released.

I would suggest to react on released because after this event the shouldn't come any more touch events, so no more events which could be caught by the lower widget.

Regards,
Sven