Wednesday, April 25th 2018, 6:24am 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.



Date of registration: Sep 11th 2014

Posts: 67


Tuesday, February 27th 2018, 1:45pm

nearest widget touch?

Touch screen is working well if a touch is done inside the widget area.
I wonder if it is possible to have a touch event if the touch is near the widget, so if user touches the screen, a touch event will be triggered for the nearest widget.
Is this possible?

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 562


Wednesday, February 28th 2018, 11:09am


I could catch the touch input from the parent and route it to the widget which is the nearest.

Take a look into the example I have attached. I catch the touch input in the callback of the desktop window and check if it close enough to a widget. If it is I pass the touch message to the widget.

But be aware of the fact that this might not work reliable because different widgets react differently on touch input. For the BUTTON it works quite well but it is not possible to place the cursor of an EDIT widget using this method.

SEGGER - Schoenen has attached the following file:



Date of registration: Sep 11th 2014

Posts: 67


Thursday, March 1st 2018, 6:49am

Thanks, I will give it a try.