Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Windows 7 AutoHotKey to volume up/down/mute ?


  • Please log in to reply
10 replies to this topic
pizzamizza
  • Members
  • 1 posts
  • Last active: Feb 06 2013 06:40 AM
  • Joined: 06 Feb 2013

Can anyone help me figure out a way to use autohotkey to replace media keys?  I'm thinking about purchasing a mechanical keyboard, and the cheaper ones don't have media keys or shortcuts.

 

All I can figure out is when I go to the mixer:

 

>>>>>>>>>>( Window Title & Class )<<<<<<<<<<<

ahk_class #32770

>>>>>>>>>>>>( Mouse Position )<<<<<<<<<<<<<
On Screen:    754, 475  (less often used)
In Active Window:    -507, 36

>>>>>>>>>( Now Under Mouse Cursor )<<<<<<<<

Color:    0x000000  (Blue=00 Green=00 Red=00)

>>>>>>>>>>( Active Window Position )<<<<<<<<<<
left: 1261     top: 439     width: 96     height: 403

>>>>>>>>>>>( Status Bar Text )<<<<<<<<<<

>>>>>>>>>>>( Visible Window Text )<<<<<<<<<<<
Mute Speakers
Mi&xer

>>>>>>>>>>>( Hidden Window Text )<<<<<<<<<<<
 
Main &Volume

>>>>( TitleMatchMode=slow Visible Text )<<<<

>>>>( TitleMatchMode=slow Hidden Text )<<<<
 



Gast (w/ nick)
  • Members
  • 119 posts
  • Last active: Aug 02 2013 06:52 AM
  • Joined: 28 Nov 2005

Autohotkey has special commands for

controlling the volume.

 

See

 

http://www.autohotke...ds/SoundSet.htm



naroyya978
  • Members
  • 26 posts
  • Last active: Nov 04 2013 05:13 PM
  • Joined: 28 Dec 2012

Is it possible to create shortcut keys to increase/decrease volume ?

I got rid of holding function key and pressing up/down arrows to do this on my Laptop.

 

I need like this:

 

f1  -->  increase volume

f2  -->  decrease volume



tomoe_uehara
  • Members
  • 2166 posts
  • Last active: Jun 11 2015 05:33 PM
  • Joined: 05 Sep 2009
F1::SoundSet +10
F2::SoundSet -10


lblb
  • Members
  • 120 posts
  • Last active: Dec 02 2015 08:05 AM
  • Joined: 22 May 2012

I don't think Soundset commands work with Win7. You'll probably need to use Lexikos' Vista Audio Controls functions:

http://www.autohotke...trol-functions/



naroyya978
  • Members
  • 26 posts
  • Last active: Nov 04 2013 05:13 PM
  • Joined: 28 Dec 2012

F1::SoundSet +10
F2::SoundSet -10

 

Thanx for reply tomoe,

But this is not working on win7, do we need something else get it done?



lblb
  • Members
  • 120 posts
  • Last active: Dec 02 2015 08:05 AM
  • Joined: 22 May 2012

Hi naroyya978,

 

Did you try Lexikos' function? He specifically developed it because SoundSet doesn't work on Win7. The following works well for me (Win 7 64 bits, AHK_L):

 

SetWorkingDir %A_ScriptDir%
#Include, %A_ScriptDir%\VA.ahk

F3::
VA_SetMasterVolume(50)
return

F4::
volume_level := VA_GetMasterVolume()
VA_SetMasterVolume(volume_level + 10)
return

F5::
volume_level := VA_GetMasterVolume()
VA_SetMasterVolume(volume_level - 10)
return

And make sure you have Lexikos' VA.ahk in the same folder as the script or put it in your standard library folder. (If you use AHK basic, you will need the correct version of VA.ahk and COM.ahk - see the link).



tomoe_uehara
  • Members
  • 2166 posts
  • Last active: Jun 11 2015 05:33 PM
  • Joined: 05 Sep 2009
F1::Send {Volume_Up}
F2::Send {Volume_Down}


jeanbat511
  • Members
  • 1 posts
  • Last active: Jan 10 2014 11:28 PM
  • Joined: 03 Jan 2014

Hello. (sorry for my bad English but I'm french).

 

Just I search a code to adjust the volume with one touch, for example:

I clic on "a" key, adjust to 80.

 

I read your post and I realized that it is ok on Win7 32bit with the script :

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

SetWorkingDir %A_ScriptDir%
#Include, %A_ScriptDir%\VA.ahk

F3::
VA_SetMasterVolume(50)
return

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

I have downloading the library  VA.ahk, ok

but the link for COM.ahk is dead.

I found the script on google but it's not good.

Error with VA:  nonexistent function ---012:COM_Release(aev)

 

 
I think it is COM error.
 
Do you have another link for COM.ahk?
Thank you for your help
 
Jeanbat.

 



yrtsh
  • Members
  • 13 posts
  • Last active: Apr 10 2018 09:21 AM
  • Joined: 11 Feb 2015

this one work for me (dell computer fn touch)

 

INS & F11::Send {vkAEsc12E}   ;  INS + F11 = volume down   
INS & F12::Send {vkAFsc130}    ; INS + F512 = volume up 
INS & F11::Send {vkAEsc12E}   ;  INS + F11 = volume down   
INS & F12::Send {vkAFsc130}    ; INS + F512 = volume up 
INS::Send {INS} ;this line because this also causes Numpad0 to lose its original/native function when it is pressed by itself. this line avoid this


Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

Hello. (sorry for my bad English but I'm french).
 
Just I search a code to adjust the volume with one touch, for example:
I clic on "a" key, adjust to 80.


SoundSet and SoundGet on AutoHotkey v1.1.10 and later support Vista and later natively. You don't need VA.ahk unless you want to use advanced functions not supported by SoundSet/SoundGet.
SoundSet 80