FPLBase
An open source project by FPL.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
fplbase::Button Class Reference

Used to record state for fingers, mousebuttons, keys and gamepad buttons. More...

#include <input.h>

Detailed Description

Used to record state for fingers, mousebuttons, keys and gamepad buttons.

Allows you to know if a button went up/down this frame.

Public Member Functions

void AdvanceFrame ()
 Advances the current state of the button by one frame. More...
 
void Update (bool down)
 Updates the current state of the button. More...
 
bool is_down () const
 Returns true if the button is currently pressed.
 
bool went_down () const
 Returns true if the button has been pressed since last update.
 
bool went_up () const
 Returns true if the button has been released since last update.
 

Member Function Documentation

void fplbase::Button::AdvanceFrame ( )
inline

Advances the current state of the button by one frame.

Important, because it tells the system where frame boundaries occur, so that went_down() and went_up() can be updated correctly. Normally called automatically by FPLBase.

void fplbase::Button::Update ( bool  down)

Updates the current state of the button.

For buttons that are tracked by the input system (Keyboard buttons, joysticks) this is invoked automatically by InputSystem::AdvanceFrame().)


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