TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: KNUT SCHUENEMANN
from: DANIEL HEBBERD
date: 1997-10-24 17:09:00
subject: Re: Mousepointer

KS> I'm looking for an easy way to get the mousepointer's coordinates on a
KS> mouseclick-event...
You can do this 2 ways, firstly with a LIBRARY which will make it easyer for 
you probably, and you could also use bios calls, like the example below :
void main(void) {
------ REMOVE THIS LINE , Load the mouse : -------
union REGS regs;                       
regs.x.ax = 0;                         
int86(0x33, ®s, ®s);             
if (regs.x.ax == 0) {----- NO MOUSE FOUND -----}
                                       
------ REMOVE ALL LINES including '-'s , put the mouse on the screen ---
 
union REGS regs;                       
regs.x.ax = 1;                         
int86(0x33, ®s, ®s);             
while(!1) {
------ This code below will return the status of the mouse -----
union REGS regs;
regs.x.ax = 3;                         
int86(0x33, ®s, ®s);             
printf("MOUSE - X = %d\n",regs.x.cx);
printf("MOUSE - Y = %d\n",regs.x.dx);
printf("MOUSE - Buttons = %d",regs.x.bx);
}
}
-=- DANIEL HEBBERD -=-
--- Renegade v666 dMp  
---------------
* Origin: dMp ][, Man can not live on Toons alone... (3:774/750)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.