How can I turn caps lock on or off? I tried to find it, but all I find is to turn it on or off, which is the exact opposite of what I'm looking for.
I am trying to do this in both C ++ and Delphi.Please, help
You want the GetKeyState () function:
http://msdn.microsoft.com/en-us/library/ms646301(VS.85).aspx
with VK_CAPITAL key code. The remaining virtual key codes are here:
http://technet.microsoft.com/en-us/subscriptions/index/dd375731(v=vs.85).aspx
I found a link and below code snippet that can help you
if ((GetKeyState(VK_CAPITAL) & 0x0001)!=0) AfxMessageBox("Caps Lock ON!"); else AfxMessageBox("Caps Lock OFF!");
Use GetAsyncKeyState with VK_CAPITAL (0x14)