CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Mouse Input

  1. #1
    Join Date
    Feb 2004
    Location
    Texas, USA
    Posts
    1,206

    Mouse Input

    Is there a function I can call to obtain the up/down status of all mouse buttons at the time of the function call?

    I'm attempting to use Win32 as a replacement of DirectInput, since DI will go bye bye soon.
    --MrDoomMaster
    --C++ Game Programmer


    Don't forget to rate me if I was helpful!

  2. #2
    Join Date
    May 2005
    Location
    United States
    Posts
    526

    Re: Mouse Input

    GetAsyncKeyState() will work for mouse buttons as well as keys on the keyboard. Use the constants VK_LBUTTON, VK_RBUTTON, and VK_MBUTTON. See the bit on the MSDN page linked above under "Remarks" regarding the difference between physical and logical mouse buttons.

  3. #3
    Join Date
    May 2005
    Posts
    4,954

    Re: Mouse Input

    ::GetAsyncKeyState(..) with VK_LBUTTON or VK_RBUTTON
    for

    /EDIT Smasher/Devourer was faster

    Cheers
    If a post helped you dont forget to "Rate This Post"

    My Article: Capturing Windows Regardless of Their Z-Order

    Cheers

  4. #4
    Join Date
    Feb 2004
    Location
    Texas, USA
    Posts
    1,206

    Re: Mouse Input

    Thanks guys, you're extremely helpful.

    I've rated both of you. Keep up the great work!
    --MrDoomMaster
    --C++ Game Programmer


    Don't forget to rate me if I was helpful!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured