Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Getting the mouse key flags (fwKeys)

Posted on 1999-07-28
Medium Priority
Last Modified: 2012-08-13
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.
Question by:FuzzyLogic
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 86

Accepted Solution

jkr earned 200 total points
ID: 1201271
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.

Author Comment

ID: 1201272
Are you sure that there is VK_[L/M/R]BUTTON?
It does not apeer in the help.
LVL 86

Expert Comment

ID: 1201273
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..

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question