diff --git a/client/src/keybind.c b/client/src/keybind.c index 16b60bae..e6532133 100644 --- a/client/src/keybind.c +++ b/client/src/keybind.c @@ -139,6 +139,27 @@ void keybind_commonRegister(void) "Toggle overlay"); } +#if ENABLE_AUDIO +static void bind_toggleMicDefault(int sc, void * opaque) +{ + g_state.micDefaultState = (g_state.micDefaultState + 1) % MIC_DEFAULT_MAX; + + switch (g_state.micDefaultState) + { + case MIC_DEFAULT_PROMPT: + app_alert(LG_ALERT_INFO, "Microphone access will prompt"); + break; + + case MIC_DEFAULT_ALLOW: + app_alert(LG_ALERT_INFO, "Microphone access allowed by default"); + break; + + case MIC_DEFAULT_DENY: + app_alert(LG_ALERT_INFO, "Microphone access denied by default"); + } +} +#endif + void keybind_spiceRegister(void) { /* register the common keybinds for spice */ @@ -170,6 +191,8 @@ void keybind_spiceRegister(void) { app_registerKeybind(0, 'E', audio_recordToggleKeybind, NULL, "Toggle audio recording"); + app_registerKeybind(0, 'C', bind_toggleMicDefault, NULL, + "Cycle audio recording default"); } #endif diff --git a/client/src/main.h b/client/src/main.h index 74279936..9769cc45 100644 --- a/client/src/main.h +++ b/client/src/main.h @@ -50,6 +50,7 @@ enum MicDefaultState { MIC_DEFAULT_ALLOW, MIC_DEFAULT_DENY }; +#define MIC_DEFAULT_MAX (MIC_DEFAULT_DENY + 1) struct AppState {