protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) //激活回车键
{ const int WM_KEYDOWN = 0x100;
const int WM_KEYUP = 0x101;
const int WM_SYSKEYDOWN = 0x104;
const int WM_SYSKEYUP = 0x105; if (msg.Msg == WM_KEYDOWN | msg.Msg == WM_SYSKEYDOWN)
{
switch (keyData)
{
case Keys.Up: ControlActionMessage("持续向上移动", SecondView.MoveUpPress(zoomSpeed.Value)); return true; ;
case Keys.Down: ControlActionMessage("持续向下移动", SecondView.MoveDownPress(zoomSpeed.Value)); return true; ;
case Keys.Right: ControlActionMessage("持续向右移动", SecondView.MoveRightPress(zoomSpeed.Value)); return true; ; //这里是写什么方法 ?
case Keys.Left: ControlActionMessage("持续向左移动", SecondView.MoveLeftPress(zoomSpeed.Value)); return true; ;//这里是写什么方法 ?
}
} if (msg.Msg == WM_KEYUP | msg.Msg == WM_SYSKEYUP)
{
switch (keyData)
{
case Keys.Up:
case Keys.Down:
case Keys.Right:
case Keys.Left:
ControlActionMessage("停止移动", SecondView.StopCam());
return true;
}
}
return base.ProcessCmdKey(ref msg, keyData);
}WM_KEYUP 就是没响应。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货