#include <iostream>
#include <conio.h>
using namespace std;
int GetKey(void)
{
int ch = _getch();
cout << "입력값 : " << ch << endl;
if (ch == 0 || ch == 224)
ch = _getch();
cout << "입력값 : " << ch << endl;
return ch;
}
int main()
{
int nKey = 0;
while (true) // Main Process, Update()
{
if (_kbhit())
{
nKey = GetKey();
}
if (nKey == 72) std::cout << "Up" << std::endl;
if (nKey == 75) std::cout << "Left" << std::endl;
if (nKey == 77) std::cout << "Right" << std::endl;
if (nKey == 80) std::cout << "Down" << std::endl;
nKey = 0;
}
return 0;
}