|
-
Apr 5th, 2002, 03:55 PM
#1
Thread Starter
Not NoteMe
GetKeyState
Hi all, firstly i know that i can use the getkeystate command to detect whether a key is pressed i.e. if getkeystate(vbkeyup) < 0 then...
What i wondered is, does the value returned mean anything usefull? Values i keep getting are 0,1,-128,-127 and i can't see any connection with the state of the key it checks, apart from if it's negative the user is pressing it.
Thanks for any posts.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Apr 5th, 2002, 04:37 PM
#2
Hyperactive Member
The return value specifies the status of the given virtual key, as follows:
If the high-order bit is 1, the key is down; otherwise, it is up.
If the low-order bit is 1, the key is toggled. A key, such as the caps lock key, is toggled if it is turned on. The key is off and untoggled if the low-order bit is 0. A toggle key's indicator light (if any) on the keyboard will be on when the key is toggled, and off when the key is untoggled.
I copied the answer from MSDN
High-order bit=1 means negative
High-order bit=0 means positive
-
Apr 5th, 2002, 05:05 PM
#3
Lively Member
Be warned - the key toggled bit is disabled under ME.
-
Jun 17th, 2002, 05:49 PM
#4
Addicted Member
does this include win 98 too? Is there another way to check for the capslock?
-
Jun 17th, 2002, 06:28 PM
#5
Lively Member
Nah, the key toggled bit is disabled just in ME. That aside, that's the way to do it in 98.
-
Aug 23rd, 2009, 12:40 AM
#6
New Member
Re: GetKeyState
This is what I get for GetKeyState, try this:
1 = ON
0 = OFF
-127 = 1 (ON)
-128 = 0 (OFF)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|