Reputation: 1835
How can i detect an arrow key when it's pressed? Is a particular message sent for each arrow key?
Upvotes: 2
Views: 3987
Reputation: 9089
Use CWnd::OnKeyDown and CWnd::OnKeyUp handlers for WM_KEYDOWN
/WM_KEYUP
Windows messages and check nChar
parameter for virtual key codes VK_LEFT
, VK_UP
, VK_RIGHT
, VK_DOWN
.
Upvotes: 4