I have a game device. I'm trying to map one of it's buttons to keyboard button 'b'. So far, this of course works.
However, the game distinguishes between a "click" (just key down and then immediately up) and a "long press" (key down, wait for 500+ms, key up*).
lmc_send_keys() cannot of course do this, but then I found out about lmc_send_keys(). But I can't make it work.
I've tried these approaches:
Code: Select all
if (direction == 0) and (button == 19) then lmc_send_input(66,0,2) end
if (direction == 1) and (button == 19) then lmc_send_input(66,0,0) end
Code: Select all
if (button == 19) then
if (direction == 1) then
timer19 = ts
elseif (direction == 0) then
pressed19 = ts - timer19
lmc_send_input(66,0,0)
lmc_sleep(pressed19)
lmc_send_input(66,0,2)
end
end
I've also contemplated on using two different keys and just sending the same event, but the other with a pause, but that doesn't work either. Like this:
Code: Select all
if (button == 19) then lmc_send_keys('b') end
if (button == 20) then
lmc_send_input(66,0,0)
lmc_sleep(1000)
lmc_send_input(66,0,2)
end
ps. The game in question is Star Citizen, can it just somehow be incompatible with lmc_send_input()?