Skip to content

Mouse input #13

Answered by VectorSatyr
Feli0TheWriter asked this question in Q&A
Feb 13, 2025 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

In GameMaker, mouse input is also touch input.

This is normally handled by DeviceTouch, which coordinates with TouchUISign to create clickable UI elements on screen. Certain objects for the file select menu (eg. FSMenuChoice) also directly handle touch gestures using events.

Adding the ability to map mouse buttons to actions the same way keyboard and gamepad buttons are would interfere with these controls, but if you are sure this is what you want, here's some steps:

  1. Create a child object of InputSource - we'll call it MouseInput. Then in the Step Event, add the following:
/// @description  Register
event_inherited();
for (var index = ds_map_find_first(buttons);
	not is_undefined(index)…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@Feli0TheWriter
Comment options

@VectorSatyr
Comment options

@Feli0TheWriter
Comment options

@VectorSatyr
Comment options

Answer selected by VectorSatyr
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants