How to use send key
-
- Posts: 43
- Joined: 28 Nov 2022, 01:31
How to use send key
I've been searching for almost 24 hours and got nothing.
So what I want is when I press a key(let's say :a)
It will activate a script in the same file
Pretend this is the script: mousemove 50, 0 ,0 ,r;
So when I press a it should move my cursor
Similar to the if statement in js
I'm new so I don't really know, this is probably really simple
So what I want is when I press a key(let's say :a)
It will activate a script in the same file
Pretend this is the script: mousemove 50, 0 ,0 ,r;
So when I press a it should move my cursor
Similar to the if statement in js
I'm new so I don't really know, this is probably really simple
Re: How to use send key
Code: Select all
a::MouseMove, 50, 0, 0, R
-
- Posts: 43
- Joined: 28 Nov 2022, 01:31
Re: How to use send key
Hi thank you, how would we do with multiple lines of code thanks
Re: How to use send key
Rather than searching the internet for 24 hours, you could have read about the fundamentals of AHK from the manual in a fraction of the time and have learned the answer to your question and much more by now.hieveryone wrote: ↑ I've been searching for almost 24 hours and got nothing.
That’s in this part of the manual, which is the exact link that mikeyww gave you.hieveryone wrote: ↑ how would we do with multiple lines of code
-
- Posts: 43
- Joined: 28 Nov 2022, 01:31
Re: How to use send key
@boiler
no it isnt ive checked the thing and it doesnt say how to do lines.
no it isnt ive checked the thing and it doesnt say how to do lines.
Re: How to use send key
Yes it is. Check the thing more carefully:
Hopefully, from where it goes on to say what you can do in the case of a single line, you can deduce that what was just shown is what you would use for multiple lines. To make it more explicit for you:Hotkeys Intro wrote:In the final line above, return serves to finish the hotkey. However, if a hotkey needs to execute only a single line, that line can be listed to the right of the double-colon. In other words, the return is implicit:Code: Select all
#n:: Run Notepad return
Code: Select all
#n::Run Notepad
Code: Select all
#n::
Run Notepad
MsgBox, Hello! I'm on another line!
return
-
- Posts: 43
- Joined: 28 Nov 2022, 01:31
Re: How to use send key
sorry boiler, i am really dumb.could you explain what run notepad does?boiler wrote: ↑30 Nov 2022, 00:06Yes it is. Check the thing more carefully:Hopefully, from where it goes on to say what you can do in the case of a single line, you can deduce that what was just shown is what you would use for multiple lines. To make it more explicit for you:Hotkeys Intro wrote:In the final line above, return serves to finish the hotkey. However, if a hotkey needs to execute only a single line, that line can be listed to the right of the double-colon. In other words, the return is implicit:Code: Select all
#n:: Run Notepad return
Code: Select all
#n::Run Notepad
Code: Select all
#n:: Run Notepad MsgBox, Hello! I'm on another line! return
does it run thewhole note pad? because i just want to run a specific function
-
- Posts: 43
- Joined: 28 Nov 2022, 01:31
Re: How to use send key
wit nevermind it works ive figured it out, then the nswer to this should be f4irly e4sy 4s well: viewtopic.php?f=76&t=111011boiler wrote: ↑30 Nov 2022, 00:06Yes it is. Check the thing more carefully:Hopefully, from where it goes on to say what you can do in the case of a single line, you can deduce that what was just shown is what you would use for multiple lines. To make it more explicit for you:Hotkeys Intro wrote:In the final line above, return serves to finish the hotkey. However, if a hotkey needs to execute only a single line, that line can be listed to the right of the double-colon. In other words, the return is implicit:Code: Select all
#n:: Run Notepad return
Code: Select all
#n::Run Notepad
Code: Select all
#n:: Run Notepad MsgBox, Hello! I'm on another line! return