So I'm very new to this, used Lua a little before years ago (can't remember any of it now though). I have written the following script:
Code: Select all
lmc_device_set_name('tablet', 'GDIX1001')
lmc_print_devices()
lmc_set_handler('tablet',function(button, direction)
if (button == 91) then print ('pressed')
end
end)
The code functions largely as expected; the list of devices has the correct device named "tablet", the callback catches the button press and prints "pressed" in the output window (although it is printed twice for each press; once for the down event and once for the up event?). However, the original keystroke is also still sent. I'm essentially trying to disable a particular key (Windows key on a tablet), while still allowing the key to function on other keyboards etc. But when I run the above script, the Windows key is still registering as being pressed (Start menu appears). How do I block this? What's wrong with my code?
Thanks.
EDIT: Upon further testing, I believe this issue may only apply to the Windows key. Using similar code with a different keyboard, I can block a button just fine:
Code: Select all
clear()
--lmc_device_set_name('tablet', 'GDIX1001')
lmc_assign_keyboard('tablet')
lmc_print_devices()
lmc_set_handler('tablet',string.byte('H'),1,function()
print ('pressed')
--end
end)
I have tested both pieces of code on both Windows 7 and 10, with the same results on each in both cases.