IFC Reference

CImmMouse::SwitchToAbsoluteMode, CImmMouse::UsesWin32MouseServices

These class members are identical. Call either one to select between standard Win32 mouse services and DirectX for mouse input from your CImmMouse object.

BOOL UsesWin32MouseServices(
BOOL bWin32MouseServ
);
BOOL SwitchToAbsoluteMode(
BOOL bAbsMode
);

Parameters

bWin32MouseServ, bAbsMode
Boolean indicating whether the CImmMouse device should operate in relative or absolute mode. A value of TRUE indicates that the application uses standard Win32 Mouse Services and that the device should be in absolute mode, while a value of FALSE indicates that the application does not use standard Win32 Mouse Services and that the device should be in relative mode. By default, all CImmMouse devices will be in absolute mode unless this function is called.

Return Values

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE, and CIFCErrors::GetLastErrorCode() can be used to retrieve more information about the function failure.

Remarks

If your application is not using the standard Win32 mouse messages (e.g., WM_MOUSEMOVE) and functions (e.g., GetCursorPos) to read mouse movement and display the cursor, you need to notify IFC that your CImmMouse device should work in relative mode. The CImmMouse is by default in absolute mode, meaning it reports an actual screen cursor position and assumes your application is using the standard Win32 mouse services. DirectX is not part of the standard Win32 mouse services, so if you are using DirectX, you need to switch your CImmMouse object to relative mode with the following method: This function should not be used with Tactile Feedback Mice. The function should only be used with full Force Feedback, absolute style mice like the Wingman Force Feedback Mouse.

// change CImmMouse from absolute to relative position reporting

m_pTSMouse->UsesWin32MouseServices(FALSE);

or

m_pTSMouse->SwitchToAbsoluteMode(FALSE);

If you are not sure which mode to use, use the following guidelines. Applications that don’t have a screen cursor and/or allow you to move the physical mouse infinitely in one direction and continually rotate or pan (e.g., 1st person action games) generally use relative mode. Applications that actually have a cursor that stops at the edge of the screen even if you keep moving the physical mouse further generally use the absolute Win32 mouse services. A game like Microsoft’s Age of Empires allows continual panning. However, the actual cursor stops at the edge of the screen while panning, so it is using absolute mode.

IMPORTANT: If while using your Immersion device you can move the cursor in other applications but cannot get mouse movement in your application, you most likely need to either switch your CImmMouse to relative mode or use GetCursorPos if that is suitable for your application.

IMPORTANT: If your application switches your CImmMouse to relative mode, you will not be able to use the two screen-position based effects - Enclosure and Ellipse. Both these effects require you to specify their screen locations and are active only when the cursor is in those locations. If you want to use Enclosure and Ellipse effects, your application needs to leave the CImmMouse object in absolute mode and use the Win32 mouse services for mouse input.

Requirements

Hardware: Requires an Immersion TouchSense device.
Windows NT/2000:
Requires Windows 2000.
Windows 95/98/ME: Requires Windows 98 or later.
Header: Requires IFC.h.
Import Library: IFC23.lib

See Also

CImmDevice Base Member Functions