我可以为宏创建一个脚本来更改音量吗?

use*_*103 2 autohotkey

我打算尽快买一台台式电脑,而我选择的键盘上没有音量调低键.我会从笔记本电脑中错过这个,所以我可以使用AutoHotKey来改变它吗?从命令列表中,它看起来不像.在我选择的键盘上,我希望它是\ F12 :: SetVolumeUp

或类似的东西.

我不认为这是可能的,是吗?

jsz*_*ody 7

是的,这是可能的.你想看一下这个SoundSet命令:

SoundSet, 50  ; Set the master volume to 50%
SoundSet +10  ; Increase master volume by 10%
SoundSet -10  ; Decrease master volume by 10%
Run Code Online (Sandbox Code Playgroud)

请参见http://www.autohotkey.com/docs/commands/SoundSet.htm

您也可以使用Send命令来模拟这样的击键:

Send {Volume_Up}  ; Raise the master volume by 1 interval (typically 5%).
Send {Volume_Down 3}  ; Lower the master volume by 3 intervals.
Send {Volume_Mute}  ; Mute/unmute the master volume.
Run Code Online (Sandbox Code Playgroud)

http://www.autohotkey.com/docs/commands/Send.htm

以下是重新映射F10-F12键以控制音量的脚本示例:

;F10
^F10::
    SendInput, {F10}
    Return

$F10::Send {Volume_Mute}

;F11
^F11::
    SendInput, {F11}
    Return

$F11::Send {Volume_Down 5}

;F12
^F12::
    SendInput, {F12}
    Return

$F12::Send {Volume_Up 5}
Run Code Online (Sandbox Code Playgroud)

http://www.autohotkey.com/board/topic/62808-remap-f10-f11-f12/