## Input/Output Device Driver Reference

[prev][next][parent][TOC]

### Mouse Emulation

Mouse emulation is performed by the combined Touch/Mouse device-dependent driver; instead of reporting touch-event X,Y,Z data to the TOUCH.SYS driver , the touch event is converted to an equivalent mouse event and reported to MOUSE.SYS.

To facilitate mouse emulation, the MOUSE.SYS driver has two IDC entry points for reporting data:

The conventional entry point, where real mouse events are reported

An entry point where an absolute pointing device, such as the touch screen , can call directly, with absolute X,Y values instead of the normal DX,DY relative mouse movement values (in mickeys).

The emulation is performed at the junction of the device-dependent and - independent drivers, so that at the MOUSE.SYS interfaces available to everyone (IOCtl, Mouxxx API, INT 33H API), no difference between the emulated mouse device and an actual mouse device is evident. The device- independent driver hides the differences between the various types of mouse devices that can attach to the system. These could be an actual mouse or, just as well, a tracker ball, tablet, touch screen, light pen, or even a voice recognition system.

This type of implementation is very flexible in that the mouse and touch screen can be used independently - the touch screen can be used to emulate the mouse alone (although without Button 2 capability), or it can be used to emulate the mouse with simultaneous use of the PS/2 Mouse itself.

Differences between...

OS/2, Versions 2.0 and 2.1, Mouse Support and That of Earlier Versions:

Mouse emulation is no longer performed on a per-DOS session basis. Instead, it is now ON or OFF system wide; thus, turning mouse emulation OFF using the Touch control panel affects all sessions. However, DOS sessions do have individual mouse-emulation states, which means that even if mouse emulation is ON system wide, the DOS session can turn it ON or OFF in each individual session.

The DOS INT 7FH API has its own mouse emulation ON|OFF control function, so turning mouse emulation OFF in one DOS session does not affect the emulation state in any other.

Opening of the Touch device turns off mouse emulation by default, but mouse emulation can be turned back ON while the device is still open as a Touch device. Each touch event then becomes two events: one touch and one emulated-mouse.

This facility was available in previous versions of OS/2, but it used an extra bit in the TouSetEmulOnOff() input parameter. This was further complicated by the fact that, for a given session, there were two independent sets of hardware parameters: touch and mouse emulation. Different touch thresholds could apply to a session, depending on whether mouse emulation was active.

OS/2, Versions 2.0 and 2.1, are much cleaner to implement and easier to understand with respect to mouse emulation.