[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[WitchTech 00207] Re: オートリピート関数



CDR/TK$B$G$9!#(B
$B$4=u8@$"$j$,$H$&$4$6$$$^$9!#(B

<39892D4C359.6429C.MOS@mail.zob.ne.jp>$B$N5-;v$K$*$$$F(B
c.mos@zob.ne.jp$B$5$s$O=q$-$^$7$?!#(B

>> key_hit_check_with_repeat()$B$G!"%-!<$,(BHit$B$5$l$F$$$J$$>l9g$O!"(B
>> hlt $B$G3d$j9~$_$rBT5!$7$^$9!#DL>o$O!"(BVBLANK$B3d$j9~$_$7$+F~$C$F$$$^$;$s$+$i!"(B
>> $B7k2LE*$K!"(B1V$BBT$D$3$H$K$J$C$F$7$^$$$^$9!#(B

$B%-!<$N>uBV$K$h$C$F!"(B1V$BBT$C$?$j$9$0La$C$F$-$?$j$9$k$N$G$9$M!#(B

$B:#$N$H$3$m!"(BV$BF14|$N@)8f$7$+$7$F$$$J$$!"$D$^$j!"(B

for(;;){
	$B%-!<%;%s%9(B();
	$B$$$m$$$m$J=hM}(B();
	sys_wait(0);
	$B2hLL99?7(B();
}

$B$H$$$&$h$&$J%k!<%W$K$7$F$$$k$N$G!"(Bkey_hit_check_with_repeat()$B$,I,$:(B
1V$BBT$D$N$G$"$l$P!"(Bsys_wait(0)$B$NBX$o$j$K$J$k$H;W$C$?$N$G$9$,!"(B
$B$=$&$b$$$+$J$$$N$G$9$+!#(B

>> $B<B$O!"%-!<F~NO$K$O%A%c%?%j%s%0$,H/@8$7$F$$$k$h$&$G!"(Bkey_hit_check()$B$r(B
>> $B6u2s$7$7$?$j$9$k$H!"F~NO$,IT0BDj$K$J$C$F$7$^$&$s$G$9!#(B

$B<B$O$3$C$A$NJ}$,LdBj$@$C$?$j$7$^$9!#(Bkey_hit_check()$B$@$1$G$9$+!)(B

key_press_check()$B$G2<$N%W%m%0%i%`$r;n$7$F$_$^$7$?$,!"(B
$B%-!<$r$f$C$/$j$HN%$9$H!"$H$-$I$-%A%c%?%j%s%0$,5/$-$k$h$&$J46$8$G$9$,!"(B
$B<j$N?L$($N$h$&$J5$$b$7$^$9!#(B

$B$H$j$"$($:(Bkey_press_check()$B$r;H$&$3$H$K$7$^$9!#(B

-----------------------------------------------------
#include <stdlib.h>
#include <sys/bios.h>

void main(int argc, char *argv[])
{
	int x = 0;
	int y = 0;
	int k;
	int state = 0;

	text_set_screen(SCREEN2);
	text_screen_init();

	do{
		sys_wait(0);
		k = key_press_check();
		if( k & KEY_A ){
			if( !state ){
				state = 1;
				text_put_string(x, y, "1");
				if( ++x >= 28 ){
					x = 0;
					y = (y+1) % 18;
				}
			}
		}else{
			if( state ){
				state = 0;
				text_put_string(x, y, "0");
				if( ++x >= 28 ){
					x = 0;
					y = (y+1) % 18;
				}
			}
		}
	}while( !(k & KEY_START) );
}
-----------------------------------------------------------------
/*
** $B9)F#(B $BC#Li(B (Tatsuya Kudoh)	mailto:cdr@cosmonet.org
**				http://www.tnlab.ice.uec.ac.jp/~cdr/
*/


ML Archives