Jump to content
xisto Community
Sign in to follow this  
klusk

Mouse Input In C Programs using checkbox etc

Recommended Posts

how can we use mouse input in C programs...i think that works only in graphics mode...i tried a few functions that are available but they are not working...either i dont know how to use them properly or they dont work under my compiler...i use borlandv3.do i have to download some file from internet which will make it work or i need to use a different compiler.....and also i wish to know what all things i can do with it once it starts working,i mean checkbox or optionbox or making mouse focus specific areas.................I know these things can be done better with other languages like VB ..but i need to work in C.

Edited by klusk (see edit history)

Share this post


Link to post
Share on other sites

I'm not sure how much this helps, but I found a utility that can help with graphics implementation for C++. I am unsure how it works for C. I also haven't tested it or anything, but I guess it is worth a try.

http://www.genlogic.com/rel26.html

Also note that this does use Active-X (yuck!), which I guess saves you all the bother of reading the 25 X-Windows books to learn to make a simple pop-up...which I guess is a good thing.

Share this post


Link to post
Share on other sites

The only was to get mouse input in C programs is to include either the windows.h header file or the x-window headers. The reason is that C is a console language and does not do anything with graphics since a console is keyboard based. However, if you add a graphics header to make the program into a graphical one, you will be able to get mouse input. Look into using winmain on windows. You will see there is msgproc which has a bunch of mouse messages and this is where you will handle mouse input.

Share this post


Link to post
Share on other sites

The only was to get mouse input in C programs is to include either the windows.h header file or the x-window headers. The reason is that C is a console language and does not do anything with graphics since a console is keyboard based. However, if you add a graphics header to make the program into a graphical one, you will be able to get mouse input. Look into using winmain on windows. You will see there is msgproc which has a bunch of mouse messages and this is where you will handle mouse input.

thanx...winmain will do the work i wanted, just a part of C project at school..thought of adding something new...
i'll have to learn using winmain now.....
just thinking of trying windows.h and x- window headers but they are not present in my include directory...
i havent started using winmain...so if there is some connection between the two ....forgive me for asking this...but i just thought they are different
Edited by klusk (see edit history)

Share this post


Link to post
Share on other sites

The only was to get mouse input in C programs is to include either the windows.h header file or the x-window headers.

That's not true at all.
The gpm library (http://www.nico.schottelius.org/blog/migrated-unix.schottelius.org/) provides a mouse server without any x11 stuffs. I don't know how well it can be natively ported to windows (or if one already exists) but it should be able to be cygwin'd.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.