delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/20/18:57:21

Message-Id: <3.0.32.19971020175009.00977800@dataplusnet.com>
Date: Mon, 20 Oct 1997 17:54:51 -0500
To: vischne AT ibm DOT net (root), djgpp AT delorie DOT com
From: Michael Matczynski <michaelm AT dataplusnet DOT com>
Subject: Re: problem with readkey()
Mime-Version: 1.0

You need to use key[KEY_A] for that.  It returns a reference to a
character, not the actual character itself.


At 04:50 AM 10/17/97 GMT, you wrote:
>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') {'
>
>
>


-----------------------------------------------------
| Michael Matczynski                                |
| michaelm AT dataplusnet DOT com                          |
| http://www.geocities.com/SiliconValley/Park/4949/ |
| "Knowledge is good" - anonymous                   |
-----------------------------------------------------

- Raw text -


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