Exemple #1
0
 private static void SceneControl_ContextMenu_Undo(object sender, EventArgs e)
 {
     HotKeyCtlZPressed?.Invoke(null, null);
 }
Exemple #2
0
        public static bool ProcessKeyPress(ref Message msg, Keys keyData)
        {
            frmStudioMain.SceneControl.ModelContextFormMenu.Close(true);
            frmStudioMain.SceneControl.SupportConeContextFormMenu.Close(true);

            var keyPressHandled = false;

            var shortcutKeys = new List <Keys>()
            {
                Keys.D,
                Keys.F,
                Keys.G,
                Keys.O,
                Keys.M,
                Keys.P,
                Keys.Q,
                Keys.R,
                Keys.S,
                Keys.X,
                Keys.Z,
                Keys.Delete,
                (Keys.Control | Keys.C),
                (Keys.Control | Keys.P),
                (Keys.Control | Keys.Z),
            };

            if (shortcutKeys.Contains(keyData))
            {
                //skip all toolbar controls when they are focussed
                if (SceneControlToolbarManager.PrintJobProperties.IsPrintJobNameFocused)
                {
                    return(keyPressHandled);
                }
                else
                {
                    switch (keyData)
                    {
                    case Keys.D:
                        keyPressHandled = true;
                        HotKeyDPressed?.Invoke(null, null);
                        break;

                    case Keys.F:
                        keyPressHandled = true;
                        HotKeyFPressed?.Invoke(null, null);
                        break;

                    case Keys.G:
                        keyPressHandled = true;
                        HotKeyGPressed?.Invoke(null, null);
                        break;

                    case Keys.M:
                        keyPressHandled = true;
                        HotKeyMPressed?.Invoke(null, null);
                        break;

                    case Keys.O:
                        keyPressHandled = true;
                        HotKeyOPressed?.Invoke(null, null);
                        break;

                    case Keys.P:
                        keyPressHandled = true;
                        HotKeyPPressed?.Invoke(null, null);
                        break;

                    case Keys.Q:
                        keyPressHandled = true;
                        HotKeyQPressed?.Invoke(null, null);
                        break;

                    case Keys.R:
                        keyPressHandled = true;
                        HotKeyRPressed?.Invoke(null, null);
                        break;

                    case Keys.S:
                        keyPressHandled = true;
                        HotKeySPressed?.Invoke(null, null);
                        break;

                    case Keys.X:
                        keyPressHandled = true;
                        HotKeyXPressed?.Invoke(null, null);
                        break;

                    case Keys.Z:
                        keyPressHandled = true;
                        HotKeyZPressed?.Invoke(null, null);
                        break;

                    case Keys.Delete:
                        if (!IsInExportMode && !SceneActionControlManager.IsSupportPropertiesVisible)
                        {
                            keyPressHandled = true;
                            HotKeyDelPressed?.Invoke(null, null);
                        }
                        break;

                    case (Keys.Control | Keys.C):
                        keyPressHandled = true;
                        HotKeyCtlCPressed?.Invoke(null, null);
                        break;

                    case (Keys.Control | Keys.P):
                        keyPressHandled = true;
                        HotKeyCtlPPressed?.Invoke(null, null);
                        break;

                    case (Keys.Control | Keys.Z):
                        keyPressHandled = true;
                        HotKeyCtlZPressed?.Invoke(null, null);
                        break;
                    }
                }
            }

            return(keyPressHandled);
        }