Hi forum,
I can't believe myself, I've been searching Autohotkey help and the web for like half an hour, but I can't seem to find the explanation what syntax has to be used to send an arbitrary key combination.
For example, I want to send the combination of Left Control and left Windows Key if a certain key is pressed.
So please, where in the help file is the general description of how to send key combinations?
Press key combination
Re: Press key combination
Hotkeys, KeyList & Remap
eg from Helpfile
eg from Helpfile
Code: Select all
XButton2::^LButton ;Makes the fifth mouse button (XButton2) produce Control-LeftClick.
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Re: Press key combination
Thanks, but I'm looking for the general case, not the Ctrl/Shift/Alt prefixes.
For example, I want to send the combination of Left Control and left Windows Key if a certain key is pressed.
Re: Press key combination
then use Send command
look it and read it in the help file, you'll find what you need
look it and read it in the help file, you'll find what you need
Re: Press key combination
Sorry but I can't find anything in the helpfile as I said, also not on the "send" page of it.
Re: Press key combination
Send
What is in your example "a certain key"???
Did you mean "press any key" or a special key like "K" on your keyboard?
Code: Select all
{LControl} or {LCtrl} ; Left CONTROL key (technical info: sends the left virtual key rather than the neutral one)
{LWin} ; Left Windows key[
Did you mean "press any key" or a special key like "K" on your keyboard?
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Re: Press key combination
Check this
Change the key "a" for the key you need.
Greetings.
Code: Select all
return
a::
Send {LControl}{LWin}
return
Greetings.
Everything is possible!
Re: Press key combination
I think the example of LControl and LWin has confused the issue.
I believe this states the problem correctly: If a user presses the a key, how can I send the b key while simultaneously holding down the c key? (i.e., not b then c)
I believe this states the problem correctly: If a user presses the a key, how can I send the b key while simultaneously holding down the c key? (i.e., not b then c)
Last edited by boiler on 09 Feb 2015, 06:53, edited 1 time in total.
Re: Press key combination
Code: Select all
a² + b² = c²
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Re: Press key combination
Thanks! So is this the official way? Because I found:empardopo wrote:Code: Select all
a:: Send {LControl}{LWin} return
Code: Select all
Send {LControl}+{LWin}
If yes, where in the help file would I find the correct syntax?
Re: Press key combination
I would advice you to start reading the http://ahkscript.org/docs/Tutorial.htm again to learn the basics. You will see that + will mean sending the shift key. If you want to send the plus sign you need to wrap it curly braces {+}. The tutorial should make it clear including where you can find more information and also how to read the documentation.
Re: Press key combination
Thanks for the RTM. However there, I also can't find the information about how to send arbitrary key combinations.
What's more, I start to fear that ...sends a sequence, not a combination.
What's more, I start to fear that
Code: Select all
Send {LControl}{LWin}
Re: Press key combination
Again actually READ the tutorial not just stare at the link
Sending keys: http://ahkscript.org/docs/Tutorial.htm#s3
You can also send Down and Up events of a key (which you could have read if you actually opened the documentation - nothing will help you more by reading the documentation) - example
Send {LControl down}{LWin down}{Lwin up}{LControl up}
Sending keys: http://ahkscript.org/docs/Tutorial.htm#s3
You can also send Down and Up events of a key (which you could have read if you actually opened the documentation - nothing will help you more by reading the documentation) - example
Send {LControl down}{LWin down}{Lwin up}{LControl up}
Re: Press key combination
Again, your example sends a sequence, not a combination
So if there is no way to send a combination (other than the down/up-sequence workaround), a) just tell me, and b) show me where the manual says such
So if there is no way to send a combination (other than the down/up-sequence workaround), a) just tell me, and b) show me where the manual says such
Re: Press key combination
you couldn't help you self, could you?jNizM wrote:( sorry )Code: Select all
a² + b² = c²
if the Send command, may be we don't have the same help gile but you can use the online documentationsSo please, where in the help file is the general description of how to send key combinations?
http://ahkscript.org/docs/commands/Send.htm
there are examples and explinations
To hold down or release a key: Enclose in braces the name of the key followed by the word Down or Up. For example:
Code: Select all
Send {b down}{b up}
Send {TAB down}{TAB up}
Send {Up down} ; Press down the up-arrow key.
Sleep 1000 ; Keep it down for one second.
Send {Up up} ; Release the up-arrow key.
Re: Press key combination
Hi DavidP.
When you press control Alt Delete to bring up task manager, is that a combination or a sequence?
When you press control Alt Delete to bring up task manager, is that a combination or a sequence?
Re: Press key combination
That is of course a combination.When you press control Alt Delete to bring up task manager, is that a combination or a sequence?
A sequence is
Code: Select all
Send, ab{ENTER}cd
So how do i send a damned combination?
Re: Press key combination
If Control+Shift+Del is a combination, and you want a combination:
than test this and you see it opens your taskmanager (COMBINATION)
than test this and you see it opens your taskmanager (COMBINATION)
Code: Select all
a::^+Esc
; a sends a combination of:
; ^ = Control
; + = Shift
; Esc = Escape
; ==> TASKMANAGER
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Re: Press key combination
For the umpteenth time:
How the **** do I send a combination of ARBITRARY keys?
Like, yo, press "a" and "b" simultaneously.
Without the down/up workaround.
And, where is it in the dam*ed manual.
Re: Press key combination
Yeah, I can't believe all the condescending responses people are giving DavidP (basically saying "read the manual, stupid") when they haven't been able to produce evidence that they can find it either.
He is looking to be able to send two keys in combination, and NOT modifier keys like Shift, Control, Alt. One example didn't even send the modifier keys in combination, it showed them in sequence. Unless you provide an example without the Up/Down work-around, I would hope you could withhold the snarky comments.
He is looking to be able to send two keys in combination, and NOT modifier keys like Shift, Control, Alt. One example didn't even send the modifier keys in combination, it showed them in sequence. Unless you provide an example without the Up/Down work-around, I would hope you could withhold the snarky comments.