Mail Archives: djgpp/1999/06/28/03:06:08
In article <7l5mhn$h9q$1 AT orudios DOT magnet DOT at>, "Mark Usher" <marku AT magnet DOT at> wrote:
>Is there a function available that will give me the ascii value of a key
>press back ? If not, is there an easy way to convert the key press returned
>from getkey() to it's ASCII value.
>
>Basically I am trying to add the key pressed to a string without having to
>press return.
>ie
> key = getkey()
> strcat(kbdbuffer, ASCII(key)
>
>Mark
>marku AT magnet DOT at
>
>
In C this is very simple, you don't need an extra function:
key = getkey ();
printf ("ASCII value: %d", (int) key);
I wouldn't work with strcat() in this case, because it expects a char pointer.
Why don't you just use an index into your array?
kbdbuf[x]=key;
--
Manni
- Raw text -