AHK Tutorial #4 – Use Function Keys to Control Volume

20120806120918
Keyboards for different laptops and computers are manufactured differently. Most of the times there might be special designated keys for controlling volume, other times, you might need to press a combination of keys to control them, for example Press Function+F3 or Function+UP etc.
Most of the times, people don’t use Function keys, by Function here I mean F1, F2 through F12. I’m going to show you a very simple way to reprogram these keys to act as a single press volume control buttons for your laptop or PC.

Decide which keys you want to use as Volume Control. For this example code I’m going to use
F3 for Decreasing Volume
F4 for Increasing Volume
F5 for Mute/Unmute toggle.
You could of course use other keystrokes for the Volume Control.
Here is the code.
    ;Volume control using Function Keys 
    ;F2, F3 and F4 are now reprogrammed to act as Volume Control. 
    
    
    F3::Send {Volume_Down}
    F4::Send {Volume_Up}
    F2::Send {Volume_Mute}

Now save this as an AHK script, or add this code to existing AHK script in your AHK directory. Also make sure to run this script all the time.
If this is your first AHK script, learn how to create an AHK script here.

Hope this helps.
Check out the entire AHK tutorial series.

No comments:

Post a Comment

Let us know if this post helped you.
Comments may be moderated, and may not appear immediately.

Share this...