Blender V2.61 - r43446
|
#include <GPC_MouseDevice.h>
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) |
Generic Ketsji mouse device.
Definition at line 46 of file GPC_MouseDevice.h.
Button identifier.
Definition at line 52 of file GPC_MouseDevice.h.
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.
bool GPC_MouseDevice::ConvertButtonEvent | ( | TButtonId | button, |
bool | isDown | ||
) | [virtual] |
Call this routine to update the mouse device when a button state changes.
button | Which button state changes. |
isDown | The new state of the button. |
x | Position x-coordinate of the cursor at the time of the state change. |
y | Position y-coordinate of the cursor at the time of the state change. |
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).
button | Which button state changes. |
isDown | The new state of the button. |
x | Position x-coordinate of the cursor at the time of the state change. |
y | Position y-coordinate of the cursor at the time of the state change. |
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] |
This routine converts a single mouse event to a Ketsji mouse event.
kxevent | Ketsji event code. |
eventval | Value for this event. |
Definition at line 154 of file GPC_MouseDevice.cpp.
References SCA_InputEvent::KX_ACTIVE, SCA_IInputDevice::KX_BEGINMOUSE, SCA_IInputDevice::KX_BEGINMOUSEBUTTONS, 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, SCA_InputEvent::m_eventval, and SCA_InputEvent::m_status.
Referenced by ConvertButtonEvent(), and ConvertMoveEvent().
bool GPC_MouseDevice::ConvertMoveEvent | ( | int | x, |
int | y | ||
) | [virtual] |
Call this routine to update the mouse device when the cursor has moved.
x | Position x-coordinate of the cursor. |
y | Position y-coordinate of the cursor. |
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.