From b7ea56accd6158e2d7848d2c4ad202400c0dd97d Mon Sep 17 00:00:00 2001 From: cholleme <> Date: Sun, 16 Nov 2003 22:21:14 +0000 Subject: [PATCH] Fixed some mouse input issues --- in_win.c | 13 ++++++++++--- keys.c | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/in_win.c b/in_win.c index 919671f..fe4dec7 100644 --- a/in_win.c +++ b/in_win.c @@ -251,6 +251,7 @@ void IN_AbsoluteMouse (void) if (mouserelative) { + Cbuf_AddText("mousemove 0 0\n"); if (dinput) { hr = IDirectInputDevice_SetProperty(g_pMouse, DIPROP_AXISMODE, &dipdw.diph); if (FAILED(hr)) { @@ -266,7 +267,7 @@ void IN_AbsoluteMouse (void) IN_ActivateMouse Get the mouse "exclusively" - Called at: startup, alt-tab activate + Called at: startup, alt-tab, activate =========== */ void IN_ActivateMouse (void) @@ -274,6 +275,8 @@ void IN_ActivateMouse (void) mouseactivatetoggle = true; + //Con_Printf("Activate mouse\n"); + if (mouseinitialized) { if (dinput) @@ -299,7 +302,7 @@ void IN_ActivateMouse (void) if (key_dest == key_game) SetCursorPos (window_center_x, window_center_y); - //SetCapture (mainwindow); + SetCapture (mainwindow); //ClipCursor (&window_rect); } @@ -320,6 +323,8 @@ void IN_DeactivateMouse (void) mouseactivatetoggle = false; + //Con_Printf("Deactivate mouse\n"); + if (mouseinitialized) { if (dinput) @@ -339,7 +344,7 @@ void IN_DeactivateMouse (void) // SystemParametersInfo (SPI_SETMOUSE, 0, originalmouseparms, 0); //ClipCursor (NULL); - //ReleaseCapture (); + ReleaseCapture (); } mouseactive = false; @@ -1013,6 +1018,8 @@ void IN_MouseForDest(void) { /* =========== IN_Commands + + Called every frame to process input =========== */ void IN_Commands (void) diff --git a/keys.c b/keys.c index 510c91d..7cbf98d 100644 --- a/keys.c +++ b/keys.c @@ -1012,6 +1012,7 @@ qboolean Key_MouseMoveEvent( int x, int y, qboolean relative ) { char cmd[128]; + //Con_Printf("move: %i %i\n",x,y); switch (key_dest) { case key_menu: @@ -1024,6 +1025,7 @@ qboolean Key_MouseMoveEvent( int x, int y, qboolean relative ) { case key_game: if (relative && !con_forcedup) { //if the console is forced on key_dest is key_game but there isn't a game running sprintf(cmd, "mousemove %i %i\n", x, y); + //Con_Printf(cmd); Cbuf_AddText(cmd); } return true;