ImpulseAdventure / GUIslice

GUIslice drag & drop embedded GUI in C for touchscreen TFT on Arduino, Raspberry Pi, ARM, ESP8266 / ESP32 / M5stack using Adafruit-GFX / TFT_eSPI / UTFT / SDL
https://www.impulseadventure.com/elec/guislice-gui.html
MIT License
1.12k stars 204 forks source link

add glsc_EnTouch to enable/disable processing of touch events #529

Closed ilka-schulz closed 4 months ago

ilka-schulz commented 5 months ago

This PR implements the most basic feature asked for in #510: it adds a function to enable/disable the processing of touch events. Basically, the GUI becomes sensitive/insensitive for touch. This PR does not provide an interface to intercept and manipulate touch events. It enables/disables touch entirely.

All touch events during an insensitive period are discarded. They are not processed later.

Tested on my little project with ESP32, ILI9341, XPT2046: works exactly as expected.

As a side note: Thank you so much @ImpulseAdventure for providing this library. Implementing this feature was a piece of cake with the well-structured and DRY codebase which allows for a straight-forward implementation of new features. I was really expecting this task to consume much more time.

I am looking forward to feedback, this is my first contribution to a project running on embedded.

ImpulseAdventure commented 4 months ago

Thank you @ilka-schulz and great suggestion.

I'll aim to get your PR merged as soon as I have re-run the regressions. thx

tfischer4765 commented 3 months ago

Than you for your contribution! It is much appreciated. I will keep my feature request open nevertheless, because this patch unfortunately neither addresses my per-touch code execution need nor allows to decide on a per-touch basis whether or not any given touch event should be processed or not.