Skip to content

Commit

Permalink
Merge pull request blish-hud#968 from dlamkins/dev
Browse files Browse the repository at this point in the history
Resolve edge case when primary key is technically a modifier.
  • Loading branch information
dlamkins authored May 8, 2024
2 parents 6751dca + f3ff92a commit 4293c85
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Blish HUD/GameServices/Input/Keyboard/KeyBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ namespace Blish_HUD.Input {
/// Allows for actions to be ran as the result of a provided key combination.
/// </summary>
public class KeyBinding {

private static readonly HashSet<Keys> _acceptedPrimaryModifierKeys = new HashSet<Keys>() { Keys.LeftAlt, Keys.RightAlt, Keys.LeftControl, Keys.RightControl, Keys.LeftShift, Keys.RightShift };

/// <summary>
/// Fires when the keys of the <see cref="KeyBinding"/> are changed.
/// </summary>
Expand Down Expand Up @@ -136,7 +139,7 @@ private void StopFiring() {
}

private void CheckTrigger(ModifierKeys activeModifiers, IEnumerable<Keys> pressedKeys) {
if (activeModifiers == this.ModifierKeys) {
if (activeModifiers == this.ModifierKeys || _acceptedPrimaryModifierKeys.Contains(_primaryKey)) {
if (this.BlockSequenceFromGw2) {
GameService.Input.Keyboard.StageKeyBinding(this);
}
Expand Down

0 comments on commit 4293c85

Please sign in to comment.