Jump to content

Autohotkey Noob Please help.

Koxicain

Im trying to make a hotkey as Ctrl Numpad1 to execute ctrl alt numpad 1 and alt numpad 1 but it just wont act like i want it to. 
i can easily make it execute a single command but not two. Any help ?
I've done multiple versions of this but just wont work.
 

^Numpad1:: 
send {Ctrl Alt Numpad1}
send {ALT numpad1}

PC Specs

Ryzen 7 - 2700x - 4.2 Ghz 

MSI MPG X570s Carbon Max Wifi 

Thermaltake Water 3.0 360mm ARGB Sync TT Premium

G.Skillz Trident Z 3200mhz CL16

Gigabyte RTX 2060 Aorus Xtreme

Samsung Evo 970 - 256 GB

OCZ Agility - 256 GB

Western Digital - 1 TB

Corsair RM750x - 750W Gold

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

You will want to change the script to

^Numpad1::
Send, {Ctrl down}{Alt down}{Numpad1}{Alt up}{Ctrl up}
Send, {Alt down}{Numpad1}{Alt up}

 

¯\_(ツ)_/¯

 

 

Desktop:

Intel Core i7-11700K | Noctua NH-D15S chromax.black | ASUS ROG Strix Z590-E Gaming WiFi  | 32 GB G.SKILL TridentZ 3200 MHz | ASUS TUF Gaming RTX 3080 | 1TB Samsung 980 Pro M.2 PCIe 4.0 SSD | 2TB WD Blue M.2 SATA SSD | Seasonic Focus GX-850 Fractal Design Meshify C Windows 10 Pro

 

Laptop:

HP Omen 15 | AMD Ryzen 7 5800H | 16 GB 3200 MHz | Nvidia RTX 3060 | 1 TB WD Black PCIe 3.0 SSD | 512 GB Micron PCIe 3.0 SSD | Windows 11

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, BobVonBob said:

You will want to change the script to


^Numpad1::
Send, {Ctrl down}{Alt down}{Numpad1}{Alt up}{Ctrl up}
Send, {Alt down}{Numpad1}{Alt up}

 

Thanks, Well it sortof works. 
It wont execute the hotkey in OBS. 

PC Specs

Ryzen 7 - 2700x - 4.2 Ghz 

MSI MPG X570s Carbon Max Wifi 

Thermaltake Water 3.0 360mm ARGB Sync TT Premium

G.Skillz Trident Z 3200mhz CL16

Gigabyte RTX 2060 Aorus Xtreme

Samsung Evo 970 - 256 GB

OCZ Agility - 256 GB

Western Digital - 1 TB

Corsair RM750x - 750W Gold

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Koxicain said:

Thanks, Well it sortof works. 
It wont execute the hotkey in OBS. 

You could also try

^Numpad1::
Send, ^!Numpad1
Send, !Numpad1

The first is recommended, but this format can sometimes work better.

¯\_(ツ)_/¯

 

 

Desktop:

Intel Core i7-11700K | Noctua NH-D15S chromax.black | ASUS ROG Strix Z590-E Gaming WiFi  | 32 GB G.SKILL TridentZ 3200 MHz | ASUS TUF Gaming RTX 3080 | 1TB Samsung 980 Pro M.2 PCIe 4.0 SSD | 2TB WD Blue M.2 SATA SSD | Seasonic Focus GX-850 Fractal Design Meshify C Windows 10 Pro

 

Laptop:

HP Omen 15 | AMD Ryzen 7 5800H | 16 GB 3200 MHz | Nvidia RTX 3060 | 1 TB WD Black PCIe 3.0 SSD | 512 GB Micron PCIe 3.0 SSD | Windows 11

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, BobVonBob said:

You could also try


^Numpad1::
Send, ^!Numpad1
Send, !Numpad1

The first is recommended, but this format can sometimes work better.

Wish it was working.. 
Still isnt for some reason. . 

PC Specs

