delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/21/00:30:06

Message-ID: <19971021042712.27036.qmail@hotmail.com>
From: "John Patton" <gimli21 AT hotmail DOT com>
To: djgpp AT delorie DOT com
Cc: vischne AT ibm DOT net-nospam
Subject: Re: problem with readkey()
Date: Mon, 20 Oct 1997 21:27:11 PDT

>In article <01bcda6c$d9e94d80$0200a8c0 AT ingo>, ruhnke AT owl-online DOT de 
says...
>>
>>I got here some simple code which dosen't run as I expect it to work:
>>
>>#include <stdio.h>
>>#include <allegro.h>
>>
>>void main()
>>{
>> allegro_init();
>> install_keyboard();
>>
>> if (readkey() == 'a') {
>>   printf ("a was pressed");
>> } else {
>>   printf ("a wasn't pressed");
>> }
>>}
>
>
>How about `if ((unsigned char)readkey() == 'a') {'
>
>

Actually, how about `if ((unsigned char)readkey() == KEY_A) {'


-John Patton

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019