Sign in to follow this  
3dcgmodeling

high-order bit

Recommended Posts

what does it mean? it from GetKeyboardState. "When the function returns, each member of the array pointed to by the lpKeyState parameter contains status data for a virtual key. If the high-order bit is 1, the key is down; otherwise, it is up." ----- here is link

Share this post


Link to post
Share on other sites
The high-order bit is the bit in the binary number which has the highest value. For example, in the binary number 1011, the 1 on the left has the highest value (of 2^3 or 8).

If you're not familiar with binary, I recommend this article. Note that finding the high-order bit might be tricky due to endianness.

Share this post


Link to post
Share on other sites
To get the high-order bit you need to use the logical and operator & on the high-bit, i.e., and it with 10000000 so that you get the highest bit. To represent 10000000 in C++ use hexadecimal, which in this case is 0x80

in conclusion: & 0x80

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this