key pressed

how would i read if different keys are pressed and output accordingly.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
#include <windows.h>
#include <conio.h>
#include <cstdlib>

using namespace std;

int main()
{
	if (GetAsyncKeyState(VK_UPARROW))
	{
		cout << "up arrow is pressed" << endl;
	}

}
closed account (j3Rz8vqX)
if( GetAsyncKeyState( VK_LEFT ) & 0x8000 )
Topic archived. No new replies allowed.