The problem is that i want to localize my editor to use Polish special characters. But when i'm typing shortcut like alt-l (which should display char) the command 'align left' is firing instead of putting char in the editor.
How can i disable shorcuts in radrichtextbox? Maybe even better - how to assing them only to left ctrl key? (now they are firing with both ctrl and alt keys)
4 Answers, 1 is accepted
Unfortunately, we do not support customization for the way key bindings work as of now. We are considering providing this functionality for one of the service packs.
If you have any other questions/ suggestions, do not hesitate to contact us again.
Iva
the Telerik team
I've got the same problem. Is any possibility to switch off Alt+E and Alt+L combinations to put default, system, chars?
If not... Well...
Ssiecie :)
My solution was to disable all ALT-x shortcuts (polish chars are still working)
private
void
editor_PreviewEditorKeyDown(
object
sender, PreviewEditorKeyEventArgs e)
{
if
((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt)
{
e.SuppressDefaultAction =
true
;
}
}
Hope that helps.
Trochę ssą ;p
The default input bindings and the customization options are described in this article.
The situation with the input bindings in different languages seems to be a rather complicated one, because depending on the keyboard (e.g. English or Polish Programmers), different ModifierKeys are sent to the PreviewKeyDown/KeyDown. Therefore, overriding the default key binding for all languages will not be the best solution.
We would suggest that you follow the approach that Pawel pointed above:
private
void
editor_PreviewEditorKeyDown(
object
sender, PreviewEditorKeyEventArgs e)
{
if
(Keyboard.Modifiers.HasFlag(ModifierKeys.Alt) && Keyboard.Modifiers.HasFlag(ModifierKeys.Control))
{
e.SuppressDefaultAction =
true
;
}
}
The only difference from his code is that we also check if Control is pressed, because it seems that pressing Right Alt results in both flags being raised.
All the best,
Iva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>