KeypadManager Class Reference

#include <KeypadManager.h>

Inheritance diagram for KeypadManager:
ListenerObject

# Public Member Functions

void print (int32 x, int32 y)
void reset ()
 Reset the manager's state.
void readUserInput (bool waitForStableReading)

# Static Public Member Functions

static void interruptHandler ()
 Interrupt handler for keypad's interrupts.
static void enable ()
 Enable user input.
static void disable ()
 Disable user input.
static int32 isEnabled ()
static void enableDummyKey ()
 Enable the dummy key to force user input processing.
static void disableDummyKey ()
 Disable the dummy key to not enforce user input processing.
static void registerInput (uint16 inputToRegister)
static UserInput getUserInput ()
static long getAccumulatedUserInput ()

# Protected Attributes

long accumulatedUserInput
 Holds the mathematical sum of all user's presses.
UserInput userInput
 Struct that holds the user's input during the last game frame.
UserInput userInputToRegister
 Flags to select which inputs to register and which to ignore.
bool enabled
 Flag to enable/disable the capture of user input.
bool reseted

# Additional Inherited Members

- Private Member Functions inherited from ListenerObject
void constructor ()
 Class' constructor.
void destructor ()
 Class' destructor.
void addEventListener (ListenerObject listener, uint16 eventCode)
void removeEventListener (ListenerObject listener, uint16 eventCode)
void removeEventListeners (uint16 eventCode)
void removeAllEventListeners ()
 Remove all listener objects.
bool hasActiveEventListeners ()
void fireEvent (uint16 eventCode)
void sendMessageTo (ListenerObject receiver, uint32 message, uint32 delay, uint32 randomDelay)
void sendMessageToSelf (uint32 message, uint32 delay, uint32 randomDelay)
void discardAllMessages ()
 Discard all messages, both to be sent and to be received.
void discardMessages (uint32 message)
virtual bool onEvent (ListenerObject eventFirer, uint16 eventCode)
virtual bool handleMessage (Telegram telegram)
- Private Attributes inherited from ListenerObject
VirtualList events
 List of registered events.
int8 eventFirings
 Counter that keeps track of the number of fired events to prevent race conditions in nested firings.

# Detailed Description

Class KeypadManager

Inherits from ListenerObject

Manages keypad inputs.

Definition at line 104 of file KeypadManager.h.

# Member Function Documentation

# disable()

static void KeypadManager::disable ( )
static

Disable user input.

Definition at line 54 of file KeypadManager.c.

# disableDummyKey()

static void KeypadManager::disableDummyKey ( )
static

Disable the dummy key to not enforce user input processing.

Definition at line 81 of file KeypadManager.c.

# enable()

static void KeypadManager::enable ( )
static

Enable user input.

Definition at line 42 of file KeypadManager.c.

# enableDummyKey()

static void KeypadManager::enableDummyKey ( )
static

Enable the dummy key to force user input processing.

Definition at line 72 of file KeypadManager.c.

# getAccumulatedUserInput()

static long KeypadManager::getAccumulatedUserInput ( )
static

Retrieve the accumulated sum of user inputs since the start of the program.

Returns
The mathematical sum of all user's presses.

Definition at line 113 of file KeypadManager.c.

# getUserInput()

static UserInput KeypadManager::getUserInput ( )
static

Retrieve the user input during the last game frame

Returns
User input struct with the key presses of the last game frame

Definition at line 104 of file KeypadManager.c.

# interruptHandler()

static void KeypadManager::interruptHandler ( )
static

Interrupt handler for keypad's interrupts.

Definition at line 31 of file KeypadManager.c.

# isEnabled()

int32 KeypadManager::isEnabled ( )
static

Check if user input is enabled.

Returns
True if user input is enabled

Definition at line 63 of file KeypadManager.c.

# print()

void KeypadManager::print ( int32 x,
int32 y )

Print the last reads of user input.

Parameters
xScreen x coordinate where to print
yScreen y coordinate where to print

# readUserInput()

secure void KeypadManager::readUserInput ( bool waitForStableReading)

Reat the user input during the last game frame

Parameters
waitForStableReadingIf true, wait for reading to be stable (__S_STAT)

Definition at line 173 of file KeypadManager.c.

# registerInput()

static void KeypadManager::registerInput ( uint16 inputToRegister)
static

Register the user input according to the provided flags.

Parameters
inputToRegisterFlags to select which inputs to register and which to ignore

Definition at line 90 of file KeypadManager.c.

# reset()

secure void KeypadManager::reset ( )

Reset the manager's state.

Definition at line 159 of file KeypadManager.c.

# Member Data Documentation

# accumulatedUserInput

long KeypadManager::accumulatedUserInput
protected

Holds the mathematical sum of all user's presses.

Definition at line 109 of file KeypadManager.h.

# enabled

bool KeypadManager::enabled
protected

Flag to enable/disable the capture of user input.

Definition at line 118 of file KeypadManager.h.

# reseted

bool KeypadManager::reseted
protected

Flag to prevent pressed and released keys from being raised when holding buttons while changing game states

Definition at line 122 of file KeypadManager.h.

# userInput

UserInput KeypadManager::userInput
protected

Struct that holds the user's input during the last game frame.

Definition at line 112 of file KeypadManager.h.

# userInputToRegister

UserInput KeypadManager::userInputToRegister
protected

Flags to select which inputs to register and which to ignore.

Definition at line 115 of file KeypadManager.h.


The documentation for this class was generated from the following files: