icculus quake2 doxygen
1.0 dev
|
|
Go to the documentation of this file.
23 #include "../client/client.h"
30 #define JOY_ABSOLUTE_AXIS 0x00000000 // control like a joystick
31 #define JOY_RELATIVE_AXIS 0x00000010 // control like a mouse, spinner, trackball
32 #define JOY_MAX_AXES 6 // X, Y, Z, R, U, V
47 JOY_RETURNX, JOY_RETURNY, JOY_RETURNZ, JOY_RETURNR, JOY_RETURNU, JOY_RETURNV
162 width = GetSystemMetrics (SM_CXSCREEN);
163 height = GetSystemMetrics (SM_CYSCREEN);
185 while (ShowCursor (FALSE) >= 0)
211 while (ShowCursor (TRUE) < 0)
250 if ( (mstate & (1<<
i)) &&
256 if ( !(mstate & (1<<
i)) &&
502 if ((numdevs = joyGetNumDevs ()) == 0)
511 memset (&
ji, 0,
sizeof(
ji));
512 ji.dwSize =
sizeof(
ji);
513 ji.dwFlags = JOY_RETURNCENTERED;
515 if ((mmr = joyGetPosEx (
joy_id, &
ji)) == JOYERR_NOERROR)
520 if (mmr != JOYERR_NOERROR)
522 Com_Printf (
"\njoystick not found -- no valid joysticks (%x)\n\n", mmr);
528 memset (&jc, 0,
sizeof(jc));
529 if ((mmr = joyGetDevCaps (
joy_id, &jc,
sizeof(jc))) != JOYERR_NOERROR)
531 Com_Printf (
"\njoystick not found -- invalid joystick capabilities (%x)\n\n", mmr);
638 joy_flags = JOY_RETURNCENTERED | JOY_RETURNBUTTONS | JOY_RETURNPOV;
657 DWORD buttonstate, povstate;
667 buttonstate =
ji.dwButtons;
690 if(
ji.dwPOV != JOY_POVCENTERED)
692 if (
ji.dwPOV == JOY_POVFORWARD)
694 if (
ji.dwPOV == JOY_POVRIGHT)
696 if (
ji.dwPOV == JOY_POVBACKWARD)
698 if (
ji.dwPOV == JOY_POVLEFT)
702 for (
i=0 ;
i < 4 ;
i++)
727 memset (&
ji, 0,
sizeof(
ji));
728 ji.dwSize =
sizeof(
ji);
731 if (joyGetPosEx (
joy_id, &
ji) == JOYERR_NOERROR)
790 fAxisValue -= 32768.0;
793 fAxisValue /= 32768.0;
DWORD dwAxisMap[JOY_MAX_AXES]
void IN_JoyMove(usercmd_t *cmd)
DWORD dwAxisFlags[JOY_MAX_AXES]
#define JOY_ABSOLUTE_AXIS
void IN_MouseEvent(int mstate)
DWORD dwControlMap[JOY_MAX_AXES]
void Key_Event(int key, qboolean down, unsigned time)
cvar_t * joy_forwardsensitivity
void IN_StartupJoystick(void)
cvar_t * joy_sidesensitivity
int originalmouseparms[3]
void IN_ClearStates(void)
void IN_DeactivateMouse(void)
cvar_t * joy_upsensitivity
PDWORD RawValuePointer(int axis)
void Joy_AdvancedUpdate_f(void)
cvar_t * joy_pitchthreshold
cvar_t * Cvar_Get(char *var_name, char *var_value, int flags)
cvar_t * joy_yawthreshold
#define JOY_RELATIVE_AXIS
cvar_t * joy_sidethreshold
void IN_Activate(qboolean active)
cvar_t * joy_yawsensitivity
qboolean IN_ReadJoystick(void)
PDWORD pdwRawValue[JOY_MAX_AXES]
void Cmd_AddCommand(char *cmd_name, xcommand_t function)
void IN_StartupMouse(void)
qboolean joy_advancedinit
void IN_ActivateMouse(void)
qboolean mouseinitialized
cvar_t * joy_forwardthreshold
void IN_Move(usercmd_t *cmd)
cvar_t * joy_pitchsensitivity
void Com_Printf(char *fmt,...)
void IN_MouseMove(usercmd_t *cmd)
float Cvar_VariableValue(char *var_name)