- Code reformatting

- Confirming X11 keyhandling bug fix.  (icculus patchset #7)
This commit is contained in:
Jamie Wilkinson 2002-12-01 02:35:16 +00:00
parent 085cead6f3
commit 9f69eb11f1
4 changed files with 55 additions and 32 deletions

View file

@ -638,13 +638,13 @@ static int XLateKey(XKeyEvent *ev)
case 0x03c: key = ',';break;/* [<] */ case 0x03c: key = ',';break;/* [<] */
#endif #endif
default: default:
key = *(unsigned char*)buf; key = *(unsigned char*)buf;
if (key >= 'A' && key <= 'Z') if (key >= 'A' && key <= 'Z')
key = key - 'A' + 'a'; key = key - 'A' + 'a';
if (key >= 1 && key <= 26) /* ctrl+alpha */ if (key >= 1 && key <= 26) /* ctrl+alpha */
key = key + 'a' - 1; key = key + 'a' - 1;
break; break;
} }
return key; return key;

View file

@ -202,13 +202,13 @@ void KBD_Close(void)
static qboolean UseMouse = true; static qboolean UseMouse = true;
static int mouse_buttons; static int mouse_buttons;
static int mouse_buttonstate; static int mouse_buttonstate;
static int mouse_oldbuttonstate; static int mouse_oldbuttonstate;
static float mouse_x, mouse_y; static float mouse_x, mouse_y;
static float old_mouse_x, old_mouse_y; static float old_mouse_x, old_mouse_y;
static int mx, my; static int mx, my;
static int mwheel; static int mwheel;
static cvar_t *m_filter; static cvar_t *m_filter;
static cvar_t *in_mouse; static cvar_t *in_mouse;
@ -250,13 +250,12 @@ static void mousehandler(int buttonstate, int dx, int dy)
my += dy; my += dy;
} }
#else /* drx is assumed to be the mouse wheel */ #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) static void mousehandler(int buttonstate, int dx, int dy, int dz, int drx, int dry, int drz) {
{ mouse_buttonstate = buttonstate;
mouse_buttonstate = buttonstate; mx += dx;
mx += dx; my += dy;
my += dy;
mwheel = drx; mwheel = drx;
} }
#endif #endif
@ -333,12 +332,12 @@ void RW_IN_Commands (void)
mouse_oldbuttonstate = mouse_buttonstate; mouse_oldbuttonstate = mouse_buttonstate;
if (mwheel < 0) { if (mwheel < 0) {
in_state->Key_Event_fp (K_MWHEELUP, true); in_state->Key_Event_fp (K_MWHEELUP, true);
in_state->Key_Event_fp (K_MWHEELUP, false); in_state->Key_Event_fp (K_MWHEELUP, false);
} }
if (mwheel > 0) { if (mwheel > 0) {
in_state->Key_Event_fp (K_MWHEELDOWN, true); in_state->Key_Event_fp (K_MWHEELDOWN, true);
in_state->Key_Event_fp (K_MWHEELDOWN, false); in_state->Key_Event_fp (K_MWHEELDOWN, false);
} }
mwheel = 0; mwheel = 0;
} }

View file

@ -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 ** RW_SDL.C
** **

View file

@ -1,4 +1,6 @@
/* $Id$ /* $Id$
*
* all os-specific X11 software refresh code
* *
* Copyright (C) 1997-2001 Id Software, Inc. * Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (c) 2002 The Quakeforge Project. * Copyright (c) 2002 The Quakeforge Project.
@ -911,14 +913,14 @@ int XLateKey(XKeyEvent *ev)
case 0x03c: key = ',';break;/* [<] */ case 0x03c: key = ',';break;/* [<] */
#endif #endif
default: default:
key = *(unsigned char*)buf; key = *(unsigned char*)buf;
if (key >= 'A' && key <= 'Z') if (key >= 'A' && key <= 'Z')
key = key - 'A' + 'a'; key = key - 'A' + 'a';
if (key >= 1 && key <= 26) /* ctrl+alpha */ if (key >= 1 && key <= 26) /* ctrl+alpha */
key = key + 'a' - 1; key = key + 'a' - 1;
break; break;
} }
return key; return key;
} }