Great app! I also like the idea of moving to scripting language and getting rid of GUI - cleaner and more powerful. But to the question:
Using the code below when pressing 'a' on 'KBD2' keyboard I get 'axyz' while I would like to get 'xyz' only. How can I get rid of the "original" key character inserted before the LuaMacros defined characters?
Code: Select all
lmc_device_set_name('KBD2', '33B83F9D')
lmc_print_devices()
lmc_set_handler('KBD2',function(button, direction)
print('Callback for whole keyboard 2: button ' .. button .. ', direction '..direction)
if (direction == 0) then
if (button == string.byte('A')) then
print('a pressed')
lmc_send_keys('xyz')
end
end
end)
Code: Select all
KBD2 : \\?\HID#VID_413C&PID_2003#7&33B83F9D&0&0000#{884B96C3-56EF-11D1-BC8C-00A0C91405DD} [877594791] : keyboard
<unassigned> : \\?\HID#VID_413C&PID_2107#8&EB4CC40&0&0000#{884B96C3-56EF-11D1-BC8C-00A0C91405DD} [1624639279] : keyboard
Total number of devices: 2
Callback for whole keyboard 2: button 65, direction 1
Callback for whole keyboard 2: button 65, direction 0
a pressed
Michal,