would it be efficient to use GetKeyState(), to determine the input the user presses or is there another method. My idea was to get input only in the client, or maybe giving the user an option for custom control...
Printable View
would it be efficient to use GetKeyState(), to determine the input the user presses or is there another method. My idea was to get input only in the client, or maybe giving the user an option for custom control...
What kind of "windows" program are you creating?
If it's a regular windows program with a GUI window, then use the various WM_* messages to track what the user is doing.
What i mean is instead of gui, i want controls to move an image (game control basically) i'm trying to handle key events
You mean like "OK" and "Cancel" on a dialog?
You are being very hard to understand Darkinyuasha1. From the best I can tell, your looking for the WM_KEYDOWN notification; use it in your window's callback's message switch.
well i can use WM_KEYDOWN
using th wParam
or could i use GetKeyState()Code:WM_KEYDOWN:
if(wParam == VK_LEFT)
//do something
to capture an input key and then determine
what event i would do when the user presses it .
GetKeyState() is only if you expect the player to be pressing multiple keys simultaneously and you need to know which keys are pressed. This is useful when you have 'modifier' keys, such as SHIFT+D does something different than pressing the shift key then the D key seperatelyCode:case WM_KEYDOWN:
switch(wParam){
case VK_LEFT:
// do something here
break;
}
break;
ooooh thanks for clarifying i understand now..