Working with Input
This section provides topics that demonstrate how to write code that managed input in your MonoGame project for keyboard, mouse, gamepad and touch.
In This Section
A game without input is basically just a movie, the user is not interacting and just watching what happens on screen. If the images are not moving, then it is basically just a digital painting. Games are all about interactivity and how we turn the sometimes random presses of buttons, keys, and waving of gyroscopes into interesting reactions on screen.
The following articles showcase some of the best ways to get input into your game:
Overview of User Input and Input Devices
Describes the various types of input devices that can be used with MonoGame.
-
Demonstrates how to detect if a user pressed or released a key on the keyboard.
-
Demonstrates how to detect if a user performed input on a GamePad.
-
Demonstrates how to detect and use multi-touch input in a MonoGame game.
Detecting Gestures on a Multi-touch Screen
Demonstrates how to detect and use multi-touch gestures in a MonoGame game.
How to select an Object in 3D Space
Demonstrates how to check whether the mouse (or touch location) is positioned over a 3D object by creating a ray starting at the camera's near clipping plane and ending at its far clipping plane.