GameMaker Studio Extension – InputMan

InputMan is a simple and easy to use script to map your keyboard and controllers for upto 4 players.

Drop the InputMan object in a room

Map your keys using the iman_add function

Check your key down, pressed, released using the iman_down, iman_pressed and iman_released functions

Example of how to use iman_add

iman_add("left", player_id,ord("A"), IMAN_LEFT_STICK_LEFT);
iman_add("right", player_id,ord("D"), IMAN_LEFT_STICK_RIGHT);
iman_add("jump", player_id, vk_space, IMAN_BTN_A);
iman_add("fire", player_id,vk_lcontrol, IMAN_BTN_X);

Now check if the key is down or pressed

 

move_left = iman_down("left", player_id);
move_right = iman_down("right", player_id);
jump = iman_pressed("jump", player_id);
jump_held = iman_down("jump", player_id);
fire = iman_pressed("fire", player_id);
fire_held = iman_down("fire", player_id);

player_id here is 0 to 3 – mapped to four constants for ease of use – IMAN_P1, IMAN_P2, IMAN_P3, IMAN_P4

Apart from these 4 core functions, there are over 70 functions which let you directly access states and values of each button on the gamepad both analog and digital. Please check the attached pdf for full documentation.

Leave a Reply

Your email address will not be published. Required fields are marked *