Ryzen 7 - 2700x - 4.2 Ghz 

MSI MPG X570s Carbon Max Wifi 

Thermaltake Water 3.0 360mm ARGB Sync TT Premium

G.Skillz Trident Z 3200mhz CL16

Gigabyte RTX 2060 Aorus Xtreme

Samsung Evo 970 - 256 GB

OCZ Agility - 256 GB

Western Digital - 1 TB

Corsair RM750x - 750W Gold

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Koxicain said:

Wish it was working.. 
Still isnt for some reason. . 

Try adding a Sleep command between the first and second lines, OBS might just not be able to take inputs that quickly. Try Sleep 100. If that doesn't work see if it works if you change the hotkey to just Numpad1, or just Numpad2. It may be that you pressing the buttons is interfering with the commands being sent. Also make sure that the commands being pressed are global hotkeys in OBS.

¯\_(ツ)_/¯

 

 

Desktop:

Intel Core i7-11700K | Noctua NH-D15S chromax.black | ASUS ROG Strix Z590-E Gaming WiFi  | 32 GB G.SKILL TridentZ 3200 MHz | ASUS TUF Gaming RTX 3080 | 1TB Samsung 980 Pro M.2 PCIe 4.0 SSD | 2TB WD Blue M.2 SATA SSD | Seasonic Focus GX-850 Fractal Design Meshify C Windows 10 Pro

 

Laptop:

HP Omen 15 | AMD Ryzen 7 5800H | 16 GB 3200 MHz | Nvidia RTX 3060 | 1 TB WD Black PCIe 3.0 SSD | 512 GB Micron PCIe 3.0 SSD | Windows 11

Link to comment
Share on other sites

Link to post
Share on other sites

37 minutes ago, BobVonBob said:

Try adding a Sleep command between the first and second lines, OBS might just not be able to take inputs that quickly. Try Sleep 100. If that doesn't work see if it works if you change the hotkey to just Numpad1, or just Numpad2. It may be that you pressing the buttons is interfering with the commands being sent. Also make sure that the commands being pressed are global hotkeys in OBS.

Hmm for some reason OBS will just not register it. It will do it if i press Alt numpad 1 normally but not in the script. 

PC Specs

Ryzen 7 - 2700x - 4.2 Ghz 

MSI MPG X570s Carbon Max Wifi 

Thermaltake Water 3.0 360mm ARGB Sync TT Premium

G.Skillz Trident Z 3200mhz CL16

Gigabyte RTX 2060 Aorus Xtreme

Samsung Evo 970 - 256 GB

OCZ Agility - 256 GB

Western Digital - 1 TB

Corsair RM750x - 750W Gold

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, Koxicain said:

Hmm for some reason OBS will just not register it. It will do it if i press Alt numpad 1 normally but not in the script. 

Oh man, my bad on that last script, it should actually be

^Numpad1::
Send, ^!{Numpad1}
Sleep 100 ; Optional, if it works take this out and see if it still works.
Send, !{Numpad1}

I always forget the brackets when using that syntax.

¯\_(ツ)_/¯

 

 

Desktop:

Intel Core i7-11700K | Noctua NH-D15S chromax.black | ASUS ROG Strix Z590-E Gaming WiFi  | 32 GB G.SKILL TridentZ 3200 MHz | ASUS TUF Gaming RTX 3080 | 1TB Samsung 980 Pro M.2 PCIe 4.0 SSD | 2TB WD Blue M.2 SATA SSD | Seasonic Focus GX-850 Fractal Design Meshify C Windows 10 Pro

 

Laptop:

HP Omen 15 | AMD Ryzen 7 5800H | 16 GB 3200 MHz | Nvidia RTX 3060 | 1 TB WD Black PCIe 3.0 SSD | 512 GB Micron PCIe 3.0 SSD | Windows 11

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, BobVonBob said:

Oh man, my bad on that last script, it should actually be


