Triple tap / middle button

Probably a weird question. I didn't find answers...

Could a "triple tap / middle mouse button" event trigger something that can be caught and hooked in OctoPrint ?

Goal : show/hide a Marlin UI overlay transparent window by triple tapping a touch display ; for the current project I call "The OctoPrinter"
(Marlin UI overlay low level code does work, but needs a GPIO hardware button)

Note : I now know how to capture and grab HID events at low level (file system), but not how to forward these events back to the window manager. And it would be silly to do so. And probably extremely difficult to do (the main reason I ask this question :innocent: ).

Note2 : not a Python guy. Hardcore C/C++/Win32API guy inside. (this would be easy with Win32 ; pealse, no flame !)

You could probably do something like this, but it's all on the js/jinja template side since it has to happen in the UI...

Thanks for the answer.

Would mean adding such code to all jinja files ? But I posted too quickly, because I forgot about one very important "detail" : it has to be compatible with any GUI : including OctoDash.

A solution is getting the events directly from the OS (files in /dev/input)

For the record, two keywords in case someone reads this and needs to do something similar : "/dev/input " and "glob"

Many snippets on the web, in any langage. Here's a link for Python : Exploring /dev/input | The hacker Diary

Could probably be done from a bash script as well.

The funny thing is I did this for grabbing all events in order to prevent any action from the HIDs while not displaying OctoPrint (ioctl with EVIOCGRAB flag). Could also be interesting with a printer running unattented : one day an insect ruined a print : it landed on the touchscreen ! These OS features could make a "safety" plugin.

Was searching for some hook in OctoPrint while 75% of the needed code was already running for 2 weeks ; have to read events in a threaded loop, instead of just asking the app to block them. Learning Linux + too much information at once = stupid question. No thermal runaway protection enabled in my firmware, and used to another OS.