- Main Page
- Classes
- Files

- File List
- File Members

# flInput.h File Reference

`#include "flGlobal.h"`

Go to the source code of this file.

## Defines
#define | INPUT_STILL_UP 0
| This button state represents a button that is not pressed and wasn't pressed last frame either.
#define | INPUT_JUST_UP 2
| This button state represents a button that has just been released.
#define | INPUT_STILL_DOWN 1
| This button state represents a button that is down and was down last frame too.
#define | INPUT_JUST_DOWN 3
| This button state represents a button that has just been pressed.
#define | INPUT_BUTTON_SELECT 0
| This is the button number representing the SELECT button.
#define | INPUT_BUTTON_START 3
| This is the button number representing the START button.
#define | INPUT_DPAD_UP 4
| This is the button number representing the DPAD UP button.
#define | INPUT_DPAD_RIGHT 5
| This is the button number representing the DPAD RIGHT button.
#define | INPUT_DPAD_DOWN 6
| This is the button number representing the DPAD DOWN button.
#define | INPUT_DPAD_LEFT 7
| This is the button number representing the DPAD LEFT button.
#define | INPUT_BUTTON_LTRIGGER 8
| This is the button number representing the LEFT TRIGGER button.
#define | INPUT_BUTTON_RTRIGGER 9
| This is the button number representing the RIGHT TRIGGER button.
#define | INPUT_BUTTON_TRIANGLE 12
| This is the button number representing the TRIANGLE button.
#define | INPUT_BUTTON_CIRCLE 13
| This is the button number representing the CIRCLE button.
#define | INPUT_BUTTON_CROSS 14
| This is the button number representing the CROSS button.
#define | INPUT_BUTTON_SQUARE 15
| This is the button number representing the SQUARE button.
#define | INPUT_BUTTON_HOME 16
| This is the button number representing the HOME button, this requires KERNEL mode to poll.
#define | INPUT_BUTTON_HOLD 17
| This is the button number representing the POWER HOLD slider, this requires KERNEL mode to poll.
#define | INPUT_BUTTON_NOTE 18
| This is the button number representing the NOTE/MUSIC button, this requires KERNEL mode to poll.
#define | INPUT_BUTTON_SCREEN 19
| This is the button number representing the SCREEN button, this requires KERNEL mode to poll.
#define | INPUT_BUTTON_VOLUP 20
| This is the button number representing the VOLUME UP button, this requires KERNEL mode to poll.
#define | INPUT_BUTTON_VOLDOWN 21
| This is the button number representing the VOLUME DOWN button, this requires KERNEL mode to poll.
#define | INPUT_BUTTON_WLANUP 22
| This is the button number representing the WLAN slider, this requires KERNEL mode to poll.
#define | INPUT_BUTTON_REMOTE 23
| This is the button number representing the HEADPHONE REMOTE button, this requires KERNEL mode to poll.
#define | INPUT_BUTTON_DISC 24
| This is the button number representing the DISC status, this requires KERNEL mode to poll.
#define | INPUT_BUTTON_MS 25
| This is the button number representing the MEMORY STICK status, this requires KERNEL mode to poll.
## Functions
void | inputInit ()
| Initializes the input system, this is called by flInitialize().
u8 | inputCheck (u8 inInput)
| This returns the current state of a button.
bool | inputDown (u8 inInput)
| This returns a non-zero value if the button supplied by inInput is currently pressed.
void | inputPoll ()
| This updates the input system, and should be called at least once every frame in which input is required.
void | inputLock (float inTime)
| This locks the input system for a small period so that button presses are ignored.
void | inputPauseFunc (u8 inInput, u8 inState, void(*inFunc)())
| This function allows you to define a button, a state and a function to call, so that you can register a pause event, in retrospect callbacks would possibly be better.

## Define Documentation

#define INPUT_BUTTON_CIRCLE 13

This is the button number representing the CIRCLE button.

Definition at line 37 of file flInput.h.

#define INPUT_BUTTON_CROSS 14

This is the button number representing the CROSS button.

Definition at line 38 of file flInput.h.

#define INPUT_BUTTON_DISC 24

This is the button number representing the DISC status, this requires KERNEL mode to poll.

Definition at line 49 of file flInput.h.

#define INPUT_BUTTON_HOLD 17

This is the button number representing the POWER HOLD slider, this requires KERNEL mode to poll.

Definition at line 42 of file flInput.h.

#define INPUT_BUTTON_HOME 16

This is the button number representing the HOME button, this requires KERNEL mode to poll.

Definition at line 41 of file flInput.h.

#define INPUT_BUTTON_LTRIGGER 8

This is the button number representing the LEFT TRIGGER button.

Definition at line 34 of file flInput.h.

#define INPUT_BUTTON_MS 25

This is the button number representing the MEMORY STICK status, this requires KERNEL mode to poll.

Definition at line 50 of file flInput.h.

#define INPUT_BUTTON_NOTE 18

