Changed mouse UnAcquire to NOT unacquire it on multiple unacquires.

Implemented DIPROP_AXISMODE for SysMouseAImpl_SetProperty.
This commit is contained in:
Andreas Mohr 2000-10-31 01:02:43 +00:00 committed by Alexandre Julliard
parent 4dc7f4ca06
commit 0f5231d980
1 changed files with 25 additions and 14 deletions

View File

@ -1125,7 +1125,7 @@ static ULONG WINAPI SysMouseAImpl_Release(LPDIRECTINPUTDEVICE2A iface)
if (This->data_queue != NULL)
HeapFree(GetProcessHeap(),0,This->data_queue);
/* Install the previous event handler (in case of releasing an aquired
/* Install the previous event handler (in case of releasing an acquired
mouse device) */
if (This->prev_handler != NULL)
MOUSE_Enable(This->prev_handler);
@ -1456,7 +1456,7 @@ static HRESULT WINAPI SysMouseAImpl_Acquire(LPDIRECTINPUTDEVICE2A iface)
This->acquired = 1;
}
return 0;
return DI_OK;
}
/******************************************************************************
@ -1464,21 +1464,26 @@ static HRESULT WINAPI SysMouseAImpl_Acquire(LPDIRECTINPUTDEVICE2A iface)
*/
static HRESULT WINAPI SysMouseAImpl_Unacquire(LPDIRECTINPUTDEVICE2A iface)
{
ICOM_THIS(SysMouseAImpl,iface);
ICOM_THIS(SysMouseAImpl,iface);
TRACE("(this=%p)\n",This);
TRACE("(this=%p)\n",This);
/* Reinstall previous mouse event handler */
MOUSE_Enable(This->prev_handler);
This->prev_handler = NULL;
if (This->acquired)
{
/* Reinstall previous mouse event handler */
MOUSE_Enable(This->prev_handler);
This->prev_handler = NULL;
/* No more locks */
current_lock = NULL;
/* No more locks */
current_lock = NULL;
/* Unacquire device */
This->acquired = 0;
/* Unacquire device */
This->acquired = 0;
}
else
ERR("Unacquiring a not-acquired device !!!\n");
return 0;
return DI_OK;
}
/******************************************************************************
@ -1610,6 +1615,12 @@ static HRESULT WINAPI SysMouseAImpl_SetProperty(LPDIRECTINPUTDEVICE2A iface,
This->queue_len = pd->dwData;
break;
}
case (DWORD) DIPROP_AXISMODE: {
LPCDIPROPDWORD pd = (LPCDIPROPDWORD)ph;
This->absolute = !(pd->dwData);
TRACE("absolute mode: %d\n", This->absolute);
break;
}
default:
FIXME("Unknown type %ld (%s)\n",(DWORD)rguid,debugstr_guid(rguid));
break;
@ -1876,7 +1887,7 @@ static HRESULT WINAPI JoystickAImpl_Unacquire(LPDIRECTINPUTDEVICE2A iface)
close(This->joyfd);
This->joyfd = -1;
}
return 0;
return DI_OK;
}
#define map_axis(val) ((val+32768)*(This->lMax-This->lMin)/65536+This->lMin)
@ -1944,7 +1955,7 @@ static HRESULT WINAPI JoystickAImpl_GetDeviceState(
}
/******************************************************************************
* GetDeviceState : gets buffered input data.
* GetDeviceData : gets buffered input data.
*/
static HRESULT WINAPI JoystickAImpl_GetDeviceData(LPDIRECTINPUTDEVICE2A iface,
DWORD dodsize,