ascii or scancodes?

Martin Kalbfuß ma.kalbfuss at
Fri May 29 17:03:00 CEST 2009

Hi again,

I have another problem with my text snake game. It's about the use of
the keyboard functions of Crt.

The player record has some fields holding the keys for changing the
direction of the snake.

I want the following key sets as standard.

player 1:

left -> a
right -> d
up -> w
down -> s

player 2:

left -> arrow left
right -> arrow right
up -> arrow up
down -> arrow down

I found the scancodes for the arrow keys on the net, and they are
working. But the scancodes I found for the letters doesn't. I also read
that usb keyboards have different scancodes.

Is it possible to use scancodes platform independent?

Or are there ascii codes for the arrow keys, I could use?

More information about the Gpc mailing list