Thread: Get Mouse Click

Results 1 to 5 of 5
  1. #1
    Xocitus's Avatar
    Join Date
    May 2007
    Gender
    male
    Posts
    24
    Reputation
    10
    Thanks
    0

    Get Mouse Click

    I want to do this:

    If right mouse button is clicked do:
    cout << "something...."

  2. #2
    cjg333's Avatar
    Join Date
    Apr 2007
    Location
    indianapolis
    Posts
    300
    Reputation
    17
    Thanks
    54
    i know in vb6 its (vbkeyRbutton),but i dont know c++,try it or search google

  3. #3
    FluffyStuff's Avatar
    Join Date
    May 2007
    Location
    Dark side of the moon
    Posts
    308
    Reputation
    10
    Thanks
    150
    I use DirectX DirectInput.dll for that (probably not the best way but who cares). You need the whole DirectX SDK for that though.

  4. #4
    boom..'s Avatar
    Join Date
    Apr 2007
    Posts
    148
    Reputation
    11
    Thanks
    11
    while ( 1 == 1 )
    {

    if (GetAsyncKeyState(0x02))
    {
    cout<< "Right mouse button!!!";

    }

    }

  5. #5
    FluffyStuff's Avatar
    Join Date
    May 2007
    Location
    Dark side of the moon
    Posts
    308
    Reputation
    10
    Thanks
    150
    Quote Originally Posted by boom View Post
    while ( 1 == 1 )
    {

    if (GetAsyncKeyState(0x02))
    {
    cout<< "Right mouse button!!!";

    }

    }
    Do you always use that while loop?
    While (true) { ... } is better.

Similar Threads

  1. [HELP] Mouse Clicks
    By Golden. in forum Visual Basic Programming
    Replies: 1
    Last Post: 07-01-2010, 06:30 AM
  2. [HELP] Fast Mouse Click Code[Solved]
    By <(-_-)> in forum Visual Basic Programming
    Replies: 6
    Last Post: 04-01-2010, 08:41 PM
  3. [HELP]Fast Mouse Click[Solved]
    By <(-_-)> in forum Visual Basic Programming
    Replies: 5
    Last Post: 03-27-2010, 09:24 PM
  4. Method to Stimulate Mouse Clicks
    By zhaoyun333 in forum C++/C Programming
    Replies: 0
    Last Post: 01-23-2010, 10:10 PM
  5. Storing Mouse Clicks
    By gwentravolta in forum Visual Basic Programming
    Replies: 9
    Last Post: 11-07-2009, 03:38 AM