Skip to content

Commit 0660c4c

Browse files
authored
Merge pull request #2432 from Flow-Launcher/fix-open-result-modifier-key
Ignore modifier key when using key + number to launch result
2 parents 062c6b5 + 6625e91 commit 0660c4c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Flow.Launcher.Plugin/ActionContext.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,12 @@ public ModifierKeys ToModifierKeys()
5050
(AltPressed ? ModifierKeys.Alt : ModifierKeys.None) |
5151
(WinPressed ? ModifierKeys.Windows : ModifierKeys.None);
5252
}
53+
54+
public static readonly SpecialKeyState Default = new () {
55+
CtrlPressed = false,
56+
ShiftPressed = false,
57+
AltPressed = false,
58+
WinPressed = false
59+
};
5360
}
5461
}

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ private async Task OpenResultAsync(string index)
285285
}
286286
var hideWindow = await result.ExecuteAsync(new ActionContext
287287
{
288-
SpecialKeyState = GlobalHotkey.CheckModifiers()
288+
// not null means pressing modifier key + number, should ignore the modifier key
289+
SpecialKeyState = index is not null ? SpecialKeyState.Default : GlobalHotkey.CheckModifiers()
289290
})
290291
.ConfigureAwait(false);
291292

0 commit comments

Comments
 (0)