This is the button number representing the NOTE/MUSIC button, this requires KERNEL mode to poll.

Definition at line 43 of file flInput.h.

#define INPUT_BUTTON_REMOTE 23

This is the button number representing the HEADPHONE REMOTE button, this requires KERNEL mode to poll.

Definition at line 48 of file flInput.h.

#define INPUT_BUTTON_RTRIGGER 9

This is the button number representing the RIGHT TRIGGER button.

Definition at line 35 of file flInput.h.

#define INPUT_BUTTON_SCREEN 19

This is the button number representing the SCREEN button, this requires KERNEL mode to poll.

Definition at line 44 of file flInput.h.

#define INPUT_BUTTON_SELECT 0

This is the button number representing the SELECT button.

Definition at line 28 of file flInput.h.

#define INPUT_BUTTON_SQUARE 15

This is the button number representing the SQUARE button.

Definition at line 39 of file flInput.h.

#define INPUT_BUTTON_START 3

This is the button number representing the START button.

Definition at line 29 of file flInput.h.

#define INPUT_BUTTON_TRIANGLE 12

This is the button number representing the TRIANGLE button.

Definition at line 36 of file flInput.h.

#define INPUT_BUTTON_VOLDOWN 21

This is the button number representing the VOLUME DOWN button, this requires KERNEL mode to poll.

Definition at line 46 of file flInput.h.

#define INPUT_BUTTON_VOLUP 20

This is the button number representing the VOLUME UP button, this requires KERNEL mode to poll.

Definition at line 45 of file flInput.h.

#define INPUT_BUTTON_WLANUP 22

This is the button number representing the WLAN slider, this requires KERNEL mode to poll.

Definition at line 47 of file flInput.h.

#define INPUT_DPAD_DOWN 6

This is the button number representing the DPAD DOWN button.

Definition at line 32 of file flInput.h.

#define INPUT_DPAD_LEFT 7

This is the button number representing the DPAD LEFT button.

Definition at line 33 of file flInput.h.

#define INPUT_DPAD_RIGHT 5

This is the button number representing the DPAD RIGHT button.

Definition at line 31 of file flInput.h.

#define INPUT_DPAD_UP 4

This is the button number representing the DPAD UP button.

Definition at line 30 of file flInput.h.

#define INPUT_JUST_DOWN 3

This button state represents a button that has just been pressed.

Definition at line 26 of file flInput.h.

#define INPUT_JUST_UP 2

This button state represents a button that has just been released.

Definition at line 24 of file flInput.h.

#define INPUT_STILL_DOWN 1

This button state represents a button that is down and was down last frame too.

Definition at line 25 of file flInput.h.

#define INPUT_STILL_UP 0

This button state represents a button that is not pressed and wasn't pressed last frame either.

Definition at line 23 of file flInput.h.

## Function Documentation

u8 inputCheck | ( | u8 | inInput | ) |

This returns the current state of a button.

Parameters:

  | inInput | The number of the button whose state will be checked.

Returns:
  The state of the button.

Definition at line 34 of file flInput.c.

References inputLockTime, and inputStates.

bool inputDown | ( | u8 | inInput | ) |

This returns a non-zero value if the button supplied by inInput is currently pressed.

Parameters:

  | inInput | The number of the button whose to be checked.

Returns:
  Non-zero if the button is pressed.

Definition at line 40 of file flInput.c.

References inputLockTime, and inputStates.

void inputInit | ( |  | ) |

Initializes the input system, this is called by flInitialize().

See also:
  flInitialize()

Definition at line 27 of file flInput.c.

References inputData, inputTimer, and timerCreate().

Referenced by flInitialize().

void inputLock | ( | float | inTime | ) |

This locks the input system for a small period so that button presses are ignored.

Parameters:

  | inTime | The amount of time in seconds that the system will be locked for.

Definition at line 77 of file flInput.c.

References inputLockTime, inputTimer, and timerGetDeltaTime().

Referenced by debugCriticalErrorFrom(), debugDevWarningFrom(), debugErrorFrom(), debugWarningFrom(), and inputPoll().

void inputPauseFunc | ( | u8 | inInput,
|  | u8 | inState,
|  | void(*)() | inFunc |
| ) |  |  |

This function allows you to define a button, a state and a function to call, so that you can register a pause event, in retrospect callbacks would possibly be better.

Parameters:

  | inInput | The number of the button that will be used for pausing.
  | inState | The state the button must be in for inFunc() to be called.
  | inFunc | A pointer to the pause function to be used.

Warning:
  This function doesn't seem to work, although is pretty much untested.

Definition at line 83 of file flInput.c.

References inputPause, inputPauseButton, and inputPauseState.

void inputPoll | ( |  | ) |

This updates the input system, and should be called at least once every frame in which input is required.

Definition at line 46 of file flInput.c.

References inputData, inputLock(), inputLockTime, inputPause, inputPauseButton, inputPauseState, inputStates, inputTimer, and timerGetDeltaTime().