Last active
April 26, 2023 19:32
-
-
Save ion1/ecef69ff372690cbc328fd2fd18a7196 to your computer and use it in GitHub Desktop.
Push-to-mute using AutoHotKey
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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