void Update()
    {
        if (ExclusiveFocus.hasFocus)
        {
            return;
        }

        if (!KeyboardShortcuts.ModifierDown() && patternView.IsCurrentPatternValid())
        {
            for (int i = 0; i < noteBinds.Length; i++)
            {
                if (noteBinds[i].GetNoteDown(m_CurrentOctave))
                {
                    if (noteBinds[i].note != Note.None)
                    {
                        SetNoteOn(noteBinds [i].note, m_CurrentOctave + noteBinds [i].octaveOffset);
                    }
                }
            }
        }

        for (int i = 0; i < noteBinds.Length; i++)
        {
            if (noteBinds [i].GetNoteUp( ))
            {
                SetNoteOff(noteBinds [i].note, m_CurrentOctave + noteBinds [i].octaveOffset);
            }
        }
    }
        internal async void HandleKeyboardShortcut(KeyboardShortcuts keyboardShortcut)
        {
            LOG.DebugFormat("HandleKeyboardShortcut - KeyboardShortcut: {0}", keyboardShortcut);

            if (keyboardShortcut == KeyboardShortcuts.NewTab)
            {
                await StartNewProcess();
            }
            else if (keyboardShortcut == KeyboardShortcuts.NextTab)
            {
                ProcessTabs.NextTab();
            }
            else if (keyboardShortcut == KeyboardShortcuts.PreviousTab)
            {
                ProcessTabs.PreviousTab();
            }
            else if (keyboardShortcut == KeyboardShortcuts.CloseTab)
            {
                CloseTab(ProcessTabs.SelectedTab);
            }
            else
            {
                LOG.ErrorFormat("Unhandled keyboard shortcut - KeyboardShortcut: {0}", keyboardShortcut);
            }
        }
        internal async void HandleKeyboardShortcut(KeyboardShortcuts keyboardShortcut)
        {
            LOG.Debug($"{nameof( HandleKeyboardShortcut )} - KeyboardShortcut: {keyboardShortcut}");

            if (keyboardShortcut == KeyboardShortcuts.NewTab)
            {
                await FindRepo();
            }
            else if (keyboardShortcut == KeyboardShortcuts.NextTab)
            {
                LogTabs.NextTab();
            }
            else if (keyboardShortcut == KeyboardShortcuts.PreviousTab)
            {
                LogTabs.PreviousTab();
            }
            else if (keyboardShortcut == KeyboardShortcuts.DuplicateTab)
            {
                if (LogTabs.SelectedTab is Tab selectedTab)
                {
                    await DuplicateTab(selectedTab);
                }
            }
            else if (keyboardShortcut == KeyboardShortcuts.CloseTab)
            {
                if (LogTabs.SelectedTab is Tab selectedTab)
                {
                    CloseTab(selectedTab);
                }
            }
            else if (keyboardShortcut == KeyboardShortcuts.ReopenClosedTab)
            {
                if (_closedRepos.Count > 0)
                {
                    String repo = _closedRepos.Pop();

                    LOG.Debug($"HotKey - Reopen Closed Tab - Reopening: {repo}");

                    await OpenLog(repo);
                }
            }
            else if (keyboardShortcut == KeyboardShortcuts.ToggleReferencesDisplay)
            {
                SplitLayout.Panel1Collapsed = !SplitLayout.Panel1Collapsed;
            }
            else if (KEYBOARD_SHORTCUT_ACTIONS.ContainsKey(keyboardShortcut))
            {
                if (LogTabs.SelectedTab?.Controller() is TabControllerTag tag)
                {
                    GitActionFunc gitActionFunc = KEYBOARD_SHORTCUT_ACTIONS[keyboardShortcut];

                    await RunGitAction(tag, gitActionFunc);
                }
            }
            else
            {
                LOG.Error($"Unhandled keyboard shortcut - KeyboardShortcut: {keyboardShortcut}");
            }
        }
Example #4
0
        private void Hotkey_HotKeyPressed(object sender, EventArgs e)
        {
            HotKey hotkey = (HotKey)sender;

            KeyboardShortcuts keyboardShortcut = _hotkeys.Where(pair => pair.Value == hotkey).First().Key;

            OnKeyboardShortcutPressed(new KeyboardShortcutPressedEventArgs(keyboardShortcut));
        }
        public ShortcutInfo(ShortcutName name, KeyboardShortcuts shortcuts)
        {
            _shortcuts = shortcuts;
            _name      = name;

            Name = s_loader.GetString(name.ToString());

            Debug.Assert(!string.IsNullOrWhiteSpace(Name), "A resource string must be available for the shortcut");
        }
