onevent problem

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

onevent problem

Post by idiot » Sat Dec 31, 2011 5:46 am

ok basically what im trying to do is when i press "," key it holds down the "q" key and when i press the "." key it releases the "q" key
its the button i have assigned for my mic button im trying to have it hold down the "q" when i have pushed "," and then release when it detects me pressing "."

Code: Select all

label>start
OnEvent>KEY_DOWN,VK_OEM,187,KeyPress
OnEvent>KEY_DOWN,VK_OEM_PER,190,KeyPress1
srt>KeyPress
Let>VK_control=81
Let>ExtendedKey=1
Let>KeyUp=2
Let>FLAGS={%ExtendedKey% OR %KeyUp%}
LibFunc>user32.dll,keybd_event,r,VK_control,0,ExtendedKey,0

 
END>KeyPress
 srt>KeyPress1
 Let>VK_control=81
Let>ExtendedKey=1
Let>KeyUp=2
Let>FLAGS={%ExtendedKey% OR %KeyUp%}
LibFunc>user32.dll,keybd_event,r,VK_control,0,FLAGS,0
 END>KeyPress1
wait>1
goto>start

if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

Post by idiot » Sat Dec 31, 2011 6:27 am

this also did not work

Code: Select all

label>start
WaitKeyDown>,
Let>VK_control=81
Let>ExtendedKey=1
Let>KeyUp=2
Let>FLAGS={%ExtendedKey% OR %KeyUp%}
LibFunc>user32.dll,keybd_event,r,VK_control,0,ExtendedKey,0
WaitKeyDown>.
LibFunc>user32.dll,keybd_event,r,VK_control,0,FLAGS,0
goto>start

if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Sat Dec 31, 2011 6:35 am

Have not looked into the keybd_event function but this code will make the "." and "," onevents work.

Code: Select all

OnEvent>KEY_DOWN,VK188,0,KeyPress
OnEvent>KEY_DOWN,VK190,0,KeyPress1
srt>KeyPress
MDL>188
/*
Let>VK_control=81
Let>ExtendedKey=1
Let>KeyUp=2
Let>FLAGS={%ExtendedKey% OR %KeyUp%}
LibFunc>user32.dll,keybd_event,r,VK_control,0,ExtendedKey,0
*/

 
END>KeyPress
 srt>KeyPress1
 MDL>190
/*
 Let>VK_control=81
Let>ExtendedKey=1
Let>KeyUp=2
Let>FLAGS={%ExtendedKey% OR %KeyUp%}
LibFunc>user32.dll,keybd_event,r,VK_control,0,FLAGS,0
*/
 END>KeyPress1
 
label>start
wait>1
goto>start

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts