feat: add keybind mode options

This commit is contained in:
Anna
2022-02-08 15:20:10 -05:00
parent e1e3a39c5c
commit f70b23a476
5 changed files with 65 additions and 2 deletions
+6 -1
View File
@@ -221,7 +221,12 @@ internal sealed class ChatLog : IUiComponent {
}
void Intercept(VirtualKey key, ModifierFlag modifier) {
if (!ImGui.IsKeyPressed((int) key) || !modifierState.HasFlag(modifier) || modifier == 0 && modifiersOnly) {
var modifierPressed = this.Ui.Plugin.Config.KeybindMode switch {
KeybindMode.Strict => modifier == modifierState,
KeybindMode.Flexible => modifierState.HasFlag(modifier),
_ => false,
};
if (!ImGui.IsKeyPressed((int) key) || !modifierPressed || modifier == 0 && modifiersOnly) {
return;
}