mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
MicMute Toggle for external hotkey https://github.com/seerge/g-helper/issues/3127
This commit is contained in:
@@ -282,7 +282,7 @@ namespace GHelper.Input
|
|||||||
KeyboardHook.KeyPress(Keys.VolumeUp);
|
KeyboardHook.KeyPress(Keys.VolumeUp);
|
||||||
return;
|
return;
|
||||||
case Keys.F4:
|
case Keys.F4:
|
||||||
KeyProcess("m3");
|
ToggleMic();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -313,7 +313,7 @@ namespace GHelper.Input
|
|||||||
HandleEvent(126); // Emojis
|
HandleEvent(126); // Emojis
|
||||||
return;
|
return;
|
||||||
case Keys.F9:
|
case Keys.F9:
|
||||||
KeyProcess("m3"); // MicMute
|
ToggleMic(); // MicMute
|
||||||
return;
|
return;
|
||||||
case Keys.F10:
|
case Keys.F10:
|
||||||
HandleEvent(133); // Camera Toggle
|
HandleEvent(133); // Camera Toggle
|
||||||
@@ -414,7 +414,7 @@ namespace GHelper.Input
|
|||||||
{
|
{
|
||||||
if (e.Key == keyProfile) modeControl.CyclePerformanceMode();
|
if (e.Key == keyProfile) modeControl.CyclePerformanceMode();
|
||||||
if (e.Key == keyApp) Program.SettingsToggle();
|
if (e.Key == keyApp) Program.SettingsToggle();
|
||||||
if (e.Key == Keys.F20) KeyProcess("m3");
|
if (e.Key == Keys.F20) ToggleMic();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.Modifier == (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt))
|
if (e.Modifier == (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt))
|
||||||
@@ -567,9 +567,7 @@ namespace GHelper.Input
|
|||||||
ToggleFnLock();
|
ToggleFnLock();
|
||||||
break;
|
break;
|
||||||
case "micmute":
|
case "micmute":
|
||||||
bool muteStatus = Audio.ToggleMute();
|
ToggleMic();
|
||||||
Program.toast.RunToast(muteStatus ? Properties.Strings.Muted : Properties.Strings.Unmuted, muteStatus ? ToastIcon.MicrophoneMute : ToastIcon.Microphone);
|
|
||||||
if (AppConfig.IsVivoZenbook()) Program.acpi.DeviceSet(AsusACPI.MicMuteLed, muteStatus ? 1 : 0, "MicmuteLed");
|
|
||||||
break;
|
break;
|
||||||
case "brightness_up":
|
case "brightness_up":
|
||||||
SetBrightness(true);
|
SetBrightness(true);
|
||||||
@@ -602,6 +600,14 @@ namespace GHelper.Input
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void ToggleMic()
|
||||||
|
{
|
||||||
|
bool muteStatus = Audio.ToggleMute();
|
||||||
|
Program.toast.RunToast(muteStatus ? Properties.Strings.Muted : Properties.Strings.Unmuted, muteStatus ? ToastIcon.MicrophoneMute : ToastIcon.Microphone);
|
||||||
|
if (AppConfig.IsVivoZenbook()) Program.acpi.DeviceSet(AsusACPI.MicMuteLed, muteStatus ? 1 : 0, "MicmuteLed");
|
||||||
|
}
|
||||||
|
|
||||||
static bool GetTouchpadState()
|
static bool GetTouchpadState()
|
||||||
{
|
{
|
||||||
using (var key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad\Status", false))
|
using (var key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad\Status", false))
|
||||||
|
|||||||
Reference in New Issue
Block a user