This module represents buttons on a game controller.
Internal.Button.Button
The most common type on any controller. Most buttons can only be pressed and released, but some are a little bit more advanced.
pressed : Button -> Basics.Bool
Most buttons are a simple press/don't press switch. This value lets you know whether the button is being pressed.
touched : Button -> Basics.Bool
Some buttons notice if they're being touched by the user, often through the use of a touchscreen. Effectively, some buttons let you see whether the user touches the button without pressing it.
Keep in mind that most controllers also set this value to true when the button is being pressed.
value : Button -> Basics.Float
Some buttons notice how firmly they're being pressed.
If the button supports this, this value shows how firmly, on a scale from 0 to 1. If the button doesn't support this, the value will always be 0 (when not pressed) or 1 (when pressed).
This library looks at what your controller looks like, and indexes each button for you. This way, you can simply check if any button is being pressed.
Different controllers use different letters (A, B, X, Y or X, O, square and triangle) in different configurations
primary : Internal.Gamepad.Gamepad -> Button
The primary and most important button on the controller. This button is used for actions like:
secondary : Internal.Gamepad.Gamepad -> Button
The secondary button is the secondary button that is second-most important. For some controllers, it can be used as an complementing button to the primary button. This button is used for actions like:
tertiary : Internal.Gamepad.Gamepad -> Button
The tertiary button is the button that is used rather infrequently, but is still placed near the player's finger because the action is still used quite frequently. This button is used for actions like:
quaternary : Internal.Gamepad.Gamepad -> Button
The fourth button is the least accessible button and should effectively be used the least. This button is used for actions like:
Most controllers have a bunch of directional buttons that can be used for a directional menu. Usually, these are used for things like quick slots from a player's inventory.
up : Internal.Gamepad.Gamepad -> Button
The up arrow button.
left : Internal.Gamepad.Gamepad -> Button
The left arrow button.
right : Internal.Gamepad.Gamepad -> Button
The right arrow button.
down : Internal.Gamepad.Gamepad -> Button
The down arrow button.
Whether you call it the top or the front of the controllers, there's always a few buttons up there.
leftBumper : Internal.Gamepad.Gamepad -> Button
The small button on the left front of the game controller.
rightBumper : Internal.Gamepad.Gamepad -> Button
The small button on the right front of the game controller.
leftTrigger : Internal.Gamepad.Gamepad -> Button
The large button on the left front of the game controller.
rightTrigger : Internal.Gamepad.Gamepad -> Button
The large button on the right front of the game controller.
Some joystick buttons allow you to press on them. As a result, you will hear a soft clicking noise. These buttons are usually used for actions that should be executed very rarely, like switching camera perspective, as not all controllers have these buttons.
leftStick : Internal.Gamepad.Gamepad -> Button
Button by pressing down the left joystick.
rightStick : Internal.Gamepad.Gamepad -> Button
Button by pressing down the right joystick.
The menu buttons are usually used to pause games, open in-game (or out-of-game) menus, and change settings.
start : Internal.Gamepad.Gamepad -> Button
The start button usually serves as a pause button to interrupt a game and open a menu. Here, players can alter settings, change the window, or leave a game.
select : Internal.Gamepad.Gamepad -> Button
The select button usually serves as an in-game button to interrupt a game and open an in-game menu. For example, users might open their inventory this way, or look at a map of their surroundings.
home : Internal.Gamepad.Gamepad -> Button
The home button is an unpredictable one, for some programs might interpret the button beyond your control. The button usually serves as a method of turning a controller on/off, or changing the state of the game.
touchpad : Internal.Gamepad.Gamepad -> Button
The touchpad button is a button that doesn't exist on most controllers. It is often used for controlling the mouse, but it can also be used as a simple button.
In some rare cases, you do not care about the actual buttons and you just want them in their directions.
In that case, you can access the right button by their orientation.
Note that these buttons will likely overlap with the primary
, secondary
, tertiary
and quaternary
buttons.
north : Internal.Gamepad.Gamepad -> Button
Button in the north position.
east : Internal.Gamepad.Gamepad -> Button
Button in the east position.
south : Internal.Gamepad.Gamepad -> Button
Button in the south position.
west : Internal.Gamepad.Gamepad -> Button
Button in the west position.