Skip to content

Instantly share code, notes, and snippets.

@ion1
Last active April 26, 2023 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ion1/ecef69ff372690cbc328fd2fd18a7196 to your computer and use it in GitHub Desktop.
Save ion1/ecef69ff372690cbc328fd2fd18a7196 to your computer and use it in GitHub Desktop.
Push-to-mute using AutoHotKey
#Warn
#SingleInstance
SetWorkingDir(A_ScriptDir)
Component := ""
Device := "Analogue 1 + 2 (Microphone)"
Mute(State) {
OldState := SoundGetMute(Component, Device)
SoundSetMute(State, Component, Device)
If (OldState == State)
return
If (State)
SoundPlay("mute.wav")
Else
SoundPlay("unmute.wav")
}
KeyHandler(key, modifier) {
If GetKeyState(modifier) {
Mute(1)
} Else {
Mute(1)
KeyWait(key)
Mute(0)
}
}
F13::
+F13::
{
KeyHandler("F13", "Shift")
return
}
Joy6::KeyHandler("Joy6", "Joy5")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment