Wonderful! Thanks a lotgregster wrote: ↑27 May 2023, 12:01You could use #Inputlevel:Or gosub, as F5 is also a kind of label:Code: Select all
F5::SendInput M #Inputlevel 1 F1:: ; ... SendInput {F5} return
Code: Select all
F5::SendInput M F1:: Send w gosub F5 Return
Search found 65 matches
- 27 May 2023, 12:10
- Forum: Ask for Help (v1)
- Topic: Can I send a key like that? Topic is solved
- Replies: 2
- Views: 317
Re: Can I send a key like that? Topic is solved
- 27 May 2023, 11:56
- Forum: Ask for Help (v1)
- Topic: Can I send a key like that? Topic is solved
- Replies: 2
- Views: 317
Can I send a key like that? Topic is solved
Hi everyone,
Let's say I have:
F5::SendInput M
and also:
Enter::
---some code---
SendInput {F5} ;it should send M
---some code---
return
function() could help but maybe there is a much better solution here
Let's say I have:
F5::SendInput M
and also:
Enter::
---some code---
SendInput {F5} ;it should send M
---some code---
return
function() could help but maybe there is a much better solution here
- 07 Apr 2023, 08:51
- Forum: Ask for Help (v1)
- Topic: Continue after defining a function
- Replies: 1
- Views: 180
Continue after defining a function
Hello everyone,
My script doesn't want to continue after defining the function video5. Does it go against the principles of AHK or there is a chance to get it work the way I want.
A simple example below:
My script doesn't want to continue after defining the function video5. Does it go against the principles of AHK or there is a chance to get it work the way I want.
A simple example below:
Code: Select all
F10:
video5()
{
SendInput {b}{s}
}
SendInput {k}
Click
SendInput {m}
return
- 06 Apr 2023, 22:44
- Forum: Ask for Help (v1)
- Topic: How to ignore function in a function? Topic is solved
- Replies: 6
- Views: 394
Re: How to ignore function in a function? Topic is solved
The code is fine. My description of calling a function was inaccurate in the case of the function hotkey as gregster has cited. The answer to your question is that a function can have optional parameters, described here. https://www.autohotkey.com/docs/v1/Functions.htm#optional This enables some fu...
- 06 Apr 2023, 22:13
- Forum: Ask for Help (v1)
- Topic: How to ignore function in a function? Topic is solved
- Replies: 6
- Views: 394
Re: How to ignore function in a function? Topic is solved
Hello, Defining a function does not call the function. (EDIT: corrected by gregster below.) #Requires AutoHotkey v1.1.33 F5::video1("RAlt") F6::video1() video1(key := "") { Send bs If (key != "") KeyWait % key, D Sleep 50 Send as } Thank you Mikey. Should I try this (my real code is actually too la...
- 06 Apr 2023, 20:45
- Forum: Ask for Help (v1)
- Topic: How to ignore function in a function? Topic is solved
- Replies: 6
- Views: 394
How to ignore function in a function? Topic is solved
Dear friends, I created a small function video1 to use it with pause so I can can do some stuff manually like this: F5:: video1() { SendInput {b} SendInput {s} Pause3("RAlt") Sleep, 50 SendInput {a} SendInput {s} } Pause3(key) { Loop { Sleep 100 } Until GetKeyState(key,"P") } Return Then I use the f...
- 02 Apr 2023, 09:09
- Forum: Ask for Help (v1)
- Topic: Random text on key press Topic is solved
- Replies: 6
- Views: 601
Re: Random text on key press Topic is solved
Then perhaps slower?: #SingleInstance, Force ; If !A_IsAdmin ; Try Run *RunAs "%A_ScriptFullPath%" Var1 := "Hello" Var2 := "{Hi|hallo|hallo you} i want to {talk with|kill} you" Var3 := "{Hallooo|Hey} I am availible {now|later|never}" Var4 := "Greetings" Var5 := "Bla bla" F1:: Random, OutputVar, 1, ...
- 01 Apr 2023, 19:30
- Forum: Ask for Help (v1)
- Topic: Random text on key press Topic is solved
- Replies: 6
- Views: 601
Re: Random text on key press Topic is solved
Hallo, try: Var1 := "Hello" Var2 := "{Hi|hallo|hallo you} i want to {talk with|kill} you" Var3 := "{Hallooo|Hey} I am availible {now|later|never}" Var4 := "Greetings" Var5 := "Bla bla" F1:: Random, OutputVar, 1, 5 Text := Var%OutputVar% While, RegExMatch(Text, "{([^}]+)}", EitherOr) { EitherOr2 := ...
- 01 Apr 2023, 12:00
- Forum: Ask for Help (v1)
- Topic: Random text on key press Topic is solved
- Replies: 6
- Views: 601
Random text on key press Topic is solved
Dear friends, I would like to get some random text on key press but this code below doesn't work for some reason. Var1 := "Hello" Var2 := "{Hi|hallo} i want to talk with you" Var3 := "{Hallooo|Hey} I am availible" Var4 := "Greetings" Var5 := "Bla bla" F1:: Random, OutputVar , 1, 5 Sendraw % Var%Outp...
- 31 Jan 2023, 16:42
- Forum: Ask for Help (v1)
- Topic: Multi button: How to do something like this?
- Replies: 3
- Views: 331
Re: Multi button: How to do something like this?
#Requires AutoHotkey v1.1.33 RButton:: KeyWait RButton, T.2 If ErrorLevel { ; Held Click R SoundBeep 1500 } Else { ; Not held Send {Alt down} SoundBeep 1000 } KeyWait RButton Send {Alt up} Return A different one: #Requires AutoHotkey v1.1.33 RButton:: Send {Alt down} KeyWait RButton, T.2 If ErrorLe...
- 31 Jan 2023, 08:13
- Forum: Ask for Help (v1)
- Topic: Multi button: How to do something like this?
- Replies: 3
- Views: 331
Multi button: How to do something like this?
Hello guys, If I hold down my RButton, then I hear soundbeep. A normal RButton if I press it quickly. Okay. What I want to do is that I want Alt to be pressed down in the beginning instead of waiting for T0.1. The problem is that it waits here till I release the RButton, and therefore I don't hear t...
- 14 Jun 2022, 14:41
- Forum: Ask for Help (v1)
- Topic: Multiple options with one Hotkey.
- Replies: 24
- Views: 2361
Re: Is it possible?
Idk why but it acts like a toggle. I hear different soundbeeps (2000 and 1000) each time I press F1
Code: Select all
#InstallKeybdHook
F1::
If (A_PriorKey = "F1" && on) {
SoundBeep 2000
on := False
} Else {
SoundBeep 1000
on := True
}
Return
- 14 Jun 2022, 08:51
- Forum: Ask for Help (v1)
- Topic: Multiple options with one Hotkey.
- Replies: 24
- Views: 2361
Re: Is it possible?
I believe it would be too much time-consuming to make such a complicated hotkey. Than you for your efforts, Mikey. @mikeyww, I have to give you kudos for your patience. :salute: When I see things like this, I usually just wonder, "WHY?!?" :facepalm: As boiler pointed out, everyone has their own work...
- 13 Jun 2022, 21:28
- Forum: Ask for Help (v1)
- Topic: Multiple options with one Hotkey.
- Replies: 24
- Views: 2361
Re: Is it possible?
F1:: KeyWait, F1 KeyWait, F1, DT.25 If ErrorLevel ; Pressed once Send Once ` Else Send Twice ` Return Unfortunately, couldn't solve the problem. This code turns the F1 into single and double press hotkey. Indstead of the single one, I wished that I could hold down the F1 and release it and I when I...
- 13 Jun 2022, 20:38
- Forum: Ask for Help (v1)
- Topic: Multiple options with one Hotkey.
- Replies: 24
- Views: 2361
Re: Is it possible?
#InstallKeybdHook F1:: If (A_PriorKey = "F2") Send x Else Send y Return Thank you for your help, Mikey. I just found out that I can't use the F2 anyway. Is it possible to hold down the F1 and make then the F1 behave differently? Sorry :), I just didn't formulate the second question well. As I wrote...
- 13 Jun 2022, 20:26
- Forum: Ask for Help (v1)
- Topic: Multiple options with one Hotkey.
- Replies: 24
- Views: 2361
Re: Is it possible?
F1:: KeyWait, F1, T.3 If ErrorLevel ; Held Send Held ` Else Send Normal ` KeyWait, F1 Return It says Duplicate hotkey. I have already assigned some action for F1. I also tried to past the other actions for F1 after else F1:: KeyWait, F1, T.3 If ErrorLevel { ; Held ControlClick, x312 y227, ahk_class...
- 13 Jun 2022, 19:38
- Forum: Ask for Help (v1)
- Topic: Multiple options with one Hotkey.
- Replies: 24
- Views: 2361
Re: Is it possible?
Thank you for your help, Mikey. I just found out that I can't use the F2 anyway. Is it possible to hold down the F1 and make then the F1 behave differently?mikeyww wrote: ↑13 Jun 2022, 19:32Code: Select all
#InstallKeybdHook F1:: If (A_PriorKey = "F2") Send x Else Send y Return
- 13 Jun 2022, 19:28
- Forum: Ask for Help (v1)
- Topic: Multiple options with one Hotkey.
- Replies: 24
- Views: 2361
Multiple options with one Hotkey.
Hello,
I'm trying to make an unusual hotkey. I have asasigned some actions for F1. If I hold down and release F2 and then press F1, can I make the F1 do some other actions?
I'm trying to make an unusual hotkey. I have asasigned some actions for F1. If I hold down and release F2 and then press F1, can I make the F1 do some other actions?
- 09 Jun 2022, 14:12
- Forum: Ask for Help (v1)
- Topic: How to send vk and sc with modifiers?
- Replies: 5
- Views: 1280
- 09 Jun 2022, 11:38
- Forum: Ask for Help (v1)
- Topic: How to send vk and sc with modifiers?
- Replies: 5
- Views: 1280
Re: How to send vk and sc with modifiers?
sc01E:: ;sc(scan code) of A. SendInput {LCtrl down}{Alt down}{vk53}{Alt up}{LCtrl up} ;Ctrl + Alt + S What do you expect to happen when sending Ctrl+Alt+S ? In which program? A game? A program running with elevated rights? The first (and the third) code works for me, according to my KeyHistory (the...