Completed
Last Updated: 06 Mar 2023 15:23 by ADMIN
Release R1 2023 SP1
Petar
Created on: 17 Feb 2023 09:24
Category: SyntaxEditor
Type: Bug Report
1
SyntaxEditor: Registering Ctrl + Enter keybinding to command results in command not executing when pressing Ctrl+Enter
Enter key is improperly handled internally and this results in inability to use the key in combination with other modifier keys for custom commands.

For example this custom code completion command does not fire when pressing Ctrl + Enter:

        private void syntaxEditor_Loaded(object sender, RoutedEventArgs e)
        {
            var completionCommand = this.syntaxEditor.Commands.CodeCompletionCommand;
            InputBinding keyBinding = null;
            foreach (InputBinding item in this.syntaxEditor.EditorPresenter.Caret.InputBindings)
            {
                if (item.Command == completionCommand)
                {
                    keyBinding = item;
                    break;
                }
            }

            // unregister old key binding via Caret InputBindings
            this.syntaxEditor.EditorPresenter.Caret.InputBindings.Remove(keyBinding);

            // register new command in Syntaxeditor
            this.syntaxEditor.KeyBindings.RegisterCommand(completionCommand, Key.Enter, ModifierKeys.Control);
        }
0 comments