Help need in getting keyboard events
Hi,
I need to know how i can get whether the CAPS lock is on or off.
the GetKeyState(VK_CAPITAL) is not returning me proper value, if the caps lock is toggled between the consequtive excecution of this function.
Same thing i want to about the shift key. how can i get whether its pressed or not. I am running the VB application in background so i can use only win32 apis not any keypress event of VB.
Thanks,
Sachin
Re: Help need in getting keyboard events
To find out if Caps lock is on look here : http://www.vbforums.com/showpost.php...6&postcount=19.
The code for Shift will probably be with a different constant :)
Re: Help need in getting keyboard events
No, that is not returning the proper value. that function checks only if there is a change in the state of that key from the last time this fuction is called. so if you change the key state multiple times between the two exceution of this function it will not return a correct value.
you can validate this by putting the function in a timer.
Re: Help need in getting keyboard events
Quote:
Originally Posted by sachinsugandhi
No, that is not returning the proper value. that function checks only if there is a change in the state of that key from the last time this fuction is called. so if you change the key state multiple times between the two exceution of this function it will not return a correct value.
you can validate this by putting the function in a timer.
It always returns the correct value for me... :confused: