From c53acea225937947f97c3325f3ce84de06051e0e Mon Sep 17 00:00:00 2001 From: BDisp Date: Thu, 29 Oct 2020 15:05:07 +0000 Subject: [PATCH] Fixes #986. Comparing with ShortcutHelper.GetModifiersKey in the demo.cs --- Example/demo.cs | 4 +++- FSharpExample/Program.fs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Example/demo.cs b/Example/demo.cs index a763a4440..a381a7e2f 100644 --- a/Example/demo.cs +++ b/Example/demo.cs @@ -689,12 +689,14 @@ static class Demo { private static void Win_KeyPress (View.KeyEventEventArgs e) { - if ((e.KeyEvent.Key & (Key.CtrlMask | Key.T)) != 0) { + switch (ShortcutHelper.GetModifiersKey (e.KeyEvent)) { + case Key.CtrlMask | Key.T: if (menu.IsMenuOpen) menu.CloseMenu (); else menu.OpenMenu (); e.Handled = true; + break; } } } diff --git a/FSharpExample/Program.fs b/FSharpExample/Program.fs index eeee7a798..bc9fcbe82 100644 --- a/FSharpExample/Program.fs +++ b/FSharpExample/Program.fs @@ -425,7 +425,7 @@ let Main () = StatusItem(Key.F1, ustr "~F1~ Help", Action Help) StatusItem(Key.F2, ustr "~F2~ Load", Action Load) StatusItem(Key.F3, ustr "~F3~ Save", Action Save) - StatusItem(Key.ControlQ, ustr "~^Q~ Quit", fun () -> if (Quit()) then top.Running <- false) |]) + StatusItem(Key.Q, ustr "~^Q~ Quit", fun () -> if (Quit()) then top.Running <- false) |]) win.Add (drag, dragText) let bottom = new Label (ustr "This should go on the bottom of the same top-level!") win.Add bottom