Jump to content

[GUIDE] A simple way to make a volume hotkey (AutoHotKey)

DaltonM

 

I looked everywhere on the internet for how to use AHK to make a simple volume control script. It literally took me hours to develop this solution. So I thought I would be doing the internet a service be showing you all how it's done.

Have a look at this short video to get it done:

 

 

And reveal the following spoiler to see a text version of the guide:

Spoiler

How to control you volume using hotkeys using AutoHotKey.

Step One:
Get Autohotkey:
www.autohotkey.com

--------------------------------

Step two:
Run autohotkey, it will ask if you want to create a script in the My Documents folder, say yes.

--------------------------------

Step three:
Delete everything in the notepad window that just appeared.
(note: if the notepad window didn't open up already, goto My Documents and right click 'autohotkey.ahk' and click edit.)

--------------------------------

Step four:
paste:

!numpad2::SendInput, {Volume_Down}

!numpad8::SendInput, {Volume_Up}


into the file. Just those 3 lines, the first line of code, an empty line, then the last line of code. Save file.

--------------------------------

Step five: 
Check the taskbar to see if AHK is running, if it isn't find it and run it, once it's down there, right click and click 'reload script'

After that, you can press ALT + 8 on your number pad to increase the system volume!! And press ALT + 2 to decrease!! SO COOL.

--------------------------------

After thoughts:
You might want to customize the hotkey to your liking, or maybe you don't have a number pad. You can customize the hotkey by editing the code before the ::.
Putting ! mean you have to hold ALT
Putting # means you have to hold the windows key
Putting ^ means you have to hold Ctrl.
Anything you put after that can be the hotkey. Say you want ALT + S to increase volume you'd type: "!s::-command-"

--------------------------------

the reason I made this video is because when i use my bluetooth speaker through auto cable, the volume is set to 100%. This causes me to have to keep my volume at around 10%, since I can't use any physical controls to change the volume of my speaker. I needed and easier way to change system volume while gaming. Also it was really hard to find a simple but works solution to a hotkey like this.

 

Link to comment
Share on other sites

Link to post
Share on other sites

Another cool think to do with AHK is an audio output swapper :D

Desktop - Corsair 300r i7 4770k H100i MSI 780ti 16GB Vengeance Pro 2400mhz Crucial MX100 512gb Samsung Evo 250gb 2 TB WD Green, AOC Q2770PQU 1440p 27" monitor Laptop Clevo W110er - 11.6" 768p, i5 3230m, 650m GT 2gb, OCZ vertex 4 256gb,  4gb ram, Server: Fractal Define Mini, MSI Z78-G43, Intel G3220, 8GB Corsair Vengeance, 4x 3tb WD Reds in Raid 10, Phone Oppo Reno 10x 256gb , Camera Sony A7iii

Link to comment
Share on other sites

Link to post
Share on other sites

AudioSwitch 2.1 does both of those things beautifully - and shows a volume control UI if you wish so you can actually see what your hotkey is doing.

Link to comment
Share on other sites

Link to post
Share on other sites

25 minutes ago, Dredgy said:

AudioSwitch 2.1 does both of those things beautifully - and shows a volume control UI if you wish so you can actually see what your hotkey is doing.

AHK has a lot more functionality and works well in games and other fullscreen apps. If you're already an AHK user you can simply add this to your script. 

 

I mainly made this video because finding out how to do this with AHK took me about 2 hours of research and I feel for something so simple, there should be an equally simple solution. 

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

×