• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 361
  • Last Modified:

Getting the mouse key flags (fwKeys)

I would like to read the mouse key flags (fwKeys) which are passed by windows in the WM_MOUSEwhatever messages - outside of the message.
I think that there is a function for that, but I cannot find it.

Actually I bypassed my problem by using my own flag with is set or cleared with WM_LBUTTONUP/DOWN messages, but I want to know if there is an easier way to do so.
  • 2
1 Solution
Simply use the 'GetKeyState()' API and provide 'VK_LBUTTON', 'VK_MBUTTON' or 'VK_RBUTTON' flags a the argument. If the high-order bit of the return value is 1, the key is down; otherwise, it is up.
FuzzyLogicAuthor Commented:
Are you sure that there is VK_[L/M/R]BUTTON?
It does not apeer in the help.
Yes, I am sure (used this technique often ;-)

See winuser.h for the definitions (although I have to admit that both these constants as the API are not well documented..
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now