guix icon indicating copy to clipboard operation
guix copied to clipboard

How do I send different events after pressing a button?

Open Barfell opened this issue 3 years ago • 1 comments

How do I send different events after pressing a button? Different interfaces, the same buttons also have different functions and need to send different events. How to deal with this? the device no touch panel, only physical keys,

Barfell avatar Jun 26 '22 03:06 Barfell

The simplest way would be to change the button ID at runtime. We don't have an "id_set()" api, but nothing prevents you from doing something like this: button->gx_widget_id = USER_DEFINED_ID

The event generated by a button is always a combination of the widget ID and the event action, so this will change the event generated by the button.

jdeere5220 avatar Jun 27 '22 13:06 jdeere5220