Re: [AD] Bug Report

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Ok,

After allefant suggested it to me... I tried doing a readkey to see what it was:

== MODIFIED A.C: Use to test ===
//A Simple Program.
#include "allegro.h"

void main()
{
allegro_init();
if(set_gfx_mode(GFX_AUTODETECT_WINDOWED,320,200,0,0)>=0)
if(install_keyboard()>=0)
{
clear_to_color(screen,makecol(0,0,255));
textout_centre_ex(screen,font,"I exist. Therefore I
am.",160,96,makecol(255,255,0),-1);
while(!keypressed()) //This is what makes it important.
 {
 }
 { 
 FILE *fp = fopen("read.txt","w");
 fprintf(fp,"Read Code: %d\n",readkey());
 fclose(fp);
 } 
}
allegro_exit();
}

END_OF_MAIN();
== MODIFIED A.C: Use to test ===

The output I got:

== READ.TXT ===
Read Code: 23808
== READ.TXT ===

Now, 23808 == 23808>>8 (or) 23808/256 = 93 and 93 = KEY_PAUSE.

Now I donno why this is thrown.. possibly because of an Windows event
too... Please check.

P.S.: I discovered this bug when running the Allegro examples, as 
they use: keypressed().

So there....

Regards,

-- 
V Karthik Kumar




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/