public bool ShortcutValidator(SRValidator aValidator, ushort aKeyCode, NSEventModifierMask aFlags, out string outReason)
        {
            outReason = string.Empty;

            var recorder = View.Window.FirstResponder as SRRecorderControl;

            if (recorder == null)
            {
                return(false);
            }

            var shortcut = CFunctions.SRShortcutWithCocoaModifierFlagsAndKeyCode(aFlags, aKeyCode);

            if (IsTaken(pingShortcutRecorder, shortcut) ||
                IsTaken(globalPingShortcutRecorder, shortcut) ||
                IsTaken(pingItemShortcutRecorder, shortcut))
            {
                outReason = "it's already used. To use this shortcut, first remove or change the other shortcut";
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        public bool ShortcutValidator(SRValidator aValidator, ushort aKeyCode, NSEventModifierMask aFlags, out string outReason)
        {
            outReason = string.Empty;

            if (!(FirstResponder is SRRecorderControl recorder))
            {
                return(false);
            }

            var shortcut = CFunctions.SRShortcutWithCocoaModifierFlagsAndKeyCode(aFlags, aKeyCode);

            if (IsTaken(WdgRecorderScanSelect, shortcut) ||
                IsTaken(WdgRecorderScanClick, shortcut))
            {
                outReason = "it's already used. To use this shortcut, first remove or change the other shortcut";
                return(true);
            }

            return(false);
        }