Skip to content

Commit 6625e91

Browse files
Use default SpecialKeyState
1 parent 798d30e commit 6625e91

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ private async Task OpenResultAsync(string index)
286286
var hideWindow = await result.ExecuteAsync(new ActionContext
287287
{
288288
// not null means pressing modifier key + number, should ignore the modifier key
289-
SpecialKeyState = index is not null ? new SpecialKeyState() : GlobalHotkey.CheckModifiers()
289+
SpecialKeyState = index is not null ? SpecialKeyState.Default : GlobalHotkey.CheckModifiers()
290290
})
291291
.ConfigureAwait(false);
292292

0 commit comments

Comments
 (0)