Arrow keys
-
im wondering how i map these i tried OnChar and OnKeyUp and OnKeyDown but non of them do what i tell them to do instead it just moved the selected button on the tool bar i have here is the code i have for all 3 messages switch(nChar) { case VK_UP: curr_room.y -= 1; break; case VK_DOWN: case VK_LEFT: case VK_RIGHT: break; } as you can see its imcomplete the but VK_UP doesnt even work how i want it can someone tell me the proper way to get these keys to do work for me thanks
-
im wondering how i map these i tried OnChar and OnKeyUp and OnKeyDown but non of them do what i tell them to do instead it just moved the selected button on the tool bar i have here is the code i have for all 3 messages switch(nChar) { case VK_UP: curr_room.y -= 1; break; case VK_DOWN: case VK_LEFT: case VK_RIGHT: break; } as you can see its imcomplete the but VK_UP doesnt even work how i want it can someone tell me the proper way to get these keys to do work for me thanks
I'm not sure to understand, could you specify these point? * What do you want to do? * In which class are you trying to catch the key input? * Do you call the base class after catching the messages?
Every gun that is made, every warship launched, every rocket fired, signifies in the final sense a theft from those who hunger and are not fed, those who are cold and are not clothed - Dwight D. Eisenhower
-
I'm not sure to understand, could you specify these point? * What do you want to do? * In which class are you trying to catch the key input? * Do you call the base class after catching the messages?
Every gun that is made, every warship launched, every rocket fired, signifies in the final sense a theft from those who hunger and are not fed, those who are cold and are not clothed - Dwight D. Eisenhower
i have a grid of images and only one can be selected so i want to move the selection box around with the arrow keys im catching the key input in the main dialog i tried both ways and neither worked thanks
-
i have a grid of images and only one can be selected so i want to move the selection box around with the arrow keys im catching the key input in the main dialog i tried both ways and neither worked thanks
Have you tried to override PreTranslateMessage?
BOOL CMyDialog::PreTranslateMessage(MSG *pMSG)
{
if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_UP){
// Do some stuff
return TRUE;
}
return CDialog::PreTranslateMessage(pMSG);
}
Every gun that is made, every warship launched, every rocket fired, signifies in the final sense a theft from those who hunger and are not fed, those who are cold and are not clothed - Dwight D. Eisenhower