you have all the key related variables sorted by scancode into arrays already.

Code:
int _i = 1;
for ( ; _i<89; _i+=1 )
{
	key_set ( _i, myEvent );
	if ( *(&on_esc+_i-1) != myEvent )
		error ( str_cat ( str_for_key ( NULL, _i ), " is not into an array???" ) );
	key_set ( _i, NULL );
}

while ( !key_esc )
{
	for ( _i=1; _i<89; _i+=1 )
	{
		if ( *(&key_esc+_i-1) == 1 )
			draw_text ( str_cat ( str_for_key ( NULL, _i ), " key pressed" ), 10, 10, COLOR_WHITE );
	}
	wait(1);
}



but those arrays are not public and due to engines frequent updates and constant evolution use these things is a high risk [buahahaha]

Anyway, if it is a matter of customization, you can use pointers for actions.

Code:
var *keyUp = &key_w;
...
if ( *keyUp ) {...}



Quote:
I don't think that there's an event for all keys on a normal Keyboard.

there are...

Last edited by txesmi; 07/22/16 20:21.