void OnDomKeyPress(object sender, DomKeyEventArgs e)
{
Debug.Assert(!InvokeRequired);
const uint DOM_VK_INSERT = 0x2D;
//enhance: it's possible that, with the introduction of ckeditor, we don't need to pay any attention
//to ctrl+v. I'm doing a hotfix to a beta here so I don't want to change more than necessary.
if ((e.CtrlKey && e.KeyChar == 'v') || (e.ShiftKey && e.KeyCode == DOM_VK_INSERT)) //someone was using shift-insert to do the paste
{
if (_pasteCommand==null /*happened in calendar config*/ || !_pasteCommand.Enabled)
{
Debug.WriteLine("Paste not enabled, so ignoring.");
e.PreventDefault();
}
//otherwise, ckeditor will handle the paste
}
// On Windows, Form.ProcessCmdKey (intercepted in Shell) seems to get ctrl messages even when the browser
// has focus. But on Mono, it doesn't. So we just do the same thing as that Shell.ProcessCmdKey function
// does, which is to raise this event.
if (SIL.PlatformUtilities.Platform.IsMono && ControlKeyEvent != null && e.CtrlKey && e.KeyChar == 'n')
{
Keys keyData = Keys.Control | Keys.N;
ControlKeyEvent.Raise(keyData);
}
}