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