How to detect mouse click in C?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • APmore
    New Member
    • Jul 2007
    • 14

    How to detect mouse click in C?

    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
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    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.

    Comment

    • newb16
      Contributor
      • Jul 2008
      • 687

      #3
      The very first google result for 'win32 console app mouse' (without quotes, just in case) contains example on mouse events in console from msdn.

      Comment

      • APmore
        New Member
        • Jul 2007
        • 14

        #4
        Originally posted by newb16
        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

        Comment

        • Banfa
          Recognized Expert Expert
          • Feb 2006
          • 9067

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

          Comment

          Working...