Example #6
0
 private void Awake()
 {
     direction       = 3;
     speed           = 2.5f;
     animator        = GetComponent <Animator>();
     currentScene    = SceneManager.GetActiveScene();
     blockcontroller = GameObject.FindObjectOfType <BlockController>();
     boxes           = GetComponents <BoxCollider2D>();
     kbshortcuts     = GameObject.FindObjectOfType <KeyboardShortcuts>();
 }
        private async void TextEditor_PreviewKeyDown(TextEditor lineEditor, KeyEventArgs e)
        {
            if (completionWindow?.IsVisible ?? false)
            {
                return;
            }

            var command = KeyboardShortcuts.MapToCommand(e);

            if (!command.HasValue)
            {
                return;
            }

            e.Handled = true;
            switch (command.Value)
            {
            case ReplCommand.EvaluateCurrentLine:
                await ReadEvalPrintLoop(lineEditor.ViewModel(), stayOnCurrentLine : false);

                return;

            case ReplCommand.ReevaluateCurrentLine:
                await ReadEvalPrintLoop(lineEditor.ViewModel(), stayOnCurrentLine : true);

                return;

            case ReplCommand.OpenIntellisense:
                await CompleteCode(lineEditor);

                return;

            case ReplCommand.GoToFirstLine:
                Model.FocusIndex = 0;
                return;

            case ReplCommand.GoToLastLine:
                Model.FocusIndex = Model.Entries.Count - 1;
                return;

            case ReplCommand.LineDown when lineEditor.IsCaretOnFinalLine():
                Model.FocusIndex++;

                return;

            case ReplCommand.LineUp when lineEditor.IsCaretOnFirstLine():
                Model.FocusIndex--;

                return;

            default:
                e.Handled = false;
                break;
            }
        }
        private async Task <IEnumerable <String> > ImportUserAsync(APIOptions apiOptions, IGenericRepository <kCura.Relativity.Client.DTOs.User> userRepository)
        {
            List <String> violations = new List <string>();

            kCura.Relativity.Client.DTOs.User user = null;
            try
            {
                apiOptions.WorkspaceID = -1;
                user = new kCura.Relativity.Client.DTOs.User()
                {
                    FirstName                     = (String)await FirstName.GetDataValueAsync(),
                    LastName                      = (String)await LastName.GetDataValueAsync(),
                    EmailAddress                  = (String)await EmailAddress.GetDataValueAsync(),
                    Groups                        = _groupList,
                    Type                          = _userType,
                    Client                        = _client,
                    RelativityAccess              = ((Boolean?)await RelativityAccess.GetDataValueAsync()).GetValueOrDefault(),
                    DocumentSkip                  = _documentSkip,
                    BetaUser                      = ((Boolean?)await BetaUser.GetDataValueAsync()).GetValueOrDefault(),
                    ChangeSettings                = ((Boolean?)await ChangeSettings.GetDataValueAsync()).GetValueOrDefault(),
                    KeyboardShortcuts             = ((Boolean?)await KeyboardShortcuts.GetDataValueAsync()).GetValueOrDefault(),
                    ItemListPageLength            = ((Int32?)await ItemListPageLength.GetDataValueAsync()).GetValueOrDefault(),
                    DefaultSelectedFileType       = _defaultSelectedFileType,
                    SkipDefaultPreference         = _skipDefaultPreference,
                    EnforceViewerCompatibility    = ((Boolean?)await EnforceViewerCompatibility.GetDataValueAsync()).GetValueOrDefault(),
                    AdvancedSearchPublicByDefault = ((Boolean?)await AdvancedSearchPublicByDefault.GetDataValueAsync()).GetValueOrDefault(),
                    NativeViewerCacheAhead        = ((Boolean?)await NativeViewerCacheAhead.GetDataValueAsync()).GetValueOrDefault(),
                    CanChangeDocumentViewer       = ((Boolean?)await ChangeDocumentViewer.GetDataValueAsync()).GetValueOrDefault(),
                    DocumentViewer                = _documentViewer,
                    TrustedIPs                    = String.Empty,
                    ChangePassword                = ((Boolean?)await CanChangePassword.GetDataValueAsync()).GetValueOrDefault(),
                    MaximumPasswordAge            = ((Int32?)await MaximumPasswordAgeInDays.GetDataValueAsync()).GetValueOrDefault(),
                    DataFocus                     = 1, // This field is no longer utilized in Relativity, however it's hardcoded because it is required
                    ChangePasswordNextLogin       = ((Boolean?)await UserMustChangePasswordOnNextLogin.GetDataValueAsync()).GetValueOrDefault()
                };

                ArtifactId = userRepository.CreateSingle(user);
            }
            catch (Exception ex)
            {
                String msg = null;
                if (ex.ToString().Contains("The entered E-Mail Address is already associated with a user") && user != null && !String.IsNullOrWhiteSpace(user.EmailAddress))
                {
                    msg = String.Format(Constant.ErrorMessages.UserAlreadyExists, user.EmailAddress);
                }
                else
                {
                    msg = ex.ToString();
                }
                violations.Add(msg);
            }
            return(violations);
        }
