Access to v3.7 "Alt" button event / state in LUA

(Splitting this feature discussion out of the original v3.7 firmware topic).

The idea is to provide access to the new “Alt” hardware button event and / or state (pressed or not) to a preset Lua script.

My own use case would be to need to hold down the Alt key whilst pressing the knob touch command combinations in my VCVRack preset (e.g. touching knobs 7,8,9 together navigates to a navigation page in the preset). This would hopefully largely prevent unwanted multi-touch actions from firing when you are just moving your fingers around the knobs. My LUA script could check the held-down state of the “alt” button in the onPotTouch() handler to know whether to process or discard the event.

This would require the users of the preset to configure an “alt” button on one of the hardware buttons. But no other “special” behaviour of the hardware buttons needed (to address @martin 's concerns, rightly, of changing expected hardware button behaviour).

The ALT + knob touch could fire a custom Lua callback indeed.

hmm, it could possibly show info about what functions are linked to each knob - in similar visual style as a page selection window. The names of the functions could be defined in Lua.

Would this work for you?

Hi, yes could do.

I have a lua function that is called from the onPotTouch callback

function executePotTouchActions(potId, controlId, touched)

It can handle any pot being touched (using the potId). It tracks how many pots are being currently touched in a global “potStatus” bitmap integer:

-- Calc Pot Status Value where Pot is represented by one bit and PotNr==Bit-Position
  local touchedPotId = 2 ^ potId
  if(touched)
    then
      -- set Bit on Position "PotNR" to 1
      potStatus = potStatus | touchedPotId
    else
      -- set Bit on Position "PotNR" to 0
      potStatus = potStatus & ( 4095  ~ touchedPotId )
  end

Then has a switching section depending on which combo of pots are being touched:

 -- Handle multi pot touch
  if (touched and isValidCombo(potStatus))
  then
    -- Place Actions which need multi pot Single Touch here -----------------------
    if(potStatus == 7) then pages.display(1) end -- Pots 1,2,3 touched
    if(potStatus == 14) then pages.display(2) end -- Pots 2,3,4 touched
 
    etc.......

This all working nicely … I just want to avoid unintentional pot touches … the E-1 pots are super sensitive! I would need to understand more of your idea I think as a replacement of this multi pot touch implementation. Do you mean something like (from users perspective):

  1. Press and hold “Alt” hardware button
  2. See a popup of names of touch actions available associated with each of the 12 pots
  3. Still holding down the Alt button, touch one of the pots , this will call the function callback I registered from the lua code for that pot ?
  4. Releasing the Alt button will close the popup.