Looking to implement custom keyboard shortcuts in my app, I added a keydown event handler as shown below:
Application.Current.RootVisual.AddHandler(UIElement.KeyDownEvent, new KeyEventHandler(HandleKeyDown), true);
However, an issue arises with certain shortcuts like Ctrl+S and Ctrl+T, which trigger the browser's default actions.
I attempted to disable these browser shortcuts from the aspx file containing the Silverlight using JavaScript:
onkeydown = function(e) {
if (e.ctrlKey && e.keyCode == 's'.charCodeAt(0)) {
e.preventDefault();
}
};
Does anyone have any suggestions on how to disable the default browser shortcuts and use custom ones instead?