mirror of
https://git.code.sf.net/p/quake/quake2forge
synced 2024-12-12 13:42:21 +00:00
- Code reformatting
- Confirming X11 keyhandling bug fix. (icculus patchset #7)
This commit is contained in:
parent
085cead6f3
commit
9f69eb11f1
4 changed files with 55 additions and 32 deletions
14
src/gl_glx.c
14
src/gl_glx.c
|
@ -638,13 +638,13 @@ static int XLateKey(XKeyEvent *ev)
|
|||
case 0x03c: key = ',';break;/* [<] */
|
||||
#endif
|
||||
|
||||
default:
|
||||
key = *(unsigned char*)buf;
|
||||
if (key >= 'A' && key <= 'Z')
|
||||
key = key - 'A' + 'a';
|
||||
if (key >= 1 && key <= 26) /* ctrl+alpha */
|
||||
key = key + 'a' - 1;
|
||||
break;
|
||||
default:
|
||||
key = *(unsigned char*)buf;
|
||||
if (key >= 'A' && key <= 'Z')
|
||||
key = key - 'A' + 'a';
|
||||
if (key >= 1 && key <= 26) /* ctrl+alpha */
|
||||
key = key + 'a' - 1;
|
||||
break;
|
||||
}
|
||||
|
||||
return key;
|
||||
|
|
|
@ -202,13 +202,13 @@ void KBD_Close(void)
|
|||
|
||||
static qboolean UseMouse = true;
|
||||
|
||||
static int mouse_buttons;
|
||||
static int mouse_buttonstate;
|
||||
static int mouse_oldbuttonstate;
|
||||
static float mouse_x, mouse_y;
|
||||
static float old_mouse_x, old_mouse_y;
|
||||
static int mx, my;
|
||||
static int mwheel;
|
||||
static int mouse_buttons;
|
||||
static int mouse_buttonstate;
|
||||
static int mouse_oldbuttonstate;
|
||||
static float mouse_x, mouse_y;
|
||||
static float old_mouse_x, old_mouse_y;
|
||||
static int mx, my;
|
||||
static int mwheel;
|
||||
|
||||
static cvar_t *m_filter;
|
||||
static cvar_t *in_mouse;
|
||||
|
@ -250,13 +250,12 @@ static void mousehandler(int buttonstate, int dx, int dy)
|
|||
my += dy;
|
||||
}
|
||||
#else /* drx is assumed to be the mouse wheel */
|
||||
static void mousehandler(int buttonstate, int dx, int dy, int dz, int drx, int dry, int drz)
|
||||
{
|
||||
mouse_buttonstate = buttonstate;
|
||||
mx += dx;
|
||||
my += dy;
|
||||
static void mousehandler(int buttonstate, int dx, int dy, int dz, int drx, int dry, int drz) {
|
||||
mouse_buttonstate = buttonstate;
|
||||
mx += dx;
|
||||
my += dy;
|
||||
|
||||
mwheel = drx;
|
||||
mwheel = drx;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -333,12 +332,12 @@ void RW_IN_Commands (void)
|
|||
mouse_oldbuttonstate = mouse_buttonstate;
|
||||
|
||||
if (mwheel < 0) {
|
||||
in_state->Key_Event_fp (K_MWHEELUP, true);
|
||||
in_state->Key_Event_fp (K_MWHEELUP, false);
|
||||
in_state->Key_Event_fp (K_MWHEELUP, true);
|
||||
in_state->Key_Event_fp (K_MWHEELUP, false);
|
||||
}
|
||||
if (mwheel > 0) {
|
||||
in_state->Key_Event_fp (K_MWHEELDOWN, true);
|
||||
in_state->Key_Event_fp (K_MWHEELDOWN, false);
|
||||
in_state->Key_Event_fp (K_MWHEELDOWN, true);
|
||||
in_state->Key_Event_fp (K_MWHEELDOWN, false);
|
||||
}
|
||||
mwheel = 0;
|
||||
}
|
||||
|
|
22
src/rw_sdl.c
22
src/rw_sdl.c
|
@ -1,3 +1,25 @@
|
|||
/* $Id$
|
||||
*
|
||||
* all os-specific SDL refresher code
|
||||
*
|
||||
* Copyright (c) 2002 The QuakeForge Project.
|
||||
*
|
||||
* 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 the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
** RW_SDL.C
|
||||
**
|
||||
|
|
18
src/rw_x11.c
18
src/rw_x11.c
|
@ -1,4 +1,6 @@
|
|||
/* $Id$
|
||||
*
|
||||
* all os-specific X11 software refresh code
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
|
@ -911,14 +913,14 @@ int XLateKey(XKeyEvent *ev)
|
|||
case 0x03c: key = ',';break;/* [<] */
|
||||
#endif
|
||||
|
||||
default:
|
||||
key = *(unsigned char*)buf;
|
||||
if (key >= 'A' && key <= 'Z')
|
||||
key = key - 'A' + 'a';
|
||||
if (key >= 1 && key <= 26) /* ctrl+alpha */
|
||||
key = key + 'a' - 1;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
key = *(unsigned char*)buf;
|
||||
if (key >= 'A' && key <= 'Z')
|
||||
key = key - 'A' + 'a';
|
||||
if (key >= 1 && key <= 26) /* ctrl+alpha */
|
||||
key = key + 'a' - 1;
|
||||
break;
|
||||
}
|
||||
|
||||
return key;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue