Mail Archives: djgpp/1997/10/20/18:57:21
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 -