We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Is this proper way to disable shortcut keys of SfRichTextBoxAdv?

In my program, I want to manually process the New/Open/Save commands, but SfRichTextBoxAdv takes priority of those hotkeys. Therefore currently I use this code to remove them:

        public MainWindow()
        {
            InitializeComponent();

            var removingGestures = new List<InputBinding>();
            foreach (InputBinding inputBinding in this.documentEditor.InputBindings)
            {
                var gesture = inputBinding.Gesture as KeyGesture;

                if (gesture != null && gesture.Modifiers == ModifierKeys.Control)
                {
                    if (gesture.Key == Key.O) { removingGestures.Add(inputBinding); }
                    if (gesture.Key == Key.S) { removingGestures.Add(inputBinding); }
                    if (gesture.Key == Key.N) { removingGestures.Add(inputBinding); }
                }
            }

            foreach (var gesture in removingGestures)
            {
                this.documentEditor.InputBindings.Remove(gesture);
            }

            this.DataContext = this.Model = new MainPageViewModel();
        }

Just want to ask if this is the proper way? Is there any property I can set to disable the default behaviors?

1 Reply

EJ Emmima Josephine Jeyapaul Syncfusion Team August 9, 2016 05:13 AM UTC

Hi Dat Vo, 
Yes, you can proceed with your code for disabling default input key binding (New/Open/Save commands) in SfRichTextBoxAdv control. Currently there is no property (API) available to disable the default behaviours. 
. 
Regards, 
Emmima. 


Loader.
Up arrow icon