From e34342eced75ff44d6dae2bbff097bfa7786f2ea Mon Sep 17 00:00:00 2001 From: Ragnvald Maartmann-Moe IV Date: Tue, 10 Apr 2001 21:01:29 +0000 Subject: [PATCH] Calm taniwha's nerves. --- include/in_win.h | 55 ++++++++++++++++++++++++++++++ include/input.h | 59 ++++++++++++++++++++++++++++++++ include/joystick.h | 83 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 197 insertions(+) create mode 100644 include/in_win.h create mode 100644 include/input.h create mode 100644 include/joystick.h diff --git a/include/in_win.h b/include/in_win.h new file mode 100644 index 000000000..9e39d7957 --- /dev/null +++ b/include/in_win.h @@ -0,0 +1,55 @@ +/* + in_win.h + + Win32 input prototypes + + Copyright (C) 1996-1997 Id Software, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + +*/ + +#ifndef _IN_WIN_H +#define _IN_WIN_H + +#include "protocol.h" + +extern qboolean mouseactive; +extern float mouse_x, mouse_y; +extern unsigned int uiWheelMessage; + +extern void IN_UpdateClipCursor (void); +extern void IN_ShowMouse (void); +extern void IN_HideMouse (void); +extern void IN_ActivateMouse (void); +extern void IN_SetQuakeMouseState (void); +extern void IN_DeactivateMouse (void); +extern void IN_RestoreOriginalMouseState (void); +extern void IN_Init (void); +extern void IN_Shutdown (void); +extern void IN_MouseEvent (int mstate); +extern void IN_MouseMove (usercmd_t *cmd); +extern void IN_Move (usercmd_t *cmd); +extern void IN_Accumulate (void); +extern void IN_ClearStates (void); +extern void IN_Commands (void); + +#endif // _IN_WIN_H + + diff --git a/include/input.h b/include/input.h new file mode 100644 index 000000000..595746183 --- /dev/null +++ b/include/input.h @@ -0,0 +1,59 @@ +/* + input.h + + External (non-keyboard) input devices + + Copyright (C) 1996-1997 Id Software, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ + +#ifndef _INPUT_H +#define _INPUT_H + +#include "client.h" +#include "protocol.h" +#include "QF/cvar.h" + +#define freelook (in_mlook.state&1 || cl_freelook->int_val) + +void IN_Init (void); +void IN_Init_Cvars (void); + +void IN_Shutdown (void); + +void IN_Commands (void); +// oportunity for devices to stick commands on the script buffer + +void IN_SendKeyEvents (void); +// Perform Key_Event () callbacks until the input que is empty + +void IN_Move (usercmd_t *cmd); +// add additional movement on top of the keyboard move cmd + +void IN_ModeChanged (void); +// called whenever screen dimensions change + +void IN_HandlePause (qboolean paused); + +extern cvar_t *_windowed_mouse; + +#endif // _INPUT_H diff --git a/include/joystick.h b/include/joystick.h new file mode 100644 index 000000000..de5bc3aea --- /dev/null +++ b/include/joystick.h @@ -0,0 +1,83 @@ +/* + joystick.h + + QuakeForge joystick DPI (driver programming interface) + + Copyright (C) 1996-1997 Jeff Teunissen + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "QF/cvar.h" +#include "protocol.h" + +extern cvar_t *joy_device; // Joystick device name +extern cvar_t *joy_enable; // Joystick enabling flag +extern cvar_t *joy_sensitivity; // Joystick sensitivity + +extern qboolean joy_found; // Joystick present? +extern qboolean joy_active; // Joystick in use? + +/* + JOY_Command () + + Use this function to process joystick button presses and generate key + events. It is called inside the IN_Commands () input function, once each + frame. + + You should exit this function immediately if either joy_active or + joy_enable->int_val are zero. +*/ +void JOY_Command (void); + +/* + JOY_Move (usercmd_t *) + + Use this function to process joystick movements to move the player around. + + You should exit this function immediately if either joy_active or + joy_enable->int_val are zero. +*/ +void JOY_Move (usercmd_t *); + +/* + JOY_Init () + + Use this function to initialize the joystick Cvars, open your joystick + device, and get it ready for use. You MUST obey the value of the + joy_enable Cvar. Set joy_found if there is a device, and joy_active if + you have successfully enabled it. +*/ +void JOY_Init (void); +void JOY_Init_Cvars (void); + +/* + JOY_Shutdown () + + Use this function to close the joystick device and tell QuakeForge that it + is no longer available. It is called from IN_Init (), but may be called + elsewhere to disable the device. +*/ +void JOY_Shutdown (void);