Code:
FONT* font1 = "Arial#12b";

TEXT* message = {
	strings = 1;
	font = font1;
	flags = SHOW;
	string = "Press a joy button";
}
PANEL* leftan = {
	pos_x = 200;
	pos_y = 200;
	digits(18,5,"left analog",font1,1,1);
	flags = SHOW;	
}

PANEL* rightan = {
	pos_x = 600;
	pos_y = 200;
	digits(18,5,"left analog",font1,1,1);
	flags = SHOW;	
}

void main(){
	wait(1);
	while(1){
		if(joy_1){
			str_cat((message.pstring)[0],"\nJoy 1 pressed");
			while(joy_1) wait(1);
		}
		if(joy_2){
			str_cat((message.pstring)[0],"\nJoy 2 pressed");
			while(joy_2) wait(1);
		}
		if(joy_3){
			str_cat((message.pstring)[0],"\nJoy 3 pressed");
			while(joy_3) wait(1);
		}
		if(joy_4){
			str_cat((message.pstring)[0],"\nJoy 4 pressed");
			while(joy_4) wait(1);
		}
		if(joy_5){
			str_cat((message.pstring)[0],"\nJoy 5 pressed");
			while(joy_5) wait(1);
		}
		if(joy_6){
			str_cat((message.pstring)[0],"\nJoy 6 pressed");
			while(joy_6) wait(1);
		}
		if(joy_7){
			str_cat((message.pstring)[0],"\nJoy 7 pressed");
			while(joy_7) wait(1);
		}
		if(joy_8){
			str_cat((message.pstring)[0],"\nJoy 8 pressed");
			while(joy_8) wait(1);
		}
		if(joy_9){
			str_cat((message.pstring)[0],"\nJoy 9 pressed");
			while(joy_9) wait(1);
		}
		if(joy_10){
			str_cat((message.pstring)[0],"\nJoy 10 pressed");
			while(joy_10) wait(1);
		}
		if(joy_11){
			str_cat((message.pstring)[0],"\nJoy 11 pressed");
			while(joy_11) wait(1);
		}
		if(joy_12){
			str_cat((message.pstring)[0],"\nJoy 12 pressed");
			while(joy_12) wait(1);
		}
		
		leftan.pos_x += joy_raw.x*0.1*time_step;
		leftan.pos_y += joy_raw.y*0.1*time_step;
		
		rightan.pos_x += joy_rot.x*0.1*time_step;
		rightan.pos_y += joy_rot.y*0.1*time_step;
		
		wait(1);
	}
}



this uses 12 buttons and 2 analogs. for joystick movement(i mean swinging the device and such) use joy_force


3333333333