Blender V2.61 - r43446
Public Types | Public Member Functions | Protected Member Functions

GPC_MouseDevice Class Reference

#include <GPC_MouseDevice.h>

Inheritance diagram for GPC_MouseDevice:
Inheritance graph
[legend]

List of all members.

Public Types

enum  TButtonId {
  buttonLeft, buttonMiddle, buttonRight, buttonWheelUp,
  buttonWheelDown
}

Public Member Functions

 GPC_MouseDevice ()
virtual ~GPC_MouseDevice (void)
virtual bool IsPressed (SCA_IInputDevice::KX_EnumInputs inputcode)
virtual void NextFrame ()
virtual bool ConvertButtonEvent (TButtonId button, bool isDown)
virtual bool ConvertButtonEvent (TButtonId button, bool isDown, int x, int y)
virtual bool ConvertMoveEvent (int x, int y)

Protected Member Functions

virtual bool ConvertEvent (KX_EnumInputs kxevent, int eventval)

Detailed Description

Generic Ketsji mouse device.

See also:
SCA_IInputDevice

Definition at line 46 of file GPC_MouseDevice.h.


Member Enumeration Documentation

Button identifier.

Enumerator:
buttonLeft 
buttonMiddle 
buttonRight 
buttonWheelUp 
buttonWheelDown 

Definition at line 52 of file GPC_MouseDevice.h.


Constructor & Destructor Documentation

GPC_MouseDevice::GPC_MouseDevice ( )

Definition at line 35 of file GPC_MouseDevice.cpp.

GPC_MouseDevice::~GPC_MouseDevice ( void  ) [virtual]

Definition at line 39 of file GPC_MouseDevice.cpp.


Member Function Documentation

bool GPC_MouseDevice::ConvertButtonEvent ( TButtonId  button,
bool  isDown 
) [virtual]

Call this routine to update the mouse device when a button state changes.

Parameters:
buttonWhich button state changes.
isDownThe new state of the button.
xPosition x-coordinate of the cursor at the time of the state change.
yPosition y-coordinate of the cursor at the time of the state change.
Returns:
Indication as to whether the event was processed.

Definition at line 91 of file GPC_MouseDevice.cpp.

References buttonLeft, buttonMiddle, buttonRight, buttonWheelDown, buttonWheelUp, ConvertEvent(), SCA_IInputDevice::KX_LEFTMOUSE, SCA_IInputDevice::KX_MIDDLEMOUSE, SCA_IInputDevice::KX_RIGHTMOUSE, SCA_IInputDevice::KX_WHEELDOWNMOUSE, and SCA_IInputDevice::KX_WHEELUPMOUSE.

Referenced by ConvertButtonEvent(), GPG_Application::handleButton(), and GPG_Application::handleWheel().

bool GPC_MouseDevice::ConvertButtonEvent ( TButtonId  button,
bool  isDown,
int  x,
int  y 
) [virtual]

Call this routine to update the mouse device when a button state and cursor position changes at the same time (e.g. in Win32 messages).

Parameters:
buttonWhich button state changes.
isDownThe new state of the button.
xPosition x-coordinate of the cursor at the time of the state change.
yPosition y-coordinate of the cursor at the time of the state change.
Returns:
Indication as to whether the event was processed.

Splits combined button and x,y cursor move events into separate Ketsji x and y move and button events.

Definition at line 124 of file GPC_MouseDevice.cpp.

References ConvertButtonEvent(), and ConvertMoveEvent().

bool GPC_MouseDevice::ConvertEvent ( KX_EnumInputs  kxevent,
int  eventval 
) [protected, virtual]
bool GPC_MouseDevice::ConvertMoveEvent ( int  x,
int  y 
) [virtual]

Call this routine to update the mouse device when the cursor has moved.

Parameters:
xPosition x-coordinate of the cursor.
yPosition y-coordinate of the cursor.
Returns:
Indication as to whether the event was processed.

Splits combined x,y move into separate Ketsji x and y move events.

Definition at line 140 of file GPC_MouseDevice.cpp.

References ConvertEvent(), SCA_IInputDevice::KX_MOUSEX, and SCA_IInputDevice::KX_MOUSEY.

Referenced by ConvertButtonEvent(), and GPG_Application::handleCursorMove().

bool GPC_MouseDevice::IsPressed ( SCA_IInputDevice::KX_EnumInputs  inputcode) [virtual]

IsPressed gives boolean information about mouse status, true if pressed, false if not.

Implements SCA_IInputDevice.

Definition at line 47 of file GPC_MouseDevice.cpp.

References SCA_InputEvent::KX_ACTIVE, SCA_InputEvent::KX_JUSTACTIVATED, SCA_IInputDevice::m_currentTable, SCA_IInputDevice::m_eventStatusTables, and SCA_InputEvent::m_status.

void GPC_MouseDevice::NextFrame ( ) [virtual]

NextFrame toggles currentTable with previousTable, and copies relevant event information from previous to current table (pressed keys need to be remembered).

Reimplemented from SCA_IInputDevice.

Definition at line 61 of file GPC_MouseDevice.cpp.

References SCA_InputEvent::KX_ACTIVE, SCA_IInputDevice::KX_BEGINMOUSE, SCA_IInputDevice::KX_ENDMOUSE, SCA_IInputDevice::KX_ENDMOUSEBUTTONS, SCA_InputEvent::KX_JUSTACTIVATED, SCA_InputEvent::KX_JUSTRELEASED, SCA_InputEvent::KX_NO_INPUTSTATUS, SCA_IInputDevice::m_currentTable, SCA_IInputDevice::m_eventStatusTables, and SCA_InputEvent::m_status.


The documentation for this class was generated from the following files: