- Main Page
- Classes
- Files

- File List
- File Members

# flInput.c File Reference

`#include "flGlobal.h"`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <pspctrl.h>`

Go to the source code of this file.

## 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.
## Variables
u8 | inputStates [32]
SceCtrlData | inputData [2]
Timer * | inputTimer
float | inputLockTime = 0
void(*) | inputPause () = NULL
u8 | inputPauseButton = 0
u8 | inputPauseState = 0

## 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().

## Variable Documentation

SceCtrlData inputData[2]

Definition at line 16 of file flInput.c.

Referenced by inputInit(), and inputPoll().

float inputLockTime = 0

Definition at line 21 of file flInput.c.

Referenced by inputCheck(), inputDown(), inputLock(), and inputPoll().

void(*) inputPause() = NULL

Definition at line 23 of file flInput.c.

Referenced by inputPauseFunc(), and inputPoll().

u8 inputPauseButton = 0

Definition at line 24 of file flInput.c.

Referenced by inputPauseFunc(), and inputPoll().

u8 inputPauseState = 0

Definition at line 25 of file flInput.c.

Referenced by inputPauseFunc(), and inputPoll().

u8 inputStates[32]

Definition at line 15 of file flInput.c.

Referenced by inputCheck(), inputDown(), and inputPoll().

Timer* inputTimer

Definition at line 19 of file flInput.c.

Referenced by inputInit(), inputLock(), and inputPoll().