guix
guix copied to clipboard
How do I send different events after pressing a button?
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,
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.