File tree Expand file tree Collapse file tree 3 files changed +23
-13
lines changed
Plugins/Flow.Launcher.Plugin.Program/Programs Expand file tree Collapse file tree 3 files changed +23
-13
lines changed Original file line number Diff line number Diff line change 348
348
<system : String x : Key =" HotkeyUpDownDesc" >Back / Context Menu</system : String >
349
349
<system : String x : Key =" HotkeyLeftRightDesc" >Item Navigation</system : String >
350
350
<system : String x : Key =" HotkeyShiftEnterDesc" >Open Context Menu</system : String >
351
- <system : String x : Key =" HotkeyCtrlEnterDesc" >Open A File/Folder's Containing Folder</system : String >
351
+ <system : String x : Key =" HotkeyCtrlEnterDesc" >Open Containing Folder</system : String >
352
352
<system : String x : Key =" HotkeyCtrlShiftEnterDesc" >Run as Admin / Open Folder in Default File Manager</system : String >
353
353
<system : String x : Key =" HotkeyCtrlHDesc" >Query History</system : String >
354
354
<system : String x : Key =" HotkeyESCDesc" >Back to Result in Context Menu</system : String >
Original file line number Diff line number Diff line change 14
14
using System . Threading . Channels ;
15
15
using System . Xml ;
16
16
using Windows . ApplicationModel . Core ;
17
+ using System . Windows . Input ;
17
18
18
19
namespace Flow . Launcher . Plugin . Program . Programs
19
20
{
@@ -422,12 +423,16 @@ public Result Result(string query, IPublicAPI api)
422
423
ContextData = this ,
423
424
Action = e =>
424
425
{
425
- var elevated = (
426
- e . SpecialKeyState . CtrlPressed &&
427
- e . SpecialKeyState . ShiftPressed &&
428
- ! e . SpecialKeyState . AltPressed &&
429
- ! e . SpecialKeyState . WinPressed
430
- ) ;
426
+ // Ctrl + Enter to open containing folder
427
+ bool openFolder = e . SpecialKeyState . ToModifierKeys ( ) == ModifierKeys . Control ;
428
+ if ( openFolder )
429
+ {
430
+ Main . Context . API . OpenDirectory ( Location ) ;
431
+ return true ;
432
+ }
433
+
434
+ // Ctrl + Shift + Enter to run elevated
435
+ bool elevated = e . SpecialKeyState . ToModifierKeys ( ) == ( ModifierKeys . Control | ModifierKeys . Shift ) ;
431
436
432
437
bool shouldRunElevated = elevated && CanRunElevated ;
433
438
_ = Task . Run ( ( ) => Launch ( shouldRunElevated ) ) . ConfigureAwait ( false ) ;
Original file line number Diff line number Diff line change 16
16
using System . Threading . Channels ;
17
17
using Flow . Launcher . Plugin . Program . Views . Models ;
18
18
using IniParser ;
19
+ using System . Windows . Input ;
19
20
20
21
namespace Flow . Launcher . Plugin . Program . Programs
21
22
{
@@ -169,12 +170,16 @@ public Result Result(string query, IPublicAPI api)
169
170
ContextData = this ,
170
171
Action = c =>
171
172
{
172
- var runAsAdmin = (
173
- c . SpecialKeyState . CtrlPressed &&
174
- c . SpecialKeyState . ShiftPressed &&
175
- ! c . SpecialKeyState . AltPressed &&
176
- ! c . SpecialKeyState . WinPressed
177
- ) ;
173
+ // Ctrl + Enter to open containing folder
174
+ bool openFolder = c . SpecialKeyState . ToModifierKeys ( ) == ModifierKeys . Control ;
175
+ if ( openFolder )
176
+ {
177
+ Main . Context . API . OpenDirectory ( ParentDirectory , FullPath ) ;
178
+ return true ;
179
+ }
180
+
181
+ // Ctrl + Shift + Enter to run as admin
182
+ bool runAsAdmin = c . SpecialKeyState . ToModifierKeys ( ) == ( ModifierKeys . Control | ModifierKeys . Shift ) ;
178
183
179
184
var info = new ProcessStartInfo
180
185
{
You can’t perform that action at this time.
0 commit comments