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

Ogre::SDLInput Class Reference

#include <OgreSDLInput.h>

Inheritance diagram for Ogre::SDLInput:

Ogre::InputReader List of all members.

Public Methods

 SDLInput ()
virtual ~SDLInput ()
void initialise (RenderWindow *pWindow, bool useKeyboard=true, bool useMouse=true, bool useGameController=false)
 Initialise the input system. More...

void capture ()
 Captures the state of all the input devices. More...

bool isKeyDown (KeyCode kc) const
 Determines if the specified key is currently depressed. More...

virtual long getMouseRelX () const
 Retrieves the relative (compared to the last input poll) mouse movement on the X (horizontal) axis. More...

virtual long getMouseRelY () const
 Retrieves the relative (compared to the last input poll) mouse movement on the Y (vertical) axis. More...

virtual long getMouseRelZ () const
 Retrieves the relative (compared to the last input poll) mouse movement on the Z (mouse wheel) axis. More...

virtual long getMouseAbsX () const
 Retrieves the absolute mouse position on the X (horizontal) axis. More...

virtual long getMouseAbsY () const
 Retrieves the absolute mouse position on the Y (vertical) axis. More...

virtual long getMouseAbsZ () const
 Retrieves the absolute mouse position on the Z (mouse wheel) axis. More...

virtual void getMouseState (MouseState &state) const
 Retrieves the current state of the mouse. More...

virtual bool getMouseButton (uchar button) const
 Retrieves the state of a mouse button. More...

void useBufferedInput (EventQueue *pEventQueue)
 Tells the reader to use buffered input and update the passed in queue. More...

virtual long getMouseRelativeX () const
 Retrieves the relative position of the mouse when capture was called relative to the last time. More...

virtual long getMouseRelativeY () const
 Retrieves the relative position of the mouse when capture was called relative to the last time. More...

virtual long getMouseRelativeZ () const
 Retrieves the relative position of the mouse when capture was called relative to the last time. More...

void addCursorMoveListener (MouseMotionListener *c)
 Adds a mouse motion listener to the cursor object. More...

void removeCursorMoveListener (MouseMotionListener *c)
 Remove a mouse motion listener to the cursor object. More...


Protected Methods

void mouseMoved ()
 Creates mouse moved or dragged events depending if any button is pressed. More...

void createMouseEvent (int id, int button)
 Creates a MouseEvent that first gets processed by the cursor, then gets pushed on the queue. More...

void triggerMouseButton (int nMouseCode, bool mousePressed)
 Creates mouse pressed, released, and clicked events. More...


Protected Attributes

