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 Subject: Re: problem with readkey() Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Precedence: bulk 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 >>#include >> >>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 | -----------------------------------------------------