Mouse, Keyboard and Other Controls

This section of the manual has all the functions relating to user input from devices.

The fundamental thing that makes a game a game is the interaction with the player. This is achieved by a variety of means, with the keyboard and mouse on computers and through touch and tilting on mobile devices. The standard way of doing this in GameMaker is to put actions in mouse or keyboard events, but sometimes you need more control, especially when creating something for mobile devices or HTML5. For that you can use the mouse and keyboard functions to get which buttons have been pressed or released as well as simulating the touches on a screen, and there are a couple of specific functions relating to the tilt controls that most mobile devices have too.

The following sections deal with the main user input devices for developing games with GameMaker: Studio:

  1. Virtual Keys
  2. Keyboard Input
  3. Mouse Input
  4. Device Input
  5. GamePad Input

On the Windows target platform, you can also access the legacy joystick functions. However, unless you are porting an older game made with a previous version of GameMaker, it is recommended that you use the newer gamepad functions (above). The joystick functions can be found here:

  1. Joystick Input (Windows Only)

Finally, you also have haptics available to you if you are targeting Android devices. This is covered in the following section:

  1. Immersion Haptics (Android Only)


Back: Reference
© Copyright YoYo Games Ltd. 2018 All Rights Reserved