how do you write If ButtonPress +Time Delay +Button Then statement

Announcements, questions
Post Reply
comet424
Posts: 10
Joined: 12 Feb 2019, 02:50

how do you write If ButtonPress +Time Delay +Button Then statement

Post by comet424 » 28 Sep 2021, 20:58

think i posted in the wrong general area.. but i wrote

hi i posted in another question about 0 and 00

but as they mentioned its just 0 pressed twice i guess internally

instead of breaking my button off my keypad

does lua macros offter a time delay??


so If Button 0 (pressed) + Delay (1ms) + Button 0 (pressed) then whatever i want

to simulate a 00 key.. does luamacros offter a If statement with Delay in it

admin
Site Admin
Posts: 725
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: how do you write If ButtonPress +Time Delay +Button Then statement

Post by admin » 29 Sep 2021, 08:19

You can check current time in lua (standard functions), store it on first press and check on second
Petr Medek
LUAmacros author

comet424
Posts: 10
Joined: 12 Feb 2019, 02:50

Re: how do you write If ButtonPress +Time Delay +Button Then statement

Post by comet424 » 29 Sep 2021, 14:11

ah ok how would i write that?
i dont know how to code lua macro or know what programing language lua macros uses to google it

so i want it to
do Press button wait 1millisecond or or so the button is pressed again... as i trying to make a double 00 button to be seperated

so i guess it press 0 twice so i need lua standard function time to read 1 millisecond or 40 or what not

how can i write that?
so far i have for 0
here is part of my code
-- 0 Button CTRL + X
if (button == 96) then
print (''.. config[button])
lmc_send_keys('^x', 50)
-- sendToAHK(config[button])

-- 00 Button
elseif (button ==) then
print (''.. config[button])
lmc_send_keys('^x', 50)


-- 1 Button SHIFT + L
elseif (button == 97) then
print (''.. config[button])
lmc_send_keys('+(l)', 50)


how can i write it in there standard function store it or can you send me sample page?

ross_CAL
Posts: 6
Joined: 13 Oct 2021, 06:36

Re: how do you write If ButtonPress +Time Delay +Button Then statement

Post by ross_CAL » 13 Oct 2021, 22:39

There is lmc_sleep(number in milliseconds)

Post Reply