this.PostBrowser.IsWebBrowserContextMenuEnabled = false;
this.PostBrowser.Name = "PostBrowser";
this.PostBrowser.TabStop = false;
- this.PostBrowser.WebBrowserShortcutsEnabled = false;
this.PostBrowser.Navigated += new System.Windows.Forms.WebBrowserNavigatedEventHandler(this.PostBrowser_Navigated);
this.PostBrowser.Navigating += new System.Windows.Forms.WebBrowserNavigatingEventHandler(this.PostBrowser_Navigating);
this.PostBrowser.StatusTextChanged += new System.EventHandler(this.PostBrowser_StatusTextChanged);
//フォーカスPostBrowserもしくは関係なし
switch (KeyCode)
{
- case Keys.A:
- PostBrowser.Document.ExecCommand("SelectAll", false, null);
- return true;
- case Keys.C:
- case Keys.Insert:
- string _selText = WebBrowser_GetSelectionText(ref PostBrowser);
- if (!string.IsNullOrEmpty(_selText))
- {
- try
- {
- Clipboard.SetDataObject(_selText, false, 5, 100);
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- return true;
case Keys.Y:
MultiLineMenuItem.Checked = !MultiLineMenuItem.Checked;
MultiLineMenuItem_Click(null, null);
if (KeyRes)
{
e.IsInputKey = true;
+ return;
+ }
+
+ if (Enum.IsDefined(typeof(Shortcut), (Shortcut)e.KeyData))
+ {
+ var shortcut = (Shortcut)e.KeyData;
+ switch (shortcut)
+ {
+ case Shortcut.CtrlA:
+ case Shortcut.CtrlC:
+ case Shortcut.CtrlIns:
+ // 既定の動作を有効にする
+ return;
+ default:
+ // その他のショートカットキーは無効にする
+ e.IsInputKey = true;
+ return;
+ }
}
}
public bool TabRename(ref string tabName)