« November 2005 »
S M T W T F S
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
You are not logged in. Log in

Programming Tips
Tuesday, 8 November 2005
How to know the state of a key?
Mood:  energetic
Topic: VC++
During a function call if you want to determine the state of a key use

::GetAsyncKeyState(VK_SHIFT)

Wait a minute there is one more:

::GetKeyState(VK_SHIFT)

This function retrieves the status of the
specified virtual key. The status specifies whether 
the key is up, down, or toggled (on, off?alternating 
each time the key is pressed)

To retrieve state information for all the virtual keys, use

::GetKeyboardState(PBYTE lpKeyState)

lpKeyState:   Pointer to the 256-byte array that receives the status data for each virtual key.

Posted by Nibu babu thomas at 3:56 PM
Updated: Thursday, 10 November 2005 4:44 PM

View Latest Entries