-
CAPS LOCK key detect
Dear All,
I am working in a C programme which need to check the CAPS LOCK key state. I need to check weather the CAPS LOCK is on state or off. Unlike other keys, once you press CAPS LOCK key it goes to ON state and OFF when press again. I have tried this by using GetAsyncKeyState and GetKeyState functions and I cant do that usimng those functions.
Pls help me to findout a code for this in.
-
I believe the key state of capslock is actually maintained by the keyboard rather then the system (you can see this in simple OSs such as DOS or even by hitting capslock before you finish booting). Of course, you'd still be able to detect when it was hit, and might be able to resolve a working solution from there. Still, I'd be interested in seeing the answer to this question, as I am not 100 percent sure on this.
-
So have you gone to MSDN, looked up say GetAsyncKeyState(), then gone exploring the related functions to see if anything seems likely?
-
GetKeyboardState() is the function you want.