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.
Handled flag?
Re: Handled flag?
There is no way.
Blocking original key is kind of windows hack when message queue for active process is in fact stopped until LuaMacros tells whether key should be passed or not. So far it's decided only by macro presence so queue is unblocked quite quickly and LUA code is executed afterwards.
I don't want to move this responsibility (possibility to block active app) to LUA code which can contain anything..
Blocking original key is kind of windows hack when message queue for active process is in fact stopped until LuaMacros tells whether key should be passed or not. So far it's decided only by macro presence so queue is unblocked quite quickly and LUA code is executed afterwards.
I don't want to move this responsibility (possibility to block active app) to LUA code which can contain anything..
Petr Medek
LUAmacros author
LUAmacros author