mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[client] keybind: add ScrollLock+C to cycle microphone defaults
This makes it possible to change the default action taken the next time an application tries to open the microphone without restarting the client.
This commit is contained in:
parent
ae38db4915
commit
eb1774f955
@ -139,6 +139,27 @@ void keybind_commonRegister(void)
|
|||||||
"Toggle overlay");
|
"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)
|
void keybind_spiceRegister(void)
|
||||||
{
|
{
|
||||||
/* register the common keybinds for spice */
|
/* register the common keybinds for spice */
|
||||||
@ -170,6 +191,8 @@ void keybind_spiceRegister(void)
|
|||||||
{
|
{
|
||||||
app_registerKeybind(0, 'E', audio_recordToggleKeybind, NULL,
|
app_registerKeybind(0, 'E', audio_recordToggleKeybind, NULL,
|
||||||
"Toggle audio recording");
|
"Toggle audio recording");
|
||||||
|
app_registerKeybind(0, 'C', bind_toggleMicDefault, NULL,
|
||||||
|
"Cycle audio recording default");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ enum MicDefaultState {
|
|||||||
MIC_DEFAULT_ALLOW,
|
MIC_DEFAULT_ALLOW,
|
||||||
MIC_DEFAULT_DENY
|
MIC_DEFAULT_DENY
|
||||||
};
|
};
|
||||||
|
#define MIC_DEFAULT_MAX (MIC_DEFAULT_DENY + 1)
|
||||||
|
|
||||||
struct AppState
|
struct AppState
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user