At the beginning of an "IF" statement, I have:

if (SHORT GetKeyState(int 48)==1){

When compiling I get a syntax error just before the constant, and I've played around with it a bit, but haven't found what to do.

Could someone fix this or explain to me why it's not working?

13 Years
Discussion Span
Last Post by Narue

Prototypes tell you the expected types, but when you call a function you don't include the type -- the type is inherently part of the variable or literal being used in the call. That is,

if (GetKeyState(48)==1){

I had realized that a bit after I posted, but I seem to be getting the low bit instead of the high bit, which is the one I need.

Isn't there a HIGH() operator or something?


>How can I take only the high order bit from that command?
Here's a slight push in the direction of a solution:

#define bit(i) (1UL << (i))

You can use it to test a certain bit by ANDing the result of bit(n) with the value:

if ((GetKeyState(48) & bit(7)) != 0)
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.