Example #9
0
 private void Awake()
 {
     direction       = 3;
     speed           = 2.5f;
     a               = GetComponent <AreaEffector2D>();
     block           = GameObject.FindGameObjectWithTag("block");
     myPhotonView    = GetComponent <PhotonView>();
     animator        = GetComponent <Animator>();
     currentScene    = SceneManager.GetActiveScene();
     blockcontroller = GameObject.FindObjectOfType <BlockController>();
     boxes           = GetComponents <BoxCollider2D>();
     kbshortcuts     = GameObject.FindObjectOfType <KeyboardShortcuts>();
 }
Example #10
0
        public bool HandleKey(Key key, bool isControl, bool isAlt, bool isShift, bool isExternal)
        {
            var shortcut = KeyboardShortcuts.FirstOrDefault(ks => ks.Key == key &&
                                                            ks.Control == isControl &&
                                                            ks.Alt == isAlt &&
                                                            ks.Shift == isShift &&
                                                            ks.External == isExternal);

            if (shortcut != null)
            {
                return(shortcut.Execute(PlayerActions));
            }

            return(false);
        }
Example #11
0
        public async Task HandleKeyDown(WindowViewModel windowvm, LineViewModel linevm, KeyEventArgs e)
        {
            if (windowvm.IsIntellisenseWindowOpen)
            {
                return;
            }

            int previousHistoryPointer = ResetHistoryCyclePointer(windowvm);

            if (KeyboardShortcuts.MapToCommand(e) is ReplCommand command)
            {
                e.Handled = true; // tricky! we're in an async void event handler. WPF will see this value
                                  // first, as the event handler will complete before our task is does.
                e.Handled = await HandleCommand(windowvm, linevm, command, previousHistoryPointer);
            }
        }
Example #12
0
    // Update is called once per frame
    void Update()
    {
        if (ExclusiveFocus.hasFocus)
        {
            return;
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            selection.color = recording ? selectionRecording : selectionNormal;
            recording       = !recording;
        }

        if (recording && !KeyboardShortcuts.ModifierDown())
        {
            int maxLen = m_CurrentPosition.dataColumn == 2 ? 1 : 2;

            if (m_CurrentPosition.dataColumn != 0 && Input.inputString.Length > 0)
            {
                if (selectedLine + m_CurrentPosition.dataColumn != m_InputPos)
                {
                    m_InputPos = selectedLine + m_CurrentPosition.dataColumn;
                    m_Input    = System.String.Empty;
                }
                m_Input += Input.inputString[0];

                int res;
                if (int.TryParse(m_Input, System.Globalization.NumberStyles.HexNumber, null, out res))
                {
                    SetDataAtSelection(res);
                }
                else
                {
                    m_Input = m_Input.Substring(0, m_Input.Length - 1);
                }

                if (m_Input.Length >= maxLen)
                {
                    MoveVertical(1);
                    m_Input = System.String.Empty;
                }
            }
        }
    }
Example #13
0
 private bool NavigationKeyBehaviorContains(KeyboardShortcuts shortcut)
 {
     return (m_navigationKeyBehavior & shortcut) == shortcut;
 }
Example #14
0
 public SettingsPageViewModel(LoggingPageViewModel logViewModel, KeePassSettings settings, KeyboardShortcuts shortcuts)
 {
     Logging   = logViewModel;
     Settings  = settings;
     Shortcuts = shortcuts;
 }
Example #15
0
 public KeyboardShortcutPressedEventArgs(KeyboardShortcuts keyboardShortcut)
 {
     KeyboardShortcut = keyboardShortcut;
 }
Example #16
0
        private void ShortcutDescriptionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var shortcuts = new KeyboardShortcuts();

            shortcuts.Show();
        }