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

Ogre::Win32Input8 Class Reference

Utility class for dealing with user input on a Win32 system. More...

#include <OgreWin32Input8.h>

Inheritance diagram for Ogre::Win32Input8:

Ogre::InputReader List of all members.

Public Methods

 Win32Input8 ()
 ~Win32Input8 ()
virtual void initialise (RenderWindow *pWindow, bool useKeyboard=true, bool useMouse=true, bool useGameController=false)
 @copydoc InputReader::initialise. More...

virtual void capture ()
 @copydoc InputReader::capture. More...

virtual bool isKeyDown (KeyCode kc) const
 @copydoc InputReader::isKeyDown. 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 initialiseBufferedKeyboard ()
 specialised initialisation routines. More...

void initialiseImmediateKeyboard ()
void initialiseBufferedMouse ()
void initialiseImmediateMouse ()
void captureKeyboard (void)
void captureMouse (void)
bool readBufferedKeyboardData ()
bool readBufferedMouseData ()
long getKeyModifiers ()
Real getScaled (DWORD dwVal)

Private Attributes

IDirectInput8 * mlpDI
IDirectInputDevice8 * mlpDIKeyboard
IDirectInputDevice8 * mlpDIMouse
HWND mHWnd
long mMouseCenterX
long mMouseCenterY
long mMouseCenterZ
Real mScale
char mKeyboardBuffer [256]

Detailed Description

Utility class for dealing with user input on a Win32 system.

Note that this is a basic implementation only at the moment.


Constructor & Destructor Documentation

Ogre::Win32Input8::Win32Input8  
 

Ogre::Win32Input8::~Win32Input8  
 


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::Win32Input8::capture   [virtual]
 

@copydoc InputReader::capture.

Implements Ogre::InputReader.

void Ogre::Win32Input8::captureKeyboard void    [private]
 

void Ogre::Win32Input8::captureMouse void    [private]
 

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::Win32Input8::getKeyModifiers   [private]
 

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

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

Implements Ogre::InputReader.

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

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

Implements Ogre::InputReader.

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

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

Implements Ogre::InputReader.

bool Ogre::Win32Input8::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::Win32Input8::getMouseRelX   const [virtual]
 

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

Implements Ogre::InputReader.

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

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

Implements Ogre::InputReader.

long Ogre::Win32Input8::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::Win32Input8::getMouseState MouseState   state const [virtual]
 

Retrieves the current state of the mouse.

Implements Ogre::InputReader.

Real Ogre::Win32Input8::getScaled DWORD    dwVal [private]
 

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

@copydoc InputReader::initialise.

Implements Ogre::InputReader.

void Ogre::Win32Input8::initialiseBufferedKeyboard   [private]
 

specialised initialisation routines.

void Ogre::Win32Input8::initialiseBufferedMouse   [private]
 

void Ogre::Win32Input8::initialiseImmediateKeyboard   [private]
 

void Ogre::Win32Input8::initialiseImmediateMouse   [private]
 

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

@copydoc InputReader::isKeyDown.

Implements Ogre::InputReader.

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

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

bool Ogre::Win32Input8::readBufferedKeyboardData   [private]
 

bool Ogre::Win32Input8::readBufferedMouseData   [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

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.

HWND Ogre::Win32Input8::mHWnd [private]
 

char Ogre::Win32Input8::mKeyboardBuffer[256] [private]
 

IDirectInput8* Ogre::Win32Input8::mlpDI [private]
 

IDirectInputDevice8* Ogre::Win32Input8::mlpDIKeyboard [private]
 

IDirectInputDevice8* Ogre::Win32Input8::mlpDIMouse [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).

long Ogre::Win32Input8::mMouseCenterX [private]
 

long Ogre::Win32Input8::mMouseCenterY [private]
 

long Ogre::Win32Input8::mMouseCenterZ [private]
 

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

The mouse state in immediate mode.

Real Ogre::Win32Input8::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