^Numpad1::
Send, ^!{Numpad1}
Sleep 100 ; Optional, if it works take this out and see if it still works.
Send, !{Numpad1}

I always forget the brackets when using that syntax.

Well still no effect with OBS. 
It works with my other program so something is wrong with my obs i guess. i did open it as admin though

 

PC Specs

Ryzen 7 - 2700x - 4.2 Ghz 

MSI MPG X570s Carbon Max Wifi 

Thermaltake Water 3.0 360mm ARGB Sync TT Premium

G.Skillz Trident Z 3200mhz CL16

Gigabyte RTX 2060 Aorus Xtreme

Samsung Evo 970 - 256 GB

OCZ Agility - 256 GB

Western Digital - 1 TB

Corsair RM750x - 750W Gold

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

You can try adding

SendMode Input

to the top of the file, above the hotkey. If that doesn't work a way to sometimes get AHK working with stubborn apps is using ControlSend which ensures that the keystrokes get sent to the application you specify.

SendMode Input

^Numpad1::
controlSend,,{Ctrl down}{Alt down}{Numpad1}{Alt up}{Ctrl up},ahk_class Qt5QWindowIcon
controlSend,,{Alt down}{Numpad1}{Alt up},ahk_class Qt5QWindowIcon

; Qt5QWindowIcon is the default ahk class of OBS Studio, if it doesn't work you can find
; the name with Window Spy which can be accessed through the task bar icon when you run
; a script

 

¯\_(ツ)_/¯

 

 

Desktop:

Intel Core i7-11700K | Noctua NH-D15S chromax.black | ASUS ROG Strix Z590-E Gaming WiFi  | 32 GB G.SKILL TridentZ 3200 MHz | ASUS TUF Gaming RTX 3080 | 1TB Samsung 980 Pro M.2 PCIe 4.0 SSD | 2TB WD Blue M.2 SATA SSD | Seasonic Focus GX-850 Fractal Design Meshify C Windows 10 Pro

 

Laptop:

HP Omen 15 | AMD Ryzen 7 5800H | 16 GB 3200 MHz | Nvidia RTX 3060 | 1 TB WD Black PCIe 3.0 SSD | 512 GB Micron PCIe 3.0 SSD | Windows 11

Link to comment
Share on other sites

Link to post
Share on other sites

27 minutes ago, BobVonBob said:

You can try adding


SendMode Input

to the top of the file, above the hotkey. If that doesn't work a way to sometimes get AHK working with stubborn apps is using ControlSend which ensures that the keystrokes get sent to the application you specify.


SendMode Input

^Numpad1::
controlSend,,{Ctrl down}{Alt down}{Numpad1}{Alt up}{Ctrl up},ahk_class Qt5QWindowIcon
controlSend,,{Alt down}{Numpad1}{Alt up},ahk_class Qt5QWindowIcon

; Qt5QWindowIcon is the default ahk class of OBS Studio, if it doesn't work you can find
; the name with Window Spy which can be accessed through the task bar icon when you run
; a script

 

This is strange. 
If i do CTRL ALT + Numpad1 it acts as i want it but not when i use ctrl numpad1 ? 
^Numpad1::
Send, ^!{Numpad1}
Sleep 100 ;
Send, !{Numpad1}

PC Specs

Ryzen 7 - 2700x - 4.2 Ghz 

MSI MPG X570s Carbon Max Wifi 

Thermaltake Water 3.0 360mm ARGB Sync TT Premium

G.Skillz Trident Z 3200mhz CL16

Gigabyte RTX 2060 Aorus Xtreme

Samsung Evo 970 - 256 GB

OCZ Agility - 256 GB

Western Digital - 1 TB

Corsair RM750x - 750W Gold

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Koxicain said:

This is strange. 
If i do CTRL ALT + Numpad1 it acts as i want it but not when i use ctrl numpad1 ? 
^Numpad1::
Send, ^!{Numpad1}
Sleep 100 ;
Send, !{Numpad1}

