Engine::InputDeviceKeyboard Class Reference

A input device that handles keyboard input: -WASD is used for stearing -Q/W is for sliding -arrow keys for the menu -enter / space select -Escape / backspace back. More...

#include <InputDeviceKeyboard.h>

Inheritance diagram for Engine::InputDeviceKeyboard:

Engine::InputDevice List of all members.

Public Member Functions

 InputDeviceKeyboard ()
 ~InputDeviceKeyboard ()
int get_acceleration ()
 Get a number representing the acceleration or breaking.
int get_slide ()
 Sideways force .
int get_steering ()
 Stearing angle.
void poll ()
 Poll for events, if necessary.

Private Attributes

bool accelerate_down
bool break_down
bool steer_left_down
bool steer_right_down
bool slide_left_down
bool slide_right_down

Detailed Description

A input device that handles keyboard input: -WASD is used for stearing -Q/W is for sliding -arrow keys for the menu -enter / space select -Escape / backspace back.

Todo:
make keys configurable.

Allow also WASD for the menu and arrow keys for steering.

Must be polled for SDL to work.

Definition at line 31 of file InputDeviceKeyboard.h.


Constructor & Destructor Documentation

Engine::InputDeviceKeyboard::InputDeviceKeyboard (  ) 

Definition at line 20 of file InputDeviceKeyboard.cpp.

Engine::InputDeviceKeyboard::~InputDeviceKeyboard (  ) 

Definition at line 31 of file InputDeviceKeyboard.cpp.


Member Function Documentation

int Engine::InputDeviceKeyboard::get_acceleration (  )  [virtual]

Get a number representing the acceleration or breaking.

Returns:
A number from -32767 to 32767 giving the amount of accelerating or breaking to do: 0 if not accelerating or braking, a negative value for breaking, a positive value for acceleration.

Implements Engine::InputDevice.

Definition at line 36 of file InputDeviceKeyboard.cpp.

int Engine::InputDeviceKeyboard::get_slide (  )  [virtual]

Sideways force .

Returns:
a number between -32767 (maximum left) and +32767 (maximum right). 0 indicates no sliding.

Implements Engine::InputDevice.

Definition at line 43 of file InputDeviceKeyboard.cpp.

int Engine::InputDeviceKeyboard::get_steering (  )  [virtual]

Stearing angle.

Returns:
a number between -32767 (maximum left) and 32767 (maximum right). 0 is straight ahead.

Implements Engine::InputDevice.

Definition at line 50 of file InputDeviceKeyboard.cpp.

void Engine::InputDeviceKeyboard::poll (  )  [virtual]

Poll for events, if necessary.

Reimplemented from Engine::InputDevice.

Definition at line 57 of file InputDeviceKeyboard.cpp.


Member Data Documentation

bool Engine::InputDeviceKeyboard::accelerate_down [private]

Definition at line 41 of file InputDeviceKeyboard.h.

bool Engine::InputDeviceKeyboard::break_down [private]

Definition at line 41 of file InputDeviceKeyboard.h.

bool Engine::InputDeviceKeyboard::slide_left_down [private]

Definition at line 41 of file InputDeviceKeyboard.h.

bool Engine::InputDeviceKeyboard::slide_right_down [private]

Definition at line 41 of file InputDeviceKeyboard.h.

bool Engine::InputDeviceKeyboard::steer_left_down [private]

Definition at line 41 of file InputDeviceKeyboard.h.

bool Engine::InputDeviceKeyboard::steer_right_down [private]

Definition at line 41 of file InputDeviceKeyboard.h.


The documentation for this class was generated from the following files:
Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:17 2010 by Doxygen version 1.4.7 for Racer version svn335.