I need to detect arrow keystrokes in the KeyDown
event. I do understand that they need to be set as input keys but I'm not clear on how to accomplish it in C++ . Found good answers here, here and here. But that is C# and I need C++. Tried implementing like described here have this code in PreviewKeyDown
but no luck.
switch (e->KeyCode)
{
case Keys::Down:
case Keys::Up:
case Keys::Right:
case Keys::Left:
case Keys::Space:
e->IsInputKey = true;
break;
}
and my KeyDown
have :
if (e->KeyCode == Keys::Left)
{
///
}
Which is not working on pressing left.
What am I missing?