鍵盤控制系統音量這個問題,我最開始是使用VolumeEasy這個軟件(大學時軍哥的推薦),
後來我自己也寫過類似的東西,用C#
(因爲那時公司管理較嚴,無法說明跟工作相的關軟件禁止安裝,日企大家懂的)
今天,在公司換了臺新電腦,win7_64的,
配置這臺電腦的時候,用Autohotkey重寫了這個功能,
發現還是AHK好。腳本如下
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. ^NumpadSub:: ;MsgBox Pressing either Control+Numpad0 or Control+Numpad1 will display this message. Send {Volume_Down 5} ; Lower the master volume by 3 intervals. return ^NumpadAdd:: ;MsgBox Pressing either Control+Numpad0 or Control+Numpad1 will display this message. Send {Volume_Up 5} ; Raise the master volume by 1 interval (typically 5%). return ^NumpadMult:: Send {Volume_Mute} ; Mute/unmute the master volume. return
參考鏈接
小衆軟件上面有篇介紹MediaKeys(使用AHK寫的)的文章:
我寫腳本時,參考的AHK文檔:
Hotkeys (Mouse, Joystick and Keyboard Shortcuts)
List of Keys, Mouse Buttons, and Joystick Controls