Well I'm stumped. My only idea is you holding Ctrl to execute the shortcut is influencing the script running. Try adding a Sleep 1000 before the first command to stall it for a second and letting go of the shortcut keys as soon as you press them so you aren't holding anything while the script executes.

¯\_(ツ)_/¯

 

 

Desktop:

Intel Core i7-11700K | Noctua NH-D15S chromax.black | ASUS ROG Strix Z590-E Gaming WiFi  | 32 GB G.SKILL TridentZ 3200 MHz | ASUS TUF Gaming RTX 3080 | 1TB Samsung 980 Pro M.2 PCIe 4.0 SSD | 2TB WD Blue M.2 SATA SSD | Seasonic Focus GX-850 Fractal Design Meshify C Windows 10 Pro

 

Laptop:

HP Omen 15 | AMD Ryzen 7 5800H | 16 GB 3200 MHz | Nvidia RTX 3060 | 1 TB WD Black PCIe 3.0 SSD | 512 GB Micron PCIe 3.0 SSD | Windows 11

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, BobVonBob said:

Well I'm stumped. My only idea is you holding Ctrl to execute the shortcut is influencing the script running. Try adding a Sleep 1000 before the first command to stall it for a second and letting go of the shortcut keys as soon as you press them so you aren't holding anything while the script executes.

Nope still doesnt :/ this is so weird ! 

PC Specs

Ryzen 7 - 2700x - 4.2 Ghz 

MSI MPG X570s Carbon Max Wifi 

Thermaltake Water 3.0 360mm ARGB Sync TT Premium

G.Skillz Trident Z 3200mhz CL16

Gigabyte RTX 2060 Aorus Xtreme

Samsung Evo 970 - 256 GB

OCZ Agility - 256 GB

Western Digital - 1 TB

Corsair RM750x - 750W Gold

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, Koxicain said:

Nope still doesnt :/ this is so weird ! 

Is it possible to make OBS do all of what you want off one hotkey? I'm going to guess you knew this already, but the initial Ctrl+Numpad1 won't get sent to OBS, just in case that was part of the sequence you wanted. Just to rule that out.

¯\_(ツ)_/¯

 

 

Desktop:

Intel Core i7-11700K | Noctua NH-D15S chromax.black | ASUS ROG Strix Z590-E Gaming WiFi  | 32 GB G.SKILL TridentZ 3200 MHz | ASUS TUF Gaming RTX 3080 | 1TB Samsung 980 Pro M.2 PCIe 4.0 SSD | 2TB WD Blue M.2 SATA SSD | Seasonic Focus GX-850 Fractal Design Meshify C Windows 10 Pro

 

Laptop:

HP Omen 15 | AMD Ryzen 7 5800H | 16 GB 3200 MHz | Nvidia RTX 3060 | 1 TB WD Black PCIe 3.0 SSD | 512 GB Micron PCIe 3.0 SSD | Windows 11

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, BobVonBob said:

Is it possible to make OBS do all of what you want off one hotkey? I'm going to guess you knew this already, but the initial Ctrl+Numpad1 won't get sent to OBS, just in case that was part of the sequence you wanted. Just to rule that out.

No OBS is the Alt+numpad1 hotkey

PC Specs

Ryzen 7 - 2700x - 4.2 Ghz 

MSI MPG X570s Carbon Max Wifi 

Thermaltake Water 3.0 360mm ARGB Sync TT Premium

G.Skillz Trident Z 3200mhz CL16

Gigabyte RTX 2060 Aorus Xtreme

Samsung Evo 970 - 256 GB

OCZ Agility - 256 GB

Western Digital - 1 TB

Corsair RM750x - 750W Gold

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Koxicain said:

No OBS is the Alt+numpad1 hotkey

Wait the hotkey is supposed to be Alt+Numpad1?

If that's the case the first line should be

!Numpad1::

 

¯\_(ツ)_/¯

 

 

Desktop:

Intel Core i7-11700K | Noctua NH-D15S chromax.black | ASUS ROG Strix Z590-E Gaming WiFi  | 32 GB G.SKILL TridentZ 3200 MHz | ASUS TUF Gaming RTX 3080 | 1TB Samsung 980 Pro M.2 PCIe 4.0 SSD | 2TB WD Blue M.2 SATA SSD | Seasonic Focus GX-850 Fractal Design Meshify C Windows 10 Pro

 

Laptop:

HP Omen 15 | AMD Ryzen 7 5800H | 16 GB 3200 MHz | Nvidia RTX 3060 | 1 TB WD Black PCIe 3.0 SSD | 512 GB Micron PCIe 3.0 SSD | Windows 11

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, BobVonBob said:

Wait the hotkey is supposed to be Alt+Numpad1?

If that's the case the first line should be


!Numpad1::

 

The hotkey in OBS is suppose to be Alt+numpad1 the hotkey in OVR stream is suppose to be ctrl+alt+numpad1 and the key to execute is suppose to be ctrl+numpad 1

 

PC Specs

Ryzen 7 - 2700x - 4.2 Ghz 

MSI MPG X570s Carbon Max Wifi 

Thermaltake Water 3.0 360mm ARGB Sync TT Premium

G.Skillz Trident Z 3200mhz CL16

Gigabyte RTX 2060 Aorus Xtreme

Samsung Evo 970 - 256 GB

OCZ Agility - 256 GB

Western Digital - 1 TB

Corsair RM750x - 750W Gold

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

25 minutes ago, Koxicain said:

The hotkey in OBS is suppose to be Alt+numpad1 the hotkey in OVR stream is suppose to be ctrl+alt+numpad1 and the key to execute is suppose to be ctrl+numpad 1

 

Alright, well I've exhausted all the AHK tricks I know.

¯\_(ツ)_/¯

 

 

Desktop:

Intel Core i7-11700K | Noctua NH-D15S chromax.black | ASUS ROG Strix Z590-E Gaming WiFi  | 32 GB G.SKILL TridentZ 3200 MHz | ASUS TUF Gaming RTX 3080 | 1TB Samsung 980 Pro M.2 PCIe 4.0 SSD | 2TB WD Blue M.2 SATA SSD | Seasonic Focus GX-850 Fractal Design Meshify C Windows 10 Pro

 

Laptop:

HP Omen 15 | AMD Ryzen 7 5800H | 16 GB 3200 MHz | Nvidia RTX 3060 | 1 TB WD Black PCIe 3.0 SSD | 512 GB Micron PCIe 3.0 SSD | Windows 11

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, BobVonBob said:

Alright, well I've exhausted all the AHK tricks I know.

Hahah i actually fixed it :P
I made it even simpler. 

!Numpad1::
sleep 1000
Send, ^!{Numpad1}
return

PC Specs

Ryzen 7 - 2700x - 4.2 Ghz 

MSI MPG X570s Carbon Max Wifi 

Thermaltake Water 3.0 360mm ARGB Sync TT Premium

G.Skillz Trident Z 3200mhz CL16

Gigabyte RTX 2060 Aorus Xtreme

Samsung Evo 970 - 256 GB

OCZ Agility - 256 GB

Western Digital - 1 TB

Corsair RM750x - 750W Gold

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, BobVonBob said:

Alright, well I've exhausted all the AHK tricks I know.

Really thanks for your help im starting to get it now :P

PC Specs

Ryzen 7 - 2700x - 4.2 Ghz 

MSI MPG X570s Carbon Max Wifi 

Thermaltake Water 3.0 360mm ARGB Sync TT Premium

G.Skillz Trident Z 3200mhz CL16

Gigabyte RTX 2060 Aorus Xtreme

Samsung Evo 970 - 256 GB

OCZ Agility - 256 GB

Western Digital - 1 TB

Corsair RM750x - 750W Gold

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×