Connecting Tech Pros Worldwide Help | Site Map

How to detect mouse click in C?

  #1  
Old July 2nd, 2009, 05:43 PM
Newbie
 
Join Date: Jul 2007
Posts: 9
Hi,

I am using windows(XP).

In C, we can use scanf statement to accept any character.

I want to accept only mouse click as input.

How can I do in C?

Thanks in Advance,

Kishore
  #2  
Old July 2nd, 2009, 07:53 PM
Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,117
Provided Answers: 6

re: How to detect mouse click in C?


The is no Standard C method of interfacing with any input device except the keyboard.

TBH even if you are running on Windows I am unaware of any function in the API you could use in a console application to intercept a mouse click.
  #3  
Old July 3rd, 2009, 09:12 AM
Needs Regular Fix
 
Join Date: Jul 2008
Posts: 367
Provided Answers: 2

re: How to detect mouse click in C?


The very first google result for 'win32 console app mouse' (without quotes, just in case) contains example on mouse events in console from msdn.
  #4  
Old July 3rd, 2009, 09:51 AM
Newbie
 
Join Date: Jul 2007
Posts: 9

re: How to detect mouse click in C?


Quote:
Originally Posted by newb16 View Post
The very first google result for 'win32 console app mouse' (without quotes, just in case) contains example on mouse events in console from msdn.
Thanks for the solution,

Regards,
kishore
  #5  
Old July 3rd, 2009, 12:06 PM
Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,117
Provided Answers: 6

re: How to detect mouse click in C?


Wow, well you learn something everyday, now I need to try and remember this for the next time I get asked :D
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to detect ctrl+Right Mouse Click in a vb datagrid johnmcpherson1 answers 0 July 9th, 2007 01:37 PM
detect mouse click event samuelberthelot@googlemail.com answers 3 July 7th, 2006 09:55 AM
C# - Detect Mouse Click Outside Form akowald@gmail.com answers 3 June 4th, 2006 10:35 PM
Detect Mouse Click in different application Jeff answers 1 July 23rd, 2005 12:34 AM