Robert Meek wrote:
> I also wasn't aware
> that Delphi doesn't support binary!  Is that true only for numerics?

No. Delphi only supports decimal and hexadecimal. No binary, and no octal.

> Now you said that GetKeyState could return any bit...meaning what in
> actual practice...that I shouldn't rely on the return as given and that I
> should mask it as well?

I think I explained what you should do in my previous message, in the 
section where I talk about what $8000 means and how it works.

> The help says it returns the high order bit

Not quite. It returns a value in the high-order bit.

> so doesn't that mean the function is doing that for me?   

The function returns the high-order bit, but it *also* returns the other 
15 bits. It's impossible to return just one bit. GetKeyState's return 
type is Word. That's a 16-bit type, and it *always* holds 16-bit values.

You're getting 16 bits from the function whether you want them or not, 
but you've only been told the meanings of two of them, you'd better make 
sure you don't let any of the other 14 interfere with your program.

In your old code, you compared the return value against zero. You were 
effectively asking whether *any* of the bits were set; any set bit 
forces the value to be nonzero.

-- 
Rob
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to