|
|
@ -376,7 +376,7 @@ static vgui::MouseCode ButtonCodeToMouseCode( ButtonCode_t buttonCode ) |
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
bool InputHandleInputEvent( const InputEvent_t &event ) |
|
|
|
bool InputHandleInputEvent( const InputEvent_t &event ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch( event.m_nType & 0xFFFF ) |
|
|
|
switch( event.m_nType ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case IE_ButtonPressed: |
|
|
|
case IE_ButtonPressed: |
|
|
|
{ |
|
|
|
{ |
|
|
@ -428,9 +428,10 @@ bool InputHandleInputEvent( const InputEvent_t &event ) |
|
|
|
case IE_FingerDown: |
|
|
|
case IE_FingerDown: |
|
|
|
{ |
|
|
|
{ |
|
|
|
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h); |
|
|
|
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h); |
|
|
|
uint data = (uint)event.m_nData; |
|
|
|
float _x, _y; |
|
|
|
x = w*((double)((data >> 16) & 0xFFFF) / 0xFFFF); |
|
|
|
memcpy( &_x, &event.m_nData2, sizeof(_x) ); |
|
|
|
y = h*((double)(data & 0xFFFF) / 0xFFFF); |
|
|
|
memcpy( &_y, &event.m_nData3, sizeof(_y) ); |
|
|
|
|
|
|
|
x = w*_x; y = h*_y; |
|
|
|
g_pIInput->UpdateCursorPosInternal( x, y ); |
|
|
|
g_pIInput->UpdateCursorPosInternal( x, y ); |
|
|
|
g_pIInput->SetMouseCodeState( MOUSE_LEFT, vgui::BUTTON_PRESSED ); |
|
|
|
g_pIInput->SetMouseCodeState( MOUSE_LEFT, vgui::BUTTON_PRESSED ); |
|
|
|
g_pIInput->InternalMousePressed( MOUSE_LEFT ); |
|
|
|
g_pIInput->InternalMousePressed( MOUSE_LEFT ); |
|
|
@ -439,9 +440,10 @@ bool InputHandleInputEvent( const InputEvent_t &event ) |
|
|
|
case IE_FingerUp: |
|
|
|
case IE_FingerUp: |
|
|
|
{ |
|
|
|
{ |
|
|
|
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h); |
|
|
|
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h); |
|
|
|
uint data = (uint)event.m_nData; |
|
|
|
float _x, _y; |
|
|
|
x = w*((double)((data >> 16) & 0xFFFF) / 0xFFFF); |
|
|
|
memcpy( &_x, &event.m_nData2, sizeof(_x) ); |
|
|
|
y = h*((double)(data & 0xFFFF) / 0xFFFF); |
|
|
|
memcpy( &_y, &event.m_nData3, sizeof(_y) ); |
|
|
|
|
|
|
|
x = w*_x; y = h*_y; |
|
|
|
g_pIInput->UpdateCursorPosInternal( x, y ); |
|
|
|
g_pIInput->UpdateCursorPosInternal( x, y ); |
|
|
|
g_pIInput->SetMouseCodeState( MOUSE_LEFT, vgui::BUTTON_RELEASED ); |
|
|
|
g_pIInput->SetMouseCodeState( MOUSE_LEFT, vgui::BUTTON_RELEASED ); |
|
|
|
g_pIInput->InternalMouseReleased( MOUSE_LEFT ); |
|
|
|
g_pIInput->InternalMouseReleased( MOUSE_LEFT ); |
|
|
@ -450,9 +452,10 @@ bool InputHandleInputEvent( const InputEvent_t &event ) |
|
|
|
case IE_FingerMotion: |
|
|
|
case IE_FingerMotion: |
|
|
|
{ |
|
|
|
{ |
|
|
|
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h); |
|
|
|
int w,h,x,y; g_MatSystemSurface.GetScreenSize(w, h); |
|
|
|
uint data = (uint)event.m_nData; |
|
|
|
float _x, _y; |
|
|
|
x = w*((double)((data >> 16) & 0xFFFF) / 0xFFFF); |
|
|
|
memcpy( &_x, &event.m_nData2, sizeof(_x) ); |
|
|
|
y = h*((double)(data & 0xFFFF) / 0xFFFF); |
|
|
|
memcpy( &_y, &event.m_nData3, sizeof(_y) ); |
|
|
|
|
|
|
|
x = w*_x; y = h*_y; |
|
|
|
g_pIInput->InternalCursorMoved( x, y ); |
|
|
|
g_pIInput->InternalCursorMoved( x, y ); |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
return true; |
|
|
|