how to make?

V

venkatesh

hai,
I am try to implement when I am clicking mouse key it should perform
some actions ,please any one know please tell about how to make it?
please tell any links for that operation
 
C

Christopher Benson-Manica

venkatesh said:
I am try to implement when I am clicking mouse key it should perform
some actions ,please any one know please tell about how to make it?
please tell any links for that operation

(A bit tough, since you haven't even told us what language you're using.)

Your post is off-topic for comp.lang.c. Please visit

http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html

for posting guidelines and frequently asked questions. Thank you.
 
P

pemo

venkatesh said:
hai,
I am try to implement when I am clicking mouse key it should perform
some actions ,please any one know please tell about how to make it?
please tell any links for that operation

It 'reads like' English isn't your first language.

Please be more specific - the more detail you provide --- well, the better
the replies are likely to be.
 
K

Keith Thompson

pemo said:
It 'reads like' English isn't your first language.

Please be more specific - the more detail you provide --- well, the better
the replies are likely to be.

Sorry, but asking the question more clearly isn't likely to help. The
question seems clear enough to me already; he wants to know how to
make a C program perform some action when the user clicks a mouse key.

Standard C provides no facilities for doing this. He'll need to ask
in a newwsgroup that's specific to whatever system he's using.
 
F

Flash Gordon

pemo said:
It 'reads like' English isn't your first language.

Please be more specific - the more detail you provide --- well, the better
the replies are likely to be.

Since mice are not supported by standard C it is not topical and the OP
should *not* post additional detail here, nor should the OP be
encouraged to post additional information here.

The OP should as in a group for the system of interest and provide
detail there.
 
M

Mabden

#include <conio.h>
#include <dos.h>
#include <stdio.h>
#include <stdlib.h>

#define MOUSE 0x33
#define IRET 0xcf

int main(void)
{
union REGS in_reg, out_reg;
void (interrupt far *int_handle)();
long vector;
unsigned char first_byte;
char buffer[64];

int_handle = getvect(MOUSE);
first_byte = *(unsigned char far *)int_handle;
vector = (long)int_handle;

/* vector should not be 0 and first byte should not be IRET */
if ( (vector == 0) || (first_byte == IRET) )
{
fprintf(stdout,"Mouse driver not found.\n");
return(0);
}
in_reg.x.ax = 0; /* mouse reset and status */
int86(MOUSE, &in_reg, &out_reg);

if (out_reg.x.ax != (unsigned int)-1)
{
fprintf(stdout,"Mouse not found.\n");
return(0);
}
in_reg.x.ax = 36; /* get mouse info */
int86(MOUSE, &in_reg, &out_reg);
switch(out_reg.h.ch)
{
case 1:
sprintf(buffer,"a bus mouse");
break;
case 2:
sprintf(buffer,"a serial mouse");
break;
case 3:
sprintf(buffer,"an InPort mouse");
break;
case 4:
sprintf(buffer,"a PS/2 mouse");
break;
case 5:
sprintf(buffer,"an HP mouse");
break;
}
fprintf(stdout,"Mouse driver v%x.%x is loaded for %s.\n",
out_reg.h.bh, out_reg.h.bl, buffer);
return((int)out_reg.h.bh);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,175
Messages
2,570,942
Members
47,476
Latest member
blackwatermelon

Latest Threads

Top