Message-ID: <00dc01c34246$d07e7c00$0105a8c0@luiz> From: "Luiz Rafael Culik Guimaraes" To: Subject: Knowing if an mouse event occur Date: Fri, 4 Jul 2003 13:10:38 -0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-MIME-Autoconverted: from 8bit to quoted-printable by ginsberg.uol.com.br id NAA02158 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id h64GBSh16217 Reply-To: djgpp AT delorie DOT com Dear Friends Does any one has an function to know is an mouse event has occur. becouse if i put my mouse rotine on an if( !kbhit()) i dont get the proper mouse event my handle is defines as bellow void mouseint(_go32_dpmi_registers *r) { s_iButtons = r->x.bx; s_iInitCol = r->x.cx/8; s_iInitRow = r->x.dx/8; // printf("estou nio instala?Ĉo dohandler do mouse\n "); // fprintf(stdout, "bu %d col %d row %d\n", s_iButtons , s_iInitCol ,s_iInitRow); // printf( "bu %d col %d row %d\n", s_iButtons , s_iInitCol ,s_iInitRow); } int SetMouseEventHandler(unsigned int EventMask, void (*func)(__dpmi_regs *)) { __dpmi_regs r; /* LOCK_VARIABLE(s_iInitCol); LOCK_VARIABLE(s_iInitRow); LOCK_VARIABLE(s_iButtons); LOCK_FUNCTION(mouseint);*/ callback_info.pm_offset=(int)func; /* Obtain the offset of the handler */ /* callback_info.pm_selector=_my_cs(); Obtain the segment of the handler */ /* The mouse driver expects a real-mode function, so I need to wrap * my protected-mode handler function with a real-mode stub. */ if(_go32_dpmi_allocate_real_mode_callback_retf(&callback_info,&callback_regs )) return -1; // fprintf(stdout," passei instala?Ĉo dohandler do mouse\n "); r.x.ax = SET_EVENT_HANDLER; /* Call function 0Ch */ r.x.cx = 127; /* The mask that holds the events... */ /* The previous function filled the 'rm_offset' and rm_segment' fields * of callback_info. All I need to do is pass them to the ISR. */ r.x.dx = callback_info.rm_offset; r.x.es = callback_info.rm_segment; __dpmi_int(MOUSE_INT,&r); /* Install callback */ return(r.x.flags & 1) ? -1 : 0; } Regards Luiz