Fixed some mouse input issues
This commit is contained in:
parent
1b088021f5
commit
b7ea56accd
2 changed files with 12 additions and 3 deletions
13
in_win.c
13
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)
|
||||
|
|
2
keys.c
2
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;
|
||||
|
|
Loading…
Reference in a new issue