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:

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:

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

Back: Reference

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here