Here's a simple keypress function:

Code:
function press_key(num)
{
	return(key_pressed(num));
}


I use it by mapping key codes (See the Manual's Keymapping section for scan codes) to varibles, like this:

Code:
var_info upp1 = 72;
var_info leftp1 = 75;
var_info rightp1 = 77;
var_info downp1 = 80;

///when used in a function you'd use it like this:
//in place of:
//if (key_cuu) { ....blah blah blah code }
//you would use:
//if (press_key(upp1)) { ....blah blah blah code }


If you want the key changing code, which includes strings that you can use to show which key is mapped, i'll post it too (the code captures all keyboard stuff and mouse, I should be able to modify it for joystick as well)

edit: oh yes, I also have Gamepad mapping which allows you to switch between the Joystick (gamepad) Digital and Analog, if you need that as well.


- aka Manslayer101