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

Shortcuts disabling

Hello! Is there any way to disable default shortcuts or override them? 

I created class which inherits the SfRichTextBoxAdv control and overrides OnKeyDown handler.
if i handle default shortcut in that way:

==================================
if (e.Key == VirtualKey.Control)
{
       this.isCtrlPressed = true;
}
else if (this.isCtrlPressed)
{
. . . . .
case VirtualKey.O:
      e.Handled = true;
      //MyCommand here
. . . . .
}

 if (!e.Handled)
 {
        base.OnKeyDown(e);
 }

==================================

controls behavior is like Ctrl is always pressed, if i don't press it one more time.

I could set e.Handled = true on Ctrl key down (or Shift, if i would need shortcut with Shift), but it would break control selection behavior



3 Replies

VM Venkatesan Mani Syncfusion Team December 15, 2016 08:48 AM UTC

Hi Alexander,

We have prepared a sample to disable the open document shortcut in SfRichTextBoxAdv control. similarly, you can disable the other shortcuts as per your requirement. Please find the sample from following link.

Sample link:
DisableShortcut_UWP.zip

Please let us know if this helps you.

Regards,
Venkatesan M. 



AL alexander December 19, 2016 10:32 AM UTC

Thanks a lot, that works perfect!


VM Venkatesan Mani Syncfusion Team December 19, 2016 12:31 PM UTC

Hi Alexander,

Thank you for your update.

We are glad to know that our solution resolved your problem. Please let us know if you have any other questions. We will be happy to assist you.

Regards,
Venkatesan M.
 


Loader.
Live Chat Icon For mobile
Up arrow icon