Skip to content

Controlling the Mouse with a Gamepad

Ralph Niemitz edited this page Mar 30, 2018 · 3 revisions

It is possible to control the mouse with a gamepad through the instance of the MouseControl class that is attached to every gamepad. By default it is disabled and has to be enabled through the setEnabled method. You can decide which analog stick moves the cursor, map a mouse button to a gamepad button and set the sensity of the cursor. You can invert the cursor movement by using a negative sensity. By default the sensity is 5.0F, the left analog stick moves the cursor, the left mouse button is mapped to X and the right mouse button is mapped to A.

Related