Discussion:
Caps Lock State on Windows
N3wCr4Zy
2009-12-11 00:58:40 UTC
Permalink
how to i get Caps Lock state (on/off) on windows with win32api?
census
2009-12-11 22:39:48 UTC
Permalink
Post by N3wCr4Zy
how to i get Caps Lock state (on/off) on windows with win32api?
public static extern short GetKeyState(int keyCode)
in user32.dll
Gabriel Genellina
2009-12-12 04:47:53 UTC
Permalink
Post by N3wCr4Zy
how to i get Caps Lock state (on/off) on windows with win32api?
py> from win32api import GetKeyState
py> from win32con import VK_CAPITAL
py> GetKeyState(VK_CAPITAL) # normal
0
py> GetKeyState(VK_CAPITAL) # CAPS LOCK set
1

See http://msdn.microsoft.com/en-us/library/ms645530(VS.85).aspx
--
Gabriel Genellina
Loading...