Ok, I've been looking at a tutorial for keyboard input... and at the end, it says this:
The only thing I really need from the LPARAM is the last part, about the key being pressed/released, but how do I get its value? (I mean, do I typecast to a bool or something, or use some macro?)Code:This following is the BIT values breakdown of the 32-bit LPARAM -- Be sure to check MSDN for any changes 0 - 15 Specifies the repeat count for the current message. The value is the number of times the keystroke is auto-repeated as a result of the user holding down the key 16 - 23 Specifies the scan code. The value depends on the original equipment manufacturer (OEM) 24 Specifies whether the key is an extended key, such as the right-hand alt and ctrl keys that appear on an enhanced 101-key or 102-key keyboard. The value is 1 if it is an extended key otherwise it's 0 25 - 28 Reserved 29 The context code. The value is 1 if the alt key is held down while the key is pressed otherwise it's 0 30 The previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up 31 The transition state. The value is 1 if the key is being released, or it's 0 if the key is being pressed



LinkBack URL
About LinkBacks




I got that far, but I want to be able to figure out when the key is released. I actually started out trying to use WM_KEYDOWN/KEYUP, but I couldn't figure out how the virtual-key codes worked. Then I looked at WM_CHAR and it has that flag thingee telling if the message was generated because the key was being pressed or released... I tried doing this: