Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

Input Class Reference

#include <input.h>

List of all members.

Public Types

enum  MouseButton { MOUSE_BUTTON1 = 0x01 }
enum  Key {
  UNKNOWN = 0, CANCEL, FAST_QUIT, FULLSCREEN_TOGGLE,
  LOCKMOUSE_TOGGLE, WALK_WEST, WALK_EAST, WALK_NORTH,
  WALK_SOUTH, ADD_UFO, MUSIC_TOGGLE, RAPID_FIRE,
  SWITCH_MUSIC, ROT_UP, ROT_DOWN, KLAST
}

Public Methods

 Input ()
 ~Input ()
void init ()
int GetMouse (int &x, int &y)
bool ResetMouse (unsigned int mask=(unsigned int)-1)
bool ResetMouseButton (unsigned int mask)
bool LockMouse (bool)
bool IsPressed (Key)
bool IsShift ()
bool ResetKey (Key)
bool Update (Event &)
void Map (int sdlkey, Key inputkey)

Private Methods

void HandleKeyDown (int sdlkeysym)
void HandleKeyUp (int sdlkeysym)
void HandleMouseMotion (int x, int y)
void HandleMouseButtonDown (int button)
void HandleMouseButtonUp (int button)

Private Attributes

Key mapping [SDLK_LAST]
bool presses [KLAST]
int mouse_press
int mouse_x
int mouse_y


Member Enumeration Documentation

enum Input::Key
 

Enumeration values:
UNKNOWN 
CANCEL 
FAST_QUIT 
FULLSCREEN_TOGGLE 
LOCKMOUSE_TOGGLE 
WALK_WEST 
WALK_EAST 
WALK_NORTH 
WALK_SOUTH 
ADD_UFO 
MUSIC_TOGGLE 
RAPID_FIRE 
SWITCH_MUSIC 
ROT_UP 
ROT_DOWN 
KLAST 

Definition at line 17 of file input.h.

enum Input::MouseButton
 

Enumeration values:
MOUSE_BUTTON1 

Definition at line 13 of file input.h.


Constructor & Destructor Documentation

Input::Input  
 

Definition at line 4 of file input.cpp.

References init().

Input::~Input  
 

Definition at line 9 of file input.cpp.


Member Function Documentation

int Input::GetMouse int &    x,
int &    y
 

Definition at line 43 of file input.cpp.

References mouse_press, mouse_x, and mouse_y.

Referenced by Game::GameLoop().

void Input::HandleKeyDown int    sdlkeysym [private]
 

Definition at line 75 of file input.cpp.

References mapping, and presses.

Referenced by Update().

void Input::HandleKeyUp int    sdlkeysym [private]
 

Definition at line 80 of file input.cpp.

References mapping, and presses.

Referenced by Update().

void Input::HandleMouseButtonDown int    button [private]
 

Definition at line 91 of file input.cpp.

References mouse_press.

Referenced by Update().

void Input::HandleMouseButtonUp int    button [private]
 

Definition at line 96 of file input.cpp.

References mouse_press.

Referenced by Update().

void Input::HandleMouseMotion int    x,
int    y
[private]
 

Definition at line 85 of file input.cpp.

References mouse_x, and mouse_y.

Referenced by Update().

void Input::init  
 

Definition at line 13 of file input.cpp.

References ADD_UFO, CANCEL, FAST_QUIT, FULLSCREEN_TOGGLE, KLAST, LOCKMOUSE_TOGGLE, Map(), mouse_press, mouse_x, mouse_y, MUSIC_TOGGLE, presses, RAPID_FIRE, ROT_DOWN, ROT_UP, SWITCH_MUSIC, UNKNOWN, WALK_EAST, WALK_NORTH, WALK_SOUTH, and WALK_WEST.

Referenced by Input().

bool Input::IsPressed Key   
 

Definition at line 63 of file input.cpp.

References presses.

Referenced by Game::GameLoop(), Application::Run(), and Game::step().

bool Input::IsShift   [inline]
 

Definition at line 55 of file input.h.

Referenced by Game::step().

bool Input::LockMouse bool   
 

void Input::Map int    sdlkey,
Key    inputkey
 

Definition at line 125 of file input.cpp.

References mapping.

Referenced by init().

bool Input::ResetKey Key   
 

Definition at line 68 of file input.cpp.

References presses.

Referenced by Game::step().

bool Input::ResetMouse unsigned int    mask = (unsigned int)-1
 

Definition at line 50 of file input.cpp.

References mouse_press, mouse_x, and mouse_y.

bool Input::ResetMouseButton unsigned int    mask
 

Definition at line 57 of file input.cpp.

References mouse_press.

Referenced by Game::GameLoop().

bool Input::Update Event  
 

Definition at line 101 of file input.cpp.

References Event, HandleKeyDown(), HandleKeyUp(), HandleMouseButtonDown(), HandleMouseButtonUp(), and HandleMouseMotion().

Referenced by Application::Run().


Member Data Documentation

Key Input::mapping[SDLK_LAST] [private]
 

Definition at line 72 of file input.h.

Referenced by HandleKeyDown(), HandleKeyUp(), and Map().

int Input::mouse_press [private]
 

Definition at line 74 of file input.h.

Referenced by GetMouse(), HandleMouseButtonDown(), HandleMouseButtonUp(), init(), ResetMouse(), and ResetMouseButton().

int Input::mouse_x [private]
 

Definition at line 75 of file input.h.

Referenced by GetMouse(), HandleMouseMotion(), init(), and ResetMouse().

int Input::mouse_y [private]
 

Definition at line 75 of file input.h.

Referenced by GetMouse(), HandleMouseMotion(), init(), and ResetMouse().

bool Input::presses[KLAST] [private]
 

Definition at line 73 of file input.h.

Referenced by HandleKeyDown(), HandleKeyUp(), init(), IsPressed(), and ResetKey().


The documentation for this class was generated from the following files:
Generated on Sun Dec 8 12:02:21 2002 for nnc by doxygen1.3-rc1