Browse Source

Shift+F10 is windows specific gesture

Max Katz 4 years ago
parent
commit
c5a498e563

+ 5 - 4
src/Avalonia.Input/Platform/PlatformHotkeyConfiguration.cs

@@ -1,14 +1,16 @@
 using System.Collections.Generic;
 
+#nullable enable
+
 namespace Avalonia.Input.Platform
 {
     public class PlatformHotkeyConfiguration
     {
         public PlatformHotkeyConfiguration() : this(KeyModifiers.Control)
         {
-            
+
         }
-        
+
         public PlatformHotkeyConfiguration(KeyModifiers commandModifiers,
             KeyModifiers selectionModifiers = KeyModifiers.Shift,
             KeyModifiers wholeWordTextActionModifiers = KeyModifiers.Control)
@@ -75,8 +77,7 @@ namespace Avalonia.Input.Platform
             };
             OpenContextMenu = new List<KeyGesture>
             {
-                new KeyGesture(Key.F10, KeyModifiers.Shift),
-                new KeyGesture(Key.Apps),
+                new KeyGesture(Key.Apps)
             };
         }
 

+ 8 - 1
src/Windows/Avalonia.Win32/Win32Platform.cs

@@ -112,7 +112,14 @@ namespace Avalonia.Win32
                 .Bind<IRenderTimer>().ToConstant(new DefaultRenderTimer(60))
                 .Bind<ISystemDialogImpl>().ToSingleton<SystemDialogImpl>()
                 .Bind<IWindowingPlatform>().ToConstant(s_instance)
-                .Bind<PlatformHotkeyConfiguration>().ToSingleton<PlatformHotkeyConfiguration>()
+                .Bind<PlatformHotkeyConfiguration>().ToConstant(new PlatformHotkeyConfiguration(KeyModifiers.Control)
+                {
+                    OpenContextMenu =
+                    {
+                        // Add Shift+F10
+                        new KeyGesture(Key.F10, KeyModifiers.Shift)
+                    }
+                })
                 .Bind<IPlatformIconLoader>().ToConstant(s_instance)
                 .Bind<NonPumpingLockHelper.IHelperImpl>().ToConstant(new NonPumpingSyncContext.HelperImpl())
                 .Bind<IMountedVolumeInfoProvider>().ToConstant(new WindowsMountedVolumeInfoProvider());