AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Can 'SendInput' send the same key as "Hotkey"??

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
jdpallace
Guest





PostPosted: Fri Mar 12, 2010 7:19 pm    Post subject: Can 'SendInput' send the same key as "Hotkey"?? Reply with quote

I searched through the Help doc. and in the forums but couldn't find exactly what I'm looking for, so here goes.

Code:
^3:: 
SendInput, {LCtrl}3
Sleep, 1000
SendInput, 1
Sleep, 800
SendInput, 2
Return
F2:: 
SendInput, {F2}
Sleep, 1000
SendInput, 1
Sleep, 800
SendInput, 2
Return
x:: 
SendInput, x
Sleep, 1000
SendInput, 2
Sleep, 800
SendInput, 3
Return


As per the title, can you 'SendInput' the same key as is your "Hotkey" for said command?? (See the Examples above)

And also is the terminology correct for "SendInput-ing" the "F" keys and "Control" keys above??

As always thanks for your help.
Back to top
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Fri Mar 12, 2010 7:22 pm    Post subject: Reply with quote

You should use the $ modifier for hotkeys that Send themselves. See the table of modifiers.
Back to top
View user's profile Send private message Visit poster's website
geekdude



Joined: 23 Nov 2009
Posts: 64

PostPosted: Fri Mar 12, 2010 8:00 pm    Post subject: Reply with quote

it seems that you could use the "~" modifier which is used to stop it from blocking the key in the first place. if you use it, you can omit the first sendinput line completely

Code:
~^3::
Sleep, 1000
SendInput, 1
Sleep, 800
SendInput, 2
Return
~F2::
Sleep, 1000
SendInput, 1
Sleep, 800
SendInput, 2
Return
~x::
Sleep, 1000
SendInput, 2
Sleep, 800
SendInput, 3
Return

_________________
  /\ /\ This is Kitty
(>';'<) Cut, copy, and paste kitty onto your sig.
((")(")) Help Kitty gain World Domination.

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group