View Single Post
Old Dec 11th, 2005, 7:29 PM   #27
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 314
Rep Power: 4 Klarre is on a distinguished road
If you are using Windows you might be able to use this...
#include <conio.h>
#include <iostream>

int main()
{
	int key = 0;

	while(key != 27)
		if(kbhit())
		{
			key = getch();
			std::cout << "Key: " << static_cast<char>(key);
			std::cout << " Keycode: " << key << std::endl;
		}
}
Klarre is offline   Reply With Quote