Handled flag?
Posted: 12 Apr 2017, 04:29
Is there any way of telling the callback that the current button/direction wasn't handled by the handler so that the button/direction doesn't get trapped but passed on? The way I'm handling it so far is as follows, but this does ignore direction and doesn't send the original button but the ASCII code of it.
lmc_set_handler('FootSwitch',function(button, direction)
_handled = 0
-- Optional code here (sets _handled to 1 if handled)
if (_handled == 0) then
print("Unassigned key: " .. button)
--lmc_send_keys(button, direction) -- Convert code to ASCII or, better still, just return the button/direction combination as unhandled!!!
end
end)
Would be nice if there was an optional flag handled that was part of function, i.e., function(button, direction, var handled = 1) defaulting to 1 to remain backwards compatible.
lmc_set_handler('FootSwitch',function(button, direction)
_handled = 0
-- Optional code here (sets _handled to 1 if handled)
if (_handled == 0) then
print("Unassigned key: " .. button)
--lmc_send_keys(button, direction) -- Convert code to ASCII or, better still, just return the button/direction combination as unhandled!!!
end
end)
Would be nice if there was an optional flag handled that was part of function, i.e., function(button, direction, var handled = 1) defaulting to 1 to remain backwards compatible.