Page 1 of 1

how to solve double hit?

Posted: 28 Sep 2020, 05:19
by teamzhangmeng
hello,everyone!
This is my first Lua programme.when i press key once the result is double hit
how to solve double hit ? when i press key slowly,lua just excute one time
thank you~

lmc.minimizeToTray = true
lmc_minimize()
lmc_device_set_name('kb1','1EC44D52')
lmc_print_devices()
lmc_set_handler('kb1',function(button, direction)
if (button == 101) then lmc_send_keys('A')
end
end)

Re: how to solve double hit?

Posted: 29 Sep 2020, 07:34
by admin
Read this: https://github.com/me2d13/luamacros/wiki/Triggers
The callback is called once for key down event and second time for key up.