20/09/23 19:49:30.91 SeN5l4G8a.net
需要ないと思うけど暇だったので別スレで質問が出てたキー操作のシーケンスで発動する
キーボドショートカットを作ってみた
URLリンク(ideone.com)
使い方:
public partial class Form1 : Form
{
private KeyboardShortcutsDetector mKbsDetector = new KeyboardShortcutsDetector();
public Form1()
{
InitializeComponent();
mKbsDetector.AddKeyBinding(Keys.Control | Keys.K, Keys.Control | Keys.L, () => Console.WriteLine("Ctrl + K, L"));
mKbsDetector.AddKeyBinding(Keys.Control | Keys.K, Keys.Control | Keys.M, () => Console.WriteLine("Ctrl + K, M"));
mKbsDetector.AddKeyBinding(Keys.Control | Keys.J, Keys.Control | Keys.U, () => Console.WriteLine("Ctrl + J, U"));
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
return mKbsDetector.ProcessKey(keyData) ? true : base.ProcessCmdKey(ref msg, keyData);
}
}
退屈なコードだからたぶん見るだけ時間の無駄だと思うw