long mModifiers
 The modifiers are a binary flags that represent what buttons are pressed, and what key modifiers are down (e.g. More...

CursormCursor
 Internal Cursor object. More...

EventQueuemEventQueue
 EventQueue is used for buffered input support. More...

bool mUseBuffered
 Wether to use buffering input support - buffering support relies on using an EventQueue. More...

MouseState mMouseState
 The mouse state in immediate mode. More...


Private Methods

void processBufferedMouse ()

Private Attributes

Uint8 * mKeyboardBuffer
int mMaxKey
int mMouseX
int mMouseY
int mMouseCenterX
int mMouseCenterY
Real mScale
Uint8 mMouseKeys
bool _visible

Constructor & Destructor Documentation

Ogre::SDLInput::SDLInput  
 

Ogre::SDLInput::~SDLInput   [virtual]
 


Member Function Documentation

void Ogre::InputReader::addCursorMoveListener MouseMotionListener   c [inherited]
 

Adds a mouse motion listener to the cursor object.

This keeps the Cursor object hidden.

void Ogre::SDLInput::capture   [virtual]
 

Captures the state of all the input devices.

Remarks:
This method captures the state of all input devices and stores it internally for use when the enquiry methods are next called. This is done to ensure that all input is captured at once and therefore combinations of input are not subject to time differences when methods are called.

Implements Ogre::InputReader.

void Ogre::InputReader::createMouseEvent int    id,
int    button
[protected, inherited]
 

Creates a MouseEvent that first gets processed by the cursor, then gets pushed on the queue.

long Ogre::SDLInput::getMouseAbsX   const [virtual]
 

Retrieves the absolute mouse position on the X (horizontal) axis.

Implements Ogre::InputReader.

long Ogre::SDLInput::getMouseAbsY   const [virtual]
 

Retrieves the absolute mouse position on the Y (vertical) axis.

Implements Ogre::InputReader.

long Ogre::SDLInput::getMouseAbsZ   const [virtual]
 

Retrieves the absolute mouse position on the Z (mouse wheel) axis.

Implements Ogre::InputReader.

bool Ogre::SDLInput::getMouseButton uchar    button const [virtual]
 

Retrieves the state of a mouse button.

Implements Ogre::InputReader.

virtual long Ogre::InputReader::getMouseRelativeX void    const [inline, virtual, inherited]
 

Retrieves the relative position of the mouse when capture was called relative to the last time.

Reimplemented in Ogre::Win32Input.

virtual long Ogre::InputReader::getMouseRelativeY void    const [inline, virtual, inherited]
 

Retrieves the relative position of the mouse when capture was called relative to the last time.

Reimplemented in Ogre::Win32Input.

virtual long Ogre::InputReader::getMouseRelativeZ   const [inline, virtual, inherited]
 

Retrieves the relative position of the mouse when capture was called relative to the last time.

long Ogre::SDLInput::getMouseRelX   const [virtual]
 

Retrieves the relative (compared to the last input poll) mouse movement on the X (horizontal) axis.

Implements Ogre::InputReader.

long Ogre::SDLInput::getMouseRelY   const [virtual]
 

Retrieves the relative (compared to the last input poll) mouse movement on the Y (vertical) axis.

Implements Ogre::InputReader.

long Ogre::SDLInput::getMouseRelZ   const [virtual]
 

Retrieves the relative (compared to the last input poll) mouse movement on the Z (mouse wheel) axis.

Implements Ogre::InputReader.

void Ogre::SDLInput::getMouseState MouseState   state const [virtual]
 

Retrieves the current state of the mouse.

Implements Ogre::InputReader.

void Ogre::SDLInput::initialise RenderWindow   pWindow,
bool    useKeyboard = true,
bool    useMouse = true,
bool    useGameController = false
[virtual]
 

Initialise the input system.

Note:
Only keyboard and mouse currently implemented.
Parameters:
pWindow  The window to capture input for
useKeyboard  If true, keyboard input will be supported.
useMouse  If true, mouse input will be supported.
useGameController  If true, joysticks/gamepads will be supported.

Implements Ogre::InputReader.

bool Ogre::SDLInput::isKeyDown KeyCode    kc const [virtual]
 

Determines if the specified key is currently depressed.

Note:
This enquiry method uses the state of the keyboard at the last 'capture' call.

Implements Ogre::InputReader.

void Ogre::InputReader::mouseMoved   [protected, inherited]
 

Creates mouse moved or dragged events depending if any button is pressed.

void Ogre::SDLInput::processBufferedMouse   [private]
 

void Ogre::InputReader::removeCursorMoveListener MouseMotionListener   c [inherited]
 

Remove a mouse motion listener to the cursor object.

This keeps the Cursor object hidden.

void Ogre::InputReader::triggerMouseButton int    nMouseCode,
bool    mousePressed
[protected, inherited]
 

Creates mouse pressed, released, and clicked events.

void Ogre::InputReader::useBufferedInput EventQueue   pEventQueue [inherited]
 

Tells the reader to use buffered input and update the passed in queue.

Remarks:
The default behaviour of the input reader is simply to capture the current state of the mouse / keyboard on demand. An alternative is to use buffered input where all events are registered on a queue.


Member Data Documentation

bool Ogre::SDLInput::_visible [private]
 

Cursor* Ogre::InputReader::mCursor [protected, inherited]
 

Internal Cursor object.

Remarks:
This is a mathematical representation of where the cursor is, it does not draw a cursor.
See also:
CursorGuiElement.

EventQueue* Ogre::InputReader::mEventQueue [protected, inherited]
 

EventQueue is used for buffered input support.

Uint8* Ogre::SDLInput::mKeyboardBuffer [private]
 

int Ogre::SDLInput::mMaxKey [private]
 

long Ogre::InputReader::mModifiers [protected, inherited]
 

The modifiers are a binary flags that represent what buttons are pressed, and what key modifiers are down (e.g.

shift/alt).

int Ogre::SDLInput::mMouseCenterX [private]
 

int Ogre::SDLInput::mMouseCenterY [private]
 

Uint8 Ogre::SDLInput::mMouseKeys [private]
 

MouseState Ogre::InputReader::mMouseState [protected, inherited]
 

The mouse state in immediate mode.

int Ogre::SDLInput::mMouseX [private]
 

int Ogre::SDLInput::mMouseY [private]
 

Real Ogre::SDLInput::mScale [private]
 

bool Ogre::InputReader::mUseBuffered [protected, inherited]
 

Wether to use buffering input support - buffering support relies on using an EventQueue.

See also:
class EventQueue

Copyright © 2002 by The OGRE Team