Mail Archives: djgpp/1996/03/11/19:01:54
Message-Id: | <199603112353.SAA29338@delorie.com>
|
Date: | Mon, 11 Mar 96 18:42:25 EST
|
From: | "William Parsons Newhall, Jr." <NEWHALL AT american DOT edu>
|
Organization: | The American University
|
Subject: | How do I correctly set a mouse interrupt handler?
|
To: | DJGPP users <DJGPP AT DELORIE DOT COM>
|
In the mailing list archive there are a number of entries from people
who wanted to write their own mouse interrupt handlers(using int 33
AX = 000C and _go32_dpmi_allocate_real_mode_callback_retf) and I have
just joined their ranks. When I move my mouse, Windows95 intervenes
saying that an exception has just occurred...has anyone successfully
written a djgpp handler? Could they tell me how they did it?
Thanks,
William Newhall
CODE FOLLOWS:
void MouseSetInterrupt(unsigned short int Condition, void * Handler)
{
_go32_dpmi_registers R;
_go32_dpmi_seginfo info;
info.pm_offset=Handler;
_go32_dpmi_allocate_real_mode_callback_retf(&info, &globalregs);
memset(&R,0,sizeof(R));
R.x.ax=0x000C;
R.x.es=info.rm_segment;
R.x.dx=info.rm_offset;
R.x.cx=Condition;
go32_simulate_int(0x33,&R);
}
.
.
.
void do_something(void)
{
printf("the mouse is moving!\n");
}
.
.
.
void main(void)
{
unsigned short int c;
c=1;
MouseSetInterrupt(c,&do_something);
do { printf("nothing's happening\n"); } while (1==1);
}
Any help is appreciated! Thanks...
- Raw text -