Mouse Input

This section deals with the standard mouse input.

Mouse input is accepted on all platforms (on mobile devices it is accepted as a single touch. If you need to use multi-touch, you should be using the device specific functions) and has a number of constants that are used to specify the buttons being pressed. These constants are shown in the following table:

Constant Description
mb_left The left mouse button
mb_middle The middle mouse button (this may not be valid for all target platforms)
mb_right The right mouse button
mb_none No mouse button
mb_any Any of the mouse buttons



The following functions exist for the standard mouse button controls:

  1. mouse_button
  2. mouse_check_button
  3. mouse_check_button_pressed
  4. mouse_check_button_released
  5. mouse_clear
  6. mouse_last_button
  7. mouse_wheel_up
  8. mouse_wheel_down
  9. mouse_x
  10. mouse_y

You can also use the following window and view functions to get and set certain information based on the mouse too:

  1. window_mouse_set
  2. window_mouse_get_x
  3. window_mouse_get_y
  4. window_view_mouse_get_x
  5. window_view_mouse_get_y
  6. window_views_mouse_get_x
  7. window_views_mouse_get_y


Back: Mouse, Keyboard and Other Controls
© Copyright YoYo Games Ltd. 2018 All Rights Reserved