Hello lidders,
Not shure if I`ve understood right - maby that will help.
My situation I managed this way: I collect nummeric-keys - but only whether ctr, alt nor shift is pressed.
So you can adapt the if clause...
But - this works only, if your pad sends each key (luamacros must see the keys (eg. ctr down/up f1 down/up , maybe ctr down, f1 down/up, ctr up)
Salutation
Thomas
-------- get the state of ctr-key (once...)
---------- (do the same block for the other key (alt/shift))
if (button==17) then -- Ctrl
if (ctrlpressed==1) then
if (direction==0) then
ctrlpressed=0
print('Switch-Ctrl to '..ctrlpressed)
end
else
if (direction==1) then
ctrlpressed=1
print('Switch-Ctrl to '..ctrlpressed)
end
end
return
end
------ then (only for down-key-press) - check, whether ctr/etc. is still pressed..
------ in the rest you are probably not interessed (I do collect the key 0 to 9 in `sometext` ) and go on with that value when I press TAB...
if (direction==1) then
if((altpressed + ctrlpressed + shiftpressed) == 0) then
--- do whathever you like...
if (button>=48) then
if (button<=57) then
value=''..button-48
sometext = sometext..value
return
end
end
end
print('Button: '..button)
end