Skip to content

Commit dcc4840

Browse files
Extract fixed hotkeys
1 parent 3b81c9a commit dcc4840

File tree

1 file changed

+42
-35
lines changed

1 file changed

+42
-35
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 42 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -282,42 +282,9 @@ public List<RegisteredHotkeyData> RegisteredHotkeys
282282
{
283283
get
284284
{
285-
var list = new List<RegisteredHotkeyData>
286-
{
287-
new("Up", "HotkeyLeftRightDesc"),
288-
new("Down", "HotkeyLeftRightDesc"),
289-
new("Left", "HotkeyUpDownDesc"),
290-
new("Right", "HotkeyUpDownDesc"),
291-
new("Escape", "HotkeyESCDesc"),
292-
new("F5", "ReloadPluginHotkey"),
293-
new("Alt+Home", "HotkeySelectFirstResult"),
294-
new("Alt+End", "HotkeySelectLastResult"),
295-
new("Ctrl+R", "HotkeyRequery"),
296-
new("Ctrl+H", "ToggleHistoryHotkey"),
297-
new("Ctrl+OemCloseBrackets", "QuickWidthHotkey"),
298-
new("Ctrl+OemOpenBrackets", "QuickWidthHotkey"),
299-
new("Ctrl+OemPlus", "QuickHeightHotkey"),
300-
new("Ctrl+OemMinus", "QuickHeightHotkey"),
301-
new("Ctrl+Shift+Enter", "HotkeyCtrlShiftEnterDesc"),
302-
new("Shift+Enter", "OpenContextMenuHotkey"),
303-
new("Enter", "HotkeyRunDesc"),
304-
new("Ctrl+Enter", "OpenContainFolderHotkey"),
305-
new("Alt+Enter", "HotkeyOpenResult"),
306-
new("Ctrl+F12", "ToggleGameModeHotkey"),
307-
new("Ctrl+Shift+C", "CopyFilePathHotkey"),
308-
309-
new($"{OpenResultModifiers}+D1", "HotkeyOpenResultN", 1),
310-
new($"{OpenResultModifiers}+D2", "HotkeyOpenResultN", 2),
311-
new($"{OpenResultModifiers}+D3", "HotkeyOpenResultN", 3),
312-
new($"{OpenResultModifiers}+D4", "HotkeyOpenResultN", 4),
313-
new($"{OpenResultModifiers}+D5", "HotkeyOpenResultN", 5),
314-
new($"{OpenResultModifiers}+D6", "HotkeyOpenResultN", 6),
315-
new($"{OpenResultModifiers}+D7", "HotkeyOpenResultN", 7),
316-
new($"{OpenResultModifiers}+D8", "HotkeyOpenResultN", 8),
317-
new($"{OpenResultModifiers}+D9", "HotkeyOpenResultN", 9),
318-
new($"{OpenResultModifiers}+D0", "HotkeyOpenResultN", 10)
319-
};
285+
var list = FixedHotkeys();
320286

287+
// Customizeable hotkeys
321288
if(!string.IsNullOrEmpty(Hotkey))
322289
list.Add(new(Hotkey, "flowlauncherHotkey", () => Hotkey = ""));
323290
if(!string.IsNullOrEmpty(PreviewHotkey))
@@ -347,6 +314,7 @@ public List<RegisteredHotkeyData> RegisteredHotkeys
347314
if (!string.IsNullOrEmpty(CycleHistoryDownHotkey))
348315
list.Add(new(CycleHistoryDownHotkey, "CycleHistoryDownHotkey", () => CycleHistoryDownHotkey = ""));
349316

317+
// Custom Query Hotkeys
350318
foreach (var customPluginHotkey in CustomPluginHotkeys)
351319
{
352320
if (!string.IsNullOrEmpty(customPluginHotkey.Hotkey))
@@ -356,6 +324,45 @@ public List<RegisteredHotkeyData> RegisteredHotkeys
356324
return list;
357325
}
358326
}
327+
328+
private List<RegisteredHotkeyData> FixedHotkeys()
329+
{
330+
return new List<RegisteredHotkeyData>
331+
{
332+
new("Up", "HotkeyLeftRightDesc"),
333+
new("Down", "HotkeyLeftRightDesc"),
334+
new("Left", "HotkeyUpDownDesc"),
335+
new("Right", "HotkeyUpDownDesc"),
336+
new("Escape", "HotkeyESCDesc"),
337+
new("F5", "ReloadPluginHotkey"),
338+
new("Alt+Home", "HotkeySelectFirstResult"),
339+
new("Alt+End", "HotkeySelectLastResult"),
340+
new("Ctrl+R", "HotkeyRequery"),
341+
new("Ctrl+H", "ToggleHistoryHotkey"),
342+
new("Ctrl+OemCloseBrackets", "QuickWidthHotkey"),
343+
new("Ctrl+OemOpenBrackets", "QuickWidthHotkey"),
344+
new("Ctrl+OemPlus", "QuickHeightHotkey"),
345+
new("Ctrl+OemMinus", "QuickHeightHotkey"),
346+
new("Ctrl+Shift+Enter", "HotkeyCtrlShiftEnterDesc"),
347+
new("Shift+Enter", "OpenContextMenuHotkey"),
348+
new("Enter", "HotkeyRunDesc"),
349+
new("Ctrl+Enter", "OpenContainFolderHotkey"),
350+
new("Alt+Enter", "HotkeyOpenResult"),
351+
new("Ctrl+F12", "ToggleGameModeHotkey"),
352+
new("Ctrl+Shift+C", "CopyFilePathHotkey"),
353+
354+
new($"{OpenResultModifiers}+D1", "HotkeyOpenResultN", 1),
355+
new($"{OpenResultModifiers}+D2", "HotkeyOpenResultN", 2),
356+
new($"{OpenResultModifiers}+D3", "HotkeyOpenResultN", 3),
357+
new($"{OpenResultModifiers}+D4", "HotkeyOpenResultN", 4),
358+
new($"{OpenResultModifiers}+D5", "HotkeyOpenResultN", 5),
359+
new($"{OpenResultModifiers}+D6", "HotkeyOpenResultN", 6),
360+
new($"{OpenResultModifiers}+D7", "HotkeyOpenResultN", 7),
361+
new($"{OpenResultModifiers}+D8", "HotkeyOpenResultN", 8),
362+
new($"{OpenResultModifiers}+D9", "HotkeyOpenResultN", 9),
363+
new($"{OpenResultModifiers}+D0", "HotkeyOpenResultN", 10)
364+
};
365+
}
359366
}
360367

361368
public enum LastQueryMode

0 commit comments

Comments
 (0)