Prod.: Engine, ver.: 6012, ID: 60000540, General : Keyboard arrow keys do not fire the VDKeyDown event

General : Keyboard arrow keys do not fire the VDKeyDown event

Article60000540
TypeGeneral
ProductEngine
Version6012
Date Added6/13/2008
FixedYes [6/16/2008]
Submitted byMario 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);
}