General : Keyboard arrow keys do not fire the VDKeyDown event
| Article | 60000540 |
| Type | General |
| Product | Engine |
| Version | 6012 |
| Date Added | 6/13/2008 |
| Fixed | Yes [6/16/2008] |
| Submitted by | Mario Perino |
| Keywords | |
Subject
Keyboard arrow keys do not fire the VDKeyDown event
Summary
Keyboard arrow keys do not fire the VDKeyDown event
Solution
We did a change there to let the Keys work as they supposed to in a .NET application and not catch them. The default behaviour of these keys is to change the focused control. You can get these Keys though by moving your code to a different event like below
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (msg.WParam.ToInt32() == (int)Keys.Up)
{
//UP code here
return true;
}
else if (msg.WParam.ToInt32() == (int)Keys.Down)
{
//Down code here
return true;
}
else if (msg.WParam.ToInt32 () == (int)Keys.Left)
{
//Left code here
return true;
}
else if (msg.WParam.ToInt32 () == (int)Keys.Right)
{
//Right code here
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}