My Project
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
ParaEngine::CGUIMouseVirtual Class Reference

base class for GUI mouse More...

#include <GUIMouseVirtual.h>

Inheritance diagram for ParaEngine::CGUIMouseVirtual:
ParaEngine::CDirectMouse

Public Types

enum  MOUSE_KEY_STD { LEFT_BUTTON = 0, RIGHT_BUTTON = 1, MIDDLE_BUTTON = 2 }
 this is just traditional mouse key mapping. More...
 

Public Member Functions

virtual HRESULT ReadBufferedData ()
 
virtual HRESULT ReadImmediateData ()
 
virtual void Update ()
 
virtual void ResetLastMouseState ()
 reset mouse to make the mouse delta correct in the next frame. More...
 
virtual void Reset ()
 
virtual bool IsButtonDown (MOUSE_KEY_STD nMouseButton)
 
virtual int GetMouseWheelDeltaSteps ()
 the current mouse wheel delta in steps, such as -2,-1,0,1,2
 
virtual int GetMouseXDeltaSteps ()
 the current mouse X delta in steps, such as -2,-1,0,1,2
 
virtual int GetMouseYDeltaSteps ()
 the current mouse Y delta in steps, such as -2,-1,0,1,2
 
virtual bool IsLocked ()
 
virtual void SetLock (bool bLock)
 true to lock the mouse at its current location
 
virtual void UpdateX (int delta)
 
virtual void UpdateY (int delta)
 
virtual void PushMouseEvent (UINT uMsg, WPARAM wParam, LPARAM lParam)
 push a standard windows mouse event to the buffer for processing in the next frame move. More...
 
virtual void PushMouseEvent (const MSG &msg)
 push a standard windows mouse event to the buffer for processing in the next frame move. More...
 
virtual void SetCapture (CGUIBase *obj)
 
virtual void ReleaseCapture (CGUIBase *obj)
 
virtual CGUIBaseGetCapture ()
 
virtual void ReleaseCapture ()
 
virtual bool IsUseWindowsMessage ()
 whether to use window message for buffered mouse event. More...
 
virtual void SetUseWindowsMessage (bool bUseWinMsg)
 whether to use window message for buffered mouse event. More...
 
virtual void ShowCursor (bool bShowCursor)
 true to show the cursor. More...
 
virtual void ForceShowCursor (bool bShow)
 Force the device to show its cursor. More...
 
virtual int GetCursorSize ()
 get the cursor size in pixels
 
virtual bool IsMouseButtonSwapped ()
 swap left/right button. More...
 
virtual void SetMouseButtonSwapped (bool bSwapped)
 
virtual void GetDeviceCursorPos (int &x, int &y)
 get current cursor position. More...
 
virtual void SetDeviceCursorPos (int x, int y)
 
virtual void SetMousePosition (int x, int y)
 only change m_x, m_y, which is pretty fast. More...
 
virtual int GetBufferedMessageCount ()
 check if there is any unprocessed buffered window mouse message. More...
 

Public Attributes

DIDEVICEOBJECTDATA m_didod [SAMPLE_BUFFER_SIZE]
 
DWORD m_dwElements
 
DIMOUSESTATE2 m_dims2
 
DIMOUSESTATE2 m_lastMouseState
 
DIMOUSESTATE2 m_curMouseState
 
int m_x
 
int m_y
 
MSG m_buffered_mouse_msgs [SAMPLE_BUFFER_SIZE/2]
 
int m_buffered_mouse_msgs_count
 
bool m_isTouchInputting
 
CGUIBasem_objCaptured
 

Protected Attributes

bool m_bLock
 
bool m_bUseWindowMessage
 whether to use window message for buffered mouse event. More...
 
bool m_bSwapMouseButton
 swap left/right button. More...
 
bool m_bLastMouseReset
 

Detailed Description

base class for GUI mouse

Member Enumeration Documentation

§ MOUSE_KEY_STD

this is just traditional mouse key mapping.

Member Function Documentation

§ ForceShowCursor()

virtual void ParaEngine::CGUIMouseVirtual::ForceShowCursor ( bool  bShow)
inlinevirtual

Force the device to show its cursor.

this is different from ShowCursor in that it always calls the device API to set the cursor.

§ GetBufferedMessageCount()

int ParaEngine::CGUIMouseVirtual::GetBufferedMessageCount ( )
virtual

check if there is any unprocessed buffered window mouse message.

we call this function before Update() to check if there is any mouse event

§ GetDeviceCursorPos()

void ParaEngine::CGUIMouseVirtual::GetDeviceCursorPos ( int &  x,
int &  y 
)
virtual

get current cursor position.

§ IsMouseButtonSwapped()

bool ParaEngine::CGUIMouseVirtual::IsMouseButtonSwapped ( )
virtual

swap left/right button.

§ IsUseWindowsMessage()

bool ParaEngine::CGUIMouseVirtual::IsUseWindowsMessage ( )
virtual

whether to use window message for buffered mouse event.

default to true, if false, directInput will be used.

§ PushMouseEvent() [1/2]

void CGUIMouseVirtual::PushMouseEvent ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
virtual

push a standard windows mouse event to the buffer for processing in the next frame move.

§ PushMouseEvent() [2/2]

void CGUIMouseVirtual::PushMouseEvent ( const MSG msg)
virtual

push a standard windows mouse event to the buffer for processing in the next frame move.

§ ReadBufferedData()

HRESULT ParaEngine::CGUIMouseVirtual::ReadBufferedData ( )
virtual

we do not use Read Buffered Data, instead, mouse events are translated from windows messages. Only immediate button data are read from direct input.

§ ResetLastMouseState()

void ParaEngine::CGUIMouseVirtual::ResetLastMouseState ( )
virtual

reset mouse to make the mouse delta correct in the next frame.

§ SetMousePosition()

void ParaEngine::CGUIMouseVirtual::SetMousePosition ( int  x,
int  y 
)
virtual

only change m_x, m_y, which is pretty fast.

§ SetUseWindowsMessage()

void ParaEngine::CGUIMouseVirtual::SetUseWindowsMessage ( bool  bUseWinMsg)
virtual

whether to use window message for buffered mouse event.

default to true, if false, directInput will be used.

§ ShowCursor()

virtual void ParaEngine::CGUIMouseVirtual::ShowCursor ( bool  bShowCursor)
inlinevirtual

true to show the cursor.

only show if previous call is hide and vice versa.

Member Data Documentation

§ m_bSwapMouseButton

bool ParaEngine::CGUIMouseVirtual::m_bSwapMouseButton
protected

swap left/right button.

§ m_bUseWindowMessage

bool ParaEngine::CGUIMouseVirtual::m_bUseWindowMessage
protected

whether to use window message for buffered mouse event.

default to true, if false, directInput will be used.


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