Keyboard Input (arrows)

Hi. I'm trying to make a simple c++ console game.

And i wrote a program to find the values corresponding to keys.

#include <iostream>
#include <conio.h>
using namespace std;

int main(){
int a;
a=getch();
cout << a;
cin.get();

}

However, there is a problem that i get the same value (224) for all arrow keys. So, i couldn't use the arrow keys to make my character move...

Arrow keys produce two characters, btw you shouldn't use conio.h, the curses libraries are much better
Topic archived. No new replies allowed.