Mouse Support in PCSCHEME


Microsoft(TM) specified a standard interface to drive the mouse from within applications. Practically all mouse vendors adhered to this interface, so it made sense to access the mouse though it from within PCSCHEME. Unfortunately, the standard was designed for interfacing to assembly language and thus contains some peculiarities, like event handlers, that have carefully to be dealt with.

The solution proposed is a slight extension of PCSCHEME's core—the virtual machine. An op-code has been added to support the int 33h calls, as well as an assembly-language event handler that dispatches requests to a Scheme closure. The solution is not perfect in the sense event handling cannot be honored in the middle of a basic instruction (for instance, during a call to readline). The slowdown due to Scheme handling of even the most simple events (like recording a move), and the context switching required, may render event handling unpractical on slow processors; the system has nevertheless successfully been used on a fast 80486 PC.

This part has been written by Larry Bartholdi.



Subsections