|
|
@ -30,8 +30,7 @@ qboolean in_mouseinitialized; |
|
|
|
qboolean in_mouse_suspended; |
|
|
|
qboolean in_mouse_suspended; |
|
|
|
POINT in_lastvalidpos; |
|
|
|
POINT in_lastvalidpos; |
|
|
|
qboolean in_mouse_savedpos; |
|
|
|
qboolean in_mouse_savedpos; |
|
|
|
static uint in_mouse_oldbuttonstate; |
|
|
|
static int in_mstate = 0; |
|
|
|
static int in_mouse_buttons = 5; // SDL maximum
|
|
|
|
|
|
|
|
static struct inputstate_s |
|
|
|
static struct inputstate_s |
|
|
|
{ |
|
|
|
{ |
|
|
|
float lastpitch, lastyaw; |
|
|
|
float lastpitch, lastyaw; |
|
|
@ -337,50 +336,33 @@ void IN_MouseMove( void ) |
|
|
|
IN_MouseEvent |
|
|
|
IN_MouseEvent |
|
|
|
=========== |
|
|
|
=========== |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void IN_MouseEvent( uint mstate ) |
|
|
|
void IN_MouseEvent( int key, int down ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int i; |
|
|
|
int i; |
|
|
|
|
|
|
|
|
|
|
|
if( !in_mouseinitialized ) |
|
|
|
if( !in_mouseinitialized ) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( down ) |
|
|
|
|
|
|
|
SetBits( in_mstate, BIT( key )); |
|
|
|
|
|
|
|
else ClearBits( in_mstate, BIT( key )); |
|
|
|
|
|
|
|
|
|
|
|
if( cls.key_dest == key_game ) |
|
|
|
if( cls.key_dest == key_game ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// perform button actions
|
|
|
|
// perform button actions
|
|
|
|
for( i = 0; i < in_mouse_buttons; i++ ) |
|
|
|
VGui_KeyEvent( K_MOUSE1 + key, down ); |
|
|
|
{ |
|
|
|
|
|
|
|
if( FBitSet( mstate, BIT( i )) && !FBitSet( in_mouse_oldbuttonstate, BIT( i ))) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
VGui_KeyEvent( K_MOUSE1 + i, true ); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( !FBitSet( mstate, BIT( i )) && FBitSet( in_mouse_oldbuttonstate, BIT( i ))) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
VGui_KeyEvent( K_MOUSE1 + i, false ); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// don't do Key_Event here
|
|
|
|
|
|
|
|
// client may override IN_MouseEvent
|
|
|
|
|
|
|
|
// but by default it calls back to Key_Event anyway
|
|
|
|
if( in_mouseactive ) |
|
|
|
if( in_mouseactive ) |
|
|
|
clgame.dllFuncs.IN_MouseEvent( mstate ); |
|
|
|
clgame.dllFuncs.IN_MouseEvent( in_mstate ); |
|
|
|
|
|
|
|
|
|
|
|
in_mouse_oldbuttonstate = mstate; |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
// perform button actions
|
|
|
|
|
|
|
|
for( i = 0; i < in_mouse_buttons; i++ ) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if( FBitSet( mstate, BIT( i )) && !FBitSet( in_mouse_oldbuttonstate, BIT( i ))) |
|
|
|
// perform button actions
|
|
|
|
{ |
|
|
|
Key_Event( K_MOUSE1 + key, down ); |
|
|
|
Key_Event( K_MOUSE1 + i, true ); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( !FBitSet( mstate, BIT( i )) && FBitSet( in_mouse_oldbuttonstate, BIT( i ))) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Key_Event( K_MOUSE1 + i, false ); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
in_mouse_oldbuttonstate = mstate; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|