Classes | Public Types | Static Public Member Functions

Tiny2D::Input Class Reference

Input devices. More...

#include <Tiny2D.h>

List of all members.

Classes

struct  MouseState
 Mouse state. More...
struct  Touch
 Touch (on touchpad) description; touch is alive (and has persistent id) from the time of touch until it gets released. More...

Public Types

enum  Key {
  Key_MouseLeft, Key_MouseMiddle, Key_MouseRight, Key_Left,
  Key_Right, Key_Up, Key_Down, Key_Escape,
  Key_Space, Key_Enter, Key_LeftAlt, Key_RightAlt,
  Key_Alt, Key_LeftControl, Key_RightControl, Key_Control,
  Key_LeftShift, Key_RightShift, Key_Shift, Key_Android_Back,
  Key_Android_Home, Key_Menu, Key_0, Key_1,
  Key_2, Key_3, Key_4, Key_5,
  Key_6, Key_7, Key_8, Key_9,
  Key_A, Key_B, Key_C, Key_D,
  Key_E, Key_F, Key_G, Key_H,
  Key_I, Key_J, Key_K, Key_L,
  Key_M, Key_N, Key_O, Key_P,
  Key_Q, Key_R, Key_S, Key_T,
  Key_U, Key_V, Key_W, Key_X,
  Key_Y, Key_Z, Key_COUNT
}
 

Keyboard key identifiers.

More...
enum  KeyState { KeyState_IsDown = 1 << 0, KeyState_WasDown = 1 << 1 }
 

Key state (used with keyboard, mouse and other keys)

More...

Static Public Member Functions

static unsigned int GetKeyState (Key key)
 Gets key state; return combination of KeyState flags.
static bool IsKeyDown (Key key)
 Gets whether given key is currently being pressed.
static bool WasKeyDown (Key key)
 Gets whether given key was pressed last frame.
static bool WasKeyPressed (Key key)
 Gets whether given key has just been pressed.
static bool WasKeyReleased (Key key)
 Gets whether given key has just been released.
static bool HasMouse ()
 Gets whether mouse is supported.
static const MouseStateGetMouseState ()
 Gets mouse state.
static bool HasTouchpad ()
 Gets whether touchpad is supported.
static int GetNumTouches ()
 Gets number of touches currently active.
static const TouchGetTouch (int index)
 Gets active touch at given index.
static bool IsTouchpadDown ()
 Gets whether any touch is active.
static bool WasTouchpadDown ()
 Gets whether touchpad was touched previous frame.
static bool WasTouchpadPressed ()
 Gets whether touchpad has just been touched.

Detailed Description

Input devices.


Member Enumeration Documentation

Keyboard key identifiers.

Enumerator:
Key_MouseLeft 

Left mouse button.

Key_MouseMiddle 

Middle mouse button.

Key_MouseRight 

Right mouse button.

Key_Left 
Key_Right 
Key_Up 
Key_Down 
Key_Escape 
Key_Space 
Key_Enter 
Key_LeftAlt 
Key_RightAlt 
Key_Alt 

Left or right alt.

Key_LeftControl 
Key_RightControl 
Key_Control 

Left or right control.

Key_LeftShift 
Key_RightShift 
Key_Shift 

Left or right shift.

Key_Android_Back 

Android specific back key.

Key_Android_Home 

Android specific home key.

Key_Menu 
Key_0 
Key_1 
Key_2 
Key_3 
Key_4 
Key_5 
Key_6 
Key_7 
Key_8 
Key_9 
Key_A 
Key_B 
Key_C 
Key_D 
Key_E 
Key_F 
Key_G 
Key_H 
Key_I 
Key_J 
Key_K 
Key_L 
Key_M 
Key_N 
Key_O 
Key_P 
Key_Q 
Key_R 
Key_S 
Key_T 
Key_U 
Key_V 
Key_W 
Key_X 
Key_Y 
Key_Z 
Key_COUNT 

Key state (used with keyboard, mouse and other keys)

Enumerator:
KeyState_IsDown 

Is down/pressed this frame.

KeyState_WasDown 

Was down/pressed previous frame.


Member Function Documentation

static unsigned int Tiny2D::Input::GetKeyState ( Key  key ) [static]

Gets key state; return combination of KeyState flags.

static const MouseState& Tiny2D::Input::GetMouseState (  ) [static]

Gets mouse state.

static int Tiny2D::Input::GetNumTouches (  ) [static]

Gets number of touches currently active.

static const Touch& Tiny2D::Input::GetTouch ( int  index ) [static]

Gets active touch at given index.

static bool Tiny2D::Input::HasMouse (  ) [static]

Gets whether mouse is supported.

static bool Tiny2D::Input::HasTouchpad (  ) [static]

Gets whether touchpad is supported.

static bool Tiny2D::Input::IsKeyDown ( Key  key ) [inline, static]

Gets whether given key is currently being pressed.

static bool Tiny2D::Input::IsTouchpadDown (  ) [static]

Gets whether any touch is active.

static bool Tiny2D::Input::WasKeyDown ( Key  key ) [inline, static]

Gets whether given key was pressed last frame.

static bool Tiny2D::Input::WasKeyPressed ( Key  key ) [inline, static]

Gets whether given key has just been pressed.

static bool Tiny2D::Input::WasKeyReleased ( Key  key ) [inline, static]

Gets whether given key has just been released.

static bool Tiny2D::Input::WasTouchpadDown (  ) [static]

Gets whether touchpad was touched previous frame.

static bool Tiny2D::Input::WasTouchpadPressed (  ) [static]

Gets whether touchpad has just been touched.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines