LPCGame
A Simple 2d Game Engine
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Input Class Reference

Input handler wrapper. More...

#include <input.h>

Static Public Member Functions

static void Init ()
 Initialize the input manager.
 
static void PollEvent ()
 Read event input.
 
static bool KeyDown (std::string keyCode)
 
static bool KeyDown (int keyCode)
 
static bool MouseClick (int button)
 
static bool MouseDown (int button)
 
static SDL_MouseButtonEvent GetClick ()
 Get the mouse button event.
 
static bool MouseMotion ()
 Check if the mouse moved.
 
static SDL_MouseMotionEvent GetMotion ()
 Get the mouse motion.
 
static Vector2f MousePos ()
 Get the current mouse position.
 
static float GetJoyAxis (int axis)
 
static bool GetJoyButton (int button)
 
static int GetJoyHat (int hat)
 
static bool JoystickAvailable ()
 Check if a Joystick is available.
 
static bool JoySupportsHaptic ()
 Check if the Joystick has haptic support (force feedback)
 
static bool Quit ()
 Check if the program has been quit out of.
 
static void Clear ()
 Clear input data, used when changing states to clear old input.
 
static void Close ()
 Close the joystick and any other input items that need to be exited.
 

Detailed Description

Input handler wrapper.

A simple wrapper around SDL's input handling system

Member Function Documentation

float Input::GetJoyAxis ( int  axis)
static

Get the input level of the desired joystick axis input level value ranges from -1 to 1

Parameters
axisThe axis to get value from
Returns
The input level of the axis, from -1 to 1
bool Input::GetJoyButton ( int  button)
static

Check if a Joystick button is being pressed

Parameters
buttonThe button to check
Returns
T/F whether or not the button is being pushed
int Input::GetJoyHat ( int  hat)
static

Check the position of the Joystick hat

Parameters
hatThe hat to check position of
Returns
The position of the hat
bool Input::KeyDown ( std::string  keyCode)
static

Check if a key is being pressed down

Parameters
keyCodeThe string of the key to check, ex: 'a'
Returns
T if key is down
bool Input::KeyDown ( int  keyCode)
static

Check if a key is being pressed down

Parameters
keyCodeThe SDL_SCANCODE of the key
Returns
T if key is down
bool Input::MouseClick ( int  button)
static

Check if the mouse button is clicked

Parameters
buttonThe button to check
bool Input::MouseDown ( int  button)
static

Check if the mouse button is currently down

Parameters
buttonThe button to check

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