void OnKeysReleased(object sender, CompoundKeyBind e) { if (Logic.Configuration.Mode == Articulate.ListenMode.PushToArm) return; // Don't disable if we're armed if (Logic.Configuration.Mode == Articulate.ListenMode.Continuous) return; PushToTalkRelease.Reset(); ThreadPool.RegisterWaitForSingleObject(PushToTalkRelease, (state, completed) => { if (completed) Dispatcher.Invoke(() => { Enabled = Logic.Configuration.Mode == Articulate.ListenMode.Continuous || Logic.Configuration.Mode == Articulate.ListenMode.PushToIgnore; }); }, null, 500, true); }
void OnKeysPressed(object sender, CompoundKeyBind e) { if (Logic.Configuration.Mode == Articulate.ListenMode.Continuous) return; PushToTalkRelease.Set(); if (Enabled && Logic.Configuration.Mode == Articulate.ListenMode.PushToArm) Enabled = false; else Enabled = Logic.Configuration.Mode == Articulate.ListenMode.PushToTalk || Logic.Configuration.Mode == Articulate.ListenMode.PushToArm; }