PDA

View Full Version : win32 programming



Kicsit
10-15-2004, 11:11 AM
case WM_KEYDOWN: // If we pressed a key

switch(wParam) // Check if we hit a key
{
case VK_ESCAPE: // If we hit the escape key
PostQuitMessage(0); // Send a QUIT message to the window
break;

case VK_LEFT: // If the LEFT arrow key was pressed
g_RotateX=0.0f ; // Decrease the rotation speed (eventually rotates left)
break;

case VK_RIGHT: // If the RIGHT arrow key is pressed
g_RotateX=180.0f ; // Increase the rotation speed (rotates right)
break;

case VK_UP: // If the UP arrow key was pressed
g_RotateX=-90.0f ; // Move the camera position forward along the Z axis
break;

case VK_DOWN: // If the DOWN arrow key is pressed
g_RotateX=90.0f ; // Move the camera position back along the Z axis
break;

case 'H':
g_RotateX=-45.0f ; // Decrease the rotation speed (eventually rotates left)
break;
case 'J':
g_RotateX=-135.0f ; // Decrease the rotation speed (eventually rotates left)
break;
case 'N':
g_RotateX=45.0f ; // Decrease the rotation speed (eventually rotates left)
break;
case 'M':
g_RotateX=135.0f ; // Decrease the rotation speed (eventually rotates left)
break;

This is a code of my program
i.e winproc()
now I want to have event on two keys i.e e.g up key and right key to move towards south east
How should i write code to tackle two keys
above is an example of on single key

SirKnight
10-15-2004, 12:35 PM
Dude, you really need to stop these off topic posts. Everything you have posted so far has been way off topic. Go to gamedev.net which has many boards of various topics and pick the correct one for your question.

Ugh...

-SirKnight