Mail Archives: djgpp/1997/06/26/20:01:35
install_keyboard() must be called to set up the Allegro keyboard
handler. =) Don't forget to use remove_keyboard() when you're finished
with it.
int ch, int key;
install_keyboard();
key = KEY_F;
ch = readkey();
if (ch == (key << 8)) do_whatever();
else didnt_work();
remove_keyboard();
-----
Michael D. Ryan wrote:
>
> I want to be able to interpret an alt code from the keyboard using
> allegro. I have tried doing it the way it says in the allegro.txt and
> it doesn't work.
>
> EX:
>
> int ch, int key;
>
> key = KEY_F;
> ch = readkey();
> if (ch == (key << 8)) do_whatever();
> else didnt_work();
>
> It doesn't seem to recognize the keys. I have tried a whole bunch of
> different combinations and no luck.
>
> Any help?
- Raw text -