Event type constants

Event type constants represent the different events in Game Maker. These constants are in particular used in the functions event_perform and event_perform_object.

The following event types exist:


 * ev_create
 * ev_destroy
 * ev_step
 * ev_alarm
 * ev_keyboard
 * ev_mouse
 * ev_collision
 * ev_other
 * ev_draw
 * ev_keypress
 * ev_keyrelease

These correspond to the different buttons you see when adding an event to an object. For many of these there are a number of different events within these types, each with its own number. In the functions event_perform and event_perform_object this event number is passed as a second argument.

For each event type that is set of event numbers, that actually work as sub-events. The event number indicates what you get when you press one of those event buttons. In this way, "ev_user0" is not an event type, but an event number. Its event type is "ev_other".

For the ev_alarm event the number can range from 0 to 11. For the ev_keyboard, ev_keypress and ev_keyrelease events you have to use the keycode constants for the key.

For the ev_step event you can use the following constants as number:


 * ev_step_normal
 * ev_step_begin
 * ev_step_end

For the ev_mouse event you can use the following constants:


 * ev_left_button
 * ev_right_button
 * ev_middle_button
 * ev_no_button
 * ev_left_press
 * ev_right_press
 * ev_middle_press
 * ev_left_release
 * ev_right_release
 * ev_middle_release
 * ev_mouse_enter
 * ev_mouse_leave
 * ev_mouse_wheel_up
 * ev_mouse_wheel_down
 * ev_global_left_button
 * ev_global_right_button
 * ev_global_middle_button
 * ev_global_left_press
 * ev_global_right_press
 * ev_global_middle_press
 * ev_global_left_release
 * ev_global_right_release
 * ev_global_middle_release
 * ev_joystick1_left
 * ev_joystick1_right
 * ev_joystick1_up
 * ev_joystick1_down
 * ev_joystick1_button1
 * ev_joystick1_button2
 * ev_joystick1_button3
 * ev_joystick1_button4
 * ev_joystick1_button5
 * ev_joystick1_button6
 * ev_joystick1_button7
 * ev_joystick1_button8
 * ev_joystick2_left
 * ev_joystick2_right
 * ev_joystick2_up
 * ev_joystick2_down
 * ev_joystick2_button1
 * ev_joystick2_button2
 * ev_joystick2_button3
 * ev_joystick2_button4
 * ev_joystick2_button5
 * ev_joystick2_button6
 * ev_joystick2_button7
 * ev_joystick2_button8

For the ev_collision event you give the index of the other object. For the ev_other event you can use the following constants:


 * ev_outside
 * ev_boundary
 * ev_game_start
 * ev_game_end
 * ev_room_start
 * ev_room_end
 * ev_no_more_lives
 * ev_no_more_health
 * ev_animation_end
 * ev_end_of_path
 * ev_close_button
 * ev_user0
 * ev_user1
 * ev_user2
 * ev_user3
 * ev_user4
 * ev_user5
 * ev_user6
 * ev_user7
 * ev_user8
 * ev_user9
 * ev_user10
 * ev_user11
 * ev_user12
 * ev_user13
 * ev_user14
 * ev_user15

You should note that the engine itself never issues an ev_other/ev_userN event, only you can do that using a script or code.

For all other event types you can set the number to 0.