Hello,

I have discover a bug avec key_laspressed with the code :

Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////

TEXT* Txt_tape =
{
	pos_x = 10;
	pos_y = 10;
	layer =1;
	font = "Arial#14";
	flags=SHOW;
}

TEXT* Txt_scancode =
{
	pos_x = 10;
	pos_y = 25;
	layer =1;
	font = "Arial#14";
	flags=SHOW;
}

function main()
{
	STRING* my_str="Tapez une lettre : ";
	STRING* temp_str="";
	STRING* Scancode="";
	STRING* code="";
	
	(Txt_tape.pstring)[0] = my_str;
	while (key_any == 0) { wait(1); } // wait until a key is hit
	str_for_key(temp_str,key_lastpressed);
	str_cat(my_str,temp_str);
	str_cpy(Scancode,"Son scancode est : ");
	str_for_num(code,key_lastpressed);
	str_cat(Scancode,code);
	(Txt_scancode.pstring)[0] = Scancode;
}



When I press on f2 and f3 the scancode is the same 60. And when I press f2 a sound rings.

Djfeeler

Last edited by djfeeler; 10/12/11 08:23.