Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Caps Lock State on Windows

Reply
Thread Tools

Caps Lock State on Windows

 
 
N3wCr4Zy
Guest
Posts: n/a
 
      12-11-2009
how to i get Caps Lock state (on/off) on windows with win32api?
 
Reply With Quote
 
 
 
 
census
Guest
Posts: n/a
 
      12-11-2009
N3wCr4Zy wrote:

> how to i get Caps Lock state (on/off) on windows with win32api?


public static extern short GetKeyState(int keyCode)
in user32.dll
 
Reply With Quote
 
 
 
 
Gabriel Genellina
Guest
Posts: n/a
 
      12-12-2009
En Thu, 10 Dec 2009 21:58:40 -0300, N3wCr4Zy <(E-Mail Removed)> escribió:

> 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/libr...30(VS.85).aspx

--
Gabriel Genellina

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Keyboard CAPS LOCK only turns off with the shift key... BillyBob@nospam.com Computer Support 20 10-01-2013 08:44 PM
Sometimes Caps Lock comes on and stays on for no apparent reason GrandpaChuck Computer Support 18 02-15-2012 09:32 AM
caps lock coming on spontaneously GrandpaChuck Computer Support 11 01-09-2007 08:25 PM
Determining caps lock state Robert Javascript 17 10-30-2005 10:58 PM
"Caps Lock" Key Problem Julie P. Computer Support 11 07-08-2004 04:16 AM



Advertisments