#include "resource.h"
#include <commctrl.h>
+// Tell startup code that we have a client
int cl_available = true;
int (WINAPI *qwglChoosePixelFormat)(HDC, CONST PIXELFORMATDESCRIPTOR *);
*/
void ClearAllStates (void)
{
- int i;
-
-// send an up event for each key, to make sure the server clears them all
- for (i=0 ; i<256 ; i++)
- {
- Key_Event (i, false);
- }
-
Key_ClearStates ();
IN_ClearStates ();
}
if (fActive)
{
- vid_allowhwgamma = true;
if (vid_isfullscreen)
{
if (vid_wassuspended)
if (!fActive)
{
- vid_allowhwgamma = false;
vid_usingmouse = false;
IN_DeactivateMouse ();
IN_ShowMouse ();
{
LONG lRet = 1;
int fActive, fMinimized, temp;
+ char state[256];
+ short ascchar;
+ int vkey;
+ qboolean down = false;
+
extern unsigned int uiWheelMessage;
if ( uMsg == uiWheelMessage )
window_y = (int) HIWORD(lParam);
VID_UpdateWindowStatus ();
break;
-
+
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
- Key_Event (MapKey(lParam, wParam), true);
- break;
-
+ down = true;
case WM_KEYUP:
case WM_SYSKEYUP:
- Key_Event (MapKey(lParam, wParam), false);
+ vkey = MapKey(lParam, wParam);
+ GetKeyboardState (state);
+ ToAscii (wParam, vkey, state, &ascchar, 0);
+ Key_Event (vkey, (char)(ascchar & 0xFF), down);
break;
case WM_SYSCHAR:
// Event.
case WM_MOUSEWHEEL:
if ((short) HIWORD(wParam) > 0) {
- Key_Event(K_MWHEELUP, true);
- Key_Event(K_MWHEELUP, false);
+ Key_Event(K_MWHEELUP, 0, true);
+ Key_Event(K_MWHEELUP, 0, false);
} else {
- Key_Event(K_MWHEELDOWN, true);
- Key_Event(K_MWHEELDOWN, false);
+ Key_Event(K_MWHEELDOWN, 0, true);
+ Key_Event(K_MWHEELDOWN, 0, false);
}
break;
if ( (mstate & (1<<i)) &&
!(mouse_oldbuttonstate & (1<<i)) )
{
- Key_Event (K_MOUSE1 + i, true);
+ Key_Event (K_MOUSE1 + i, 0, true);
}
if ( !(mstate & (1<<i)) &&
(mouse_oldbuttonstate & (1<<i)) )
{
- Key_Event (K_MOUSE1 + i, false);
+ Key_Event (K_MOUSE1 + i, 0, false);
}
}
if (!mouseactive)
{
GetCursorPos (¤t_pos);
- ui_mouseupdate(current_pos.x - window_x, current_pos.y - window_y);
+ //ui_mouseupdate(current_pos.x - window_x, current_pos.y - window_y);
+ in_mouse_x = in_mouse_y = 0;
return;
}
if ( (mstate_di & (1<<i)) &&
!(mouse_oldbuttonstate & (1<<i)) )
{
- Key_Event (K_MOUSE1 + i, true);
+ Key_Event (K_MOUSE1 + i, 0, true);
}
if ( !(mstate_di & (1<<i)) &&
(mouse_oldbuttonstate & (1<<i)) )
{
- Key_Event (K_MOUSE1 + i, false);
+ Key_Event (K_MOUSE1 + i, 0, false);
}
}
}
}
-
/*
===========
IN_Commands
if ( (buttonstate & (1<<i)) && !(joy_oldbuttonstate & (1<<i)) )
{
key_index = (i < 4) ? K_JOY1 : K_AUX1;
- Key_Event (key_index + i, true);
+ Key_Event (key_index + i, 0, true);
}
if ( !(buttonstate & (1<<i)) && (joy_oldbuttonstate & (1<<i)) )
{
key_index = (i < 4) ? K_JOY1 : K_AUX1;
- Key_Event (key_index + i, false);
+ Key_Event (key_index + i, 0, false);
}
}
joy_oldbuttonstate = buttonstate;
{
if ( (povstate & (1<<i)) && !(joy_oldpovstate & (1<<i)) )
{
- Key_Event (K_AUX29 + i, true);
+ Key_Event (K_AUX29 + i, 0, true);
}
if ( !(povstate & (1<<i)) && (joy_oldpovstate & (1<<i)) )
{
- Key_Event (K_AUX29 + i, false);
+ Key_Event (K_AUX29 + i, 0, false);
}
}
joy_oldpovstate = povstate;