mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-10 14:52:08 +00:00
in_sdl.c and in_svgalib.c now use the new Key_Event api properly
This commit is contained in:
parent
8f1ff1bddc
commit
b798113da8
2 changed files with 17 additions and 17 deletions
|
@ -169,7 +169,7 @@ IN_SendKeyEvents (void)
|
|||
// If we're not directly handled and still above 255
|
||||
// just force it to 0
|
||||
if(sym > 255) sym = 0;
|
||||
Key_Event(sym, state);
|
||||
Key_Event(sym, -1, state);
|
||||
break;
|
||||
|
||||
case SDL_MOUSEBUTTONDOWN:
|
||||
|
@ -184,14 +184,14 @@ IN_SendKeyEvents (void)
|
|||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
Key_Event(K_MOUSE1 + but - 1, event.type
|
||||
Key_Event(K_MOUSE1 + but - 1, 0, event.type
|
||||
== SDL_MOUSEBUTTONDOWN);
|
||||
break;
|
||||
case 4:
|
||||
Key_Event(K_MWHEELUP, event.type == SDL_MOUSEBUTTONDOWN);
|
||||
Key_Event(K_MWHEELUP, 0, event.type == SDL_MOUSEBUTTONDOWN);
|
||||
break;
|
||||
case 5:
|
||||
Key_Event(K_MWHEELDOWN, event.type == SDL_MOUSEBUTTONDOWN);
|
||||
Key_Event(K_MWHEELDOWN, 0, event.type == SDL_MOUSEBUTTONDOWN);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -286,10 +286,10 @@ void IN_Frame(void)
|
|||
mouse_buttonstate = (i & ~0x06) | ((i & 0x02)<<1) | ((i & 0x04)>>1);
|
||||
for (i=0 ; i<3 ; i++) {
|
||||
if ( (mouse_buttonstate & (1<<i)) && !(mouse_oldbuttonstate & (1<<i)) )
|
||||
Key_Event (K_MOUSE1 + i, true);
|
||||
Key_Event (K_MOUSE1 + i, 0, true);
|
||||
|
||||
if ( !(mouse_buttonstate & (1<<i)) && (mouse_oldbuttonstate & (1<<i)) )
|
||||
Key_Event (K_MOUSE1 + i, false);
|
||||
Key_Event (K_MOUSE1 + i, 0, false);
|
||||
}
|
||||
mouse_oldbuttonstate = mouse_buttonstate;
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ static void keyhandler(int scancode, int state)
|
|||
#if 0
|
||||
Con_Printf("scancode=%x (%d%s)\n", scancode, sc, scancode&0x80?"+128":"");
|
||||
#endif
|
||||
Key_Event(scantokey[sc], state == KEY_EVENTPRESS);
|
||||
Key_Event(scantokey[sc], -1, state == KEY_EVENTPRESS);
|
||||
}
|
||||
|
||||
|
||||
|
@ -90,11 +90,11 @@ static void mousehandler(int buttonstate, int dx, int dy, int dz, int drx, int d
|
|||
mx += dx;
|
||||
my += dy;
|
||||
if (drx > 0) {
|
||||
Key_Event(K_MWHEELUP, 1);
|
||||
Key_Event(K_MWHEELUP, 0);
|
||||
Key_Event(K_MWHEELUP, 0, 1);
|
||||
Key_Event(K_MWHEELUP, 0, 0);
|
||||
} else if (drx < 0) {
|
||||
Key_Event(K_MWHEELDOWN, 1);
|
||||
Key_Event(K_MWHEELDOWN, 0);
|
||||
Key_Event(K_MWHEELDOWN, 0, 1);
|
||||
Key_Event(K_MWHEELDOWN, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -318,24 +318,24 @@ void IN_Commands(void)
|
|||
/* Perform button actions */
|
||||
if ((mouse_buttonstate & MOUSE_LEFTBUTTON) &&
|
||||
!(mouse_oldbuttonstate & MOUSE_LEFTBUTTON))
|
||||
Key_Event (K_MOUSE1, true);
|
||||
Key_Event (K_MOUSE1, 0, true);
|
||||
else if (!(mouse_buttonstate & MOUSE_LEFTBUTTON) &&
|
||||
(mouse_oldbuttonstate & MOUSE_LEFTBUTTON))
|
||||
Key_Event (K_MOUSE1, false);
|
||||
Key_Event (K_MOUSE1, 0, false);
|
||||
|
||||
if ((mouse_buttonstate & MOUSE_RIGHTBUTTON) &&
|
||||
!(mouse_oldbuttonstate & MOUSE_RIGHTBUTTON))
|
||||
Key_Event (K_MOUSE2, true);
|
||||
Key_Event (K_MOUSE2, 0, true);
|
||||
else if (!(mouse_buttonstate & MOUSE_RIGHTBUTTON) &&
|
||||
(mouse_oldbuttonstate & MOUSE_RIGHTBUTTON))
|
||||
Key_Event (K_MOUSE2, false);
|
||||
Key_Event (K_MOUSE2, 0, false);
|
||||
|
||||
if ((mouse_buttonstate & MOUSE_MIDDLEBUTTON) &&
|
||||
!(mouse_oldbuttonstate & MOUSE_MIDDLEBUTTON))
|
||||
Key_Event (K_MOUSE3, true);
|
||||
Key_Event (K_MOUSE3, 0, true);
|
||||
else if (!(mouse_buttonstate & MOUSE_MIDDLEBUTTON) &&
|
||||
(mouse_oldbuttonstate & MOUSE_MIDDLEBUTTON))
|
||||
Key_Event (K_MOUSE3, false);
|
||||
Key_Event (K_MOUSE3, 0, false);
|
||||
|
||||
mouse_oldbuttonstate = mouse_buttonstate;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue