Mail Archives: djgpp/1997/05/31/17:35:01
jon writes:
>No, jlib doesn't directly do this strange mouse thing I want either,
>AFAIK. I will experiment with the code and advice you've offered.
I was experimenting with this yesterday evening, and it turns out to be
really trivial! This little function will return how far the mouse has
moved since the last time you called it...
#include <dpmi.h>
/* get_mouse_mickeys:
* Measures the mickey count (how far the mouse has moved since the
* last call to this function).
*/
void get_mouse_mickeys(int *mickeyx, int *mickeyy)
{
__dpmi_regs r;
r.x.ax = 11;
__dpmi_int(0x33, &r);
*mickeyx = (signed short)r.x.cx;
*mickeyy = (signed short)r.x.dx;
}
--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
Beauty is a French phonetic corruption of a short cloth neck ornament.
- Raw text -