Feature Request: delay between keys

Announcements, questions
Post Reply
Buzzin
Posts: 8
Joined: 22 Dec 2015, 12:20

Feature Request: delay between keys

Post by Buzzin » 24 Dec 2015, 13:03

i try to make some really complex shortcut like
lmc_send_keys("%( )^(,){BACKSPACE}+()sw chro{ENTER}")

but it won't work every time
so can lmc send keys had another argument :delaytime between every keypress,so it will reduce mistake and give the app to reacting time

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

Re: Feature Request: delay between keys

Post by admin » 27 Dec 2015, 22:16

Could be done but such delays would block lua execution queue (this is separate thread).
I may put it on todo list but you need to remind me if you really need it :-)
Petr Medek
LUAmacros author

Glaived
Posts: 3
Joined: 04 Jul 2017, 16:43

Re: Feature Request: delay between keys

Post by Glaived » 04 Jul 2017, 16:56

admin wrote:Could be done but such delays would block lua execution queue (this is separate thread).
I may put it on todo list but you need to remind me if you really need it :-)
I really need this, example: On Rocket League, I can not open the chat > write> and ENTER because LUA macro written too fast for the game :/

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

Re: Feature Request: delay between keys

Post by admin » 12 Jul 2017, 21:45

Petr Medek
LUAmacros author

Pancake
Posts: 1
Joined: 12 Dec 2017, 02:10

Re: Feature Request: delay between keys

Post by Pancake » 12 Dec 2017, 02:19

Thank you for adding the sleep function! Maybe I'm just not sure how to use it for my purpose, but is it possible to send a keyboard combo with delay between each keystroke like the OP was asking?

For example

Code: Select all

lmc_send_keys('^ lmc_sleep(50) % lmc_sleep(50) {NUM3}')
Obviously that's not how you do it.. but is there a way to? Need slower key combos for OBS (Open Broadcaster Software) to pick up hotkeys coming from a second keyboard.

Basically would love the same functionality as

Code: Select all

HIDMacros.SendKeysSlow "^%c", 50
Excuse my noobishness.

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

Re: Feature Request: delay between keys

Post by admin » 12 Dec 2017, 09:05

lmc_sleep is built in command - similar as lmc_send_keys. So you need to use it at the same level, not inside the string argument.

You have 2 options:
1) yesterday I merged & released pull request that's adding delay argument to lmc_send_keys function. So after downloading new version you can try something like

Code: Select all

lmc_send_keys('^{NUM3}', 50)
I didn't test it myself but that how the PR was written
2) use "lower level" function for key sequence with delays between, something like

Code: Select all

lmc_send_input(16, 0, 0) -- press shift
lmc_sleep(50)
lmc_send_input(65, 0, 0) -- press A
lmc_sleep(50)
lmc_send_input(65, 0, 2) -- release A
lmc_send_input(16, 0, 2) -- release shift
See details here
Petr Medek
LUAmacros author

Post Reply