Jump to content
  • Advertisement
Sign in to follow this  
b1gjo3

lParam bit 30?

This topic is 3646 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi How do I check lParam bit 30 to be either 1 or 0 for the last key being up or down? Im using this in KeyboardProc Thanks

Share this post


Link to post
Share on other sites
Advertisement
Might be an easier way but you can just use bitwise operators (Assuming my math is right ;) :
if( (lParam & 0x20000000)==1) //! mask bit 30
// its set
else
// its not set

Share this post


Link to post
Share on other sites
Quote:
Original post by Crypter
Might be an easier way but you can just use bitwise operators (Assuming my math is right ;) :
if( (lParam & 0x20000000)==1) //! mask bit 30
// its set
else
// its not set
0x40000000 is bit 30, since the bit numbers are 0-based.

EDIT: Or just use (1<<30) [smile]

Share this post


Link to post
Share on other sites
EvilSteve

can you explain more on (1<<30). What is the operator << for? ive never seen this kind of check

Share this post


Link to post
Share on other sites
Quote:
can you explain more on (1<<30). What is the operator << for? ive never seen this kind of check
Link.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!