Repeat a keyboard command when a button is pressed
Moderators: Dorian (MJT support), JRL
Repeat a keyboard command when a button is pressed
I am trying to make a macro that will repeatedly hit CTRL X over and over when a button is held down, so far i took the macro i found in another post which works, however i cannot figure out where or how to make it so it will hold down ctrl when i press the key for the macro.
//Use Shift + Esc to close this macro
//F8 key = VK119
OnEvent>Key_Down,VK119,0,MainMacro
SRT>MainMacro
send>a
Wait>0.01
END>MainMacro
Label>IdleLoop
Wait>0.01
Goto>IdleLoop
//Use Shift + Esc to close this macro
//F8 key = VK119
OnEvent>Key_Down,VK119,0,MainMacro
SRT>MainMacro
send>a
Wait>0.01
END>MainMacro
Label>IdleLoop
Wait>0.01
Goto>IdleLoop
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Board is usually very active. But I have not seen this posting before. Don't understand the old date of original postings.
Cannot test now, but maybe modify SRT like this:
Cannot test now, but maybe modify SRT like this:
Code: Select all
SRT>MainMacro
SetFocus>WindowName*
MouseMove>x,y //x,y is cursor position before doing CTL-X if needed.
Press CTRL
Send>x
Release CTRL
Wait>0.01
END>MainMacro
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
well, that macro is what i've been trying to do, except i wanted it to hold ctrl and press x repeatedly when i hold down a key, then release ctrl when i stop pressing the key, i can get it to repeatedly press x, but not hold down ctrl, either way the reason i wanted it for a game i'm playing, however macro's do not effect the game for some reason, they only work in windows, regardless of full screen or windowed mode on the game. guess i'll just press the keys myself, its just a pain.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Hi,
You posted a question on Thursday and got a response on Sunday. Not bad for a peer to peer board IMO.
Anyway, this question has been asked before - search the forums for "Keybd_Event".
You posted a question on Thursday and got a response on Sunday. Not bad for a peer to peer board IMO.
Anyway, this question has been asked before - search the forums for "Keybd_Event".
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
right so, i've managed this, i know it does something, however not in the game i'm trying to get it to work in...
Code: Select all
SetFocus>Mount&Blade
OnEvent>Key_Down,VK119,0,start
srt>start
Press CTRL
Wait>0.01
Send>x
Wait>0.01
Release CTRL
Wait>0.01
end>start
Label>IdleLoop
Wait>0.01
Goto>IdleLoop
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Like I said. Search for "Keybd_Event".
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?