According to Martin’s comment in the firmware v4.1.0 thread
List of changes:
Added the ability to assign a presets’s custom Lua user functions to hardware buttons and knobs.
it seems possible to assign a Lua function to a hardware buttons.
I’ve searched the documentation and the forum but I can’t find how to actually do it.
My goal:
I would like to detect when specific hardware menu buttons are pressed (for example the bottom-right and middle-right menu buttons), while keeping their normal behaviour intact.
I do not want to replace or override their original function – just detect the press and run some Lua logic on top of it.
Questions:
Is there a supported way in firmware ≥ 4.1.0 to attach a Lua callback to a hardware button press?
If so, what is the correct Lua mechanism to bind a hardware button to a custom Lua function?
Can hardware button events be read without redefining their built-in behaviour?
Thanks a lot for any clarification!
Have a good day !
The binding of Lua functions works differently from what you would like to have. The preset developer can define up to 12 Lua functions that get displayed in the Preset Menu window (left swipe). Users can then:
fire them by tapping them when the Preset Menu is open.
use the Preset Menu window to assign these Lua functions to the hardware buttons, and then fire them by pressing the corresponding button
fire them by using the ALT + knob touch combo
I do not want to make it possible for a preset to change the function of the buttons without the user knowing it. It could become quite confusing very quickly.