Caps Lock State on Windows

Discussion in 'Python' started by N3wCr4Zy, Dec 11, 2009.

  1. N3wCr4Zy

    N3wCr4Zy Guest

    how to i get Caps Lock state (on/off) on windows with win32api?
     
    N3wCr4Zy, Dec 11, 2009
    #1
    1. Advertising

  2. N3wCr4Zy

    census Guest

    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
     
    census, Dec 11, 2009
    #2
    1. Advertising

  3. En Thu, 10 Dec 2009 21:58:40 -0300, N3wCr4Zy <> 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/library/ms645530(VS.85).aspx

    --
    Gabriel Genellina
     
    Gabriel Genellina, Dec 12, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fuzzyman
    Replies:
    3
    Views:
    532
    Andrew MacIntyre
    Dec 5, 2003
  2. Robert Brewer
    Replies:
    0
    Views:
    519
    Robert Brewer
    Dec 5, 2003
  3. k3xji
    Replies:
    7
    Views:
    875
    Gabriel Genellina
    Dec 30, 2008
  4. katera
    Replies:
    9
    Views:
    492
    John W. Kennedy
    Apr 9, 2007
  5. Robert

    Determining caps lock state

    Robert, Oct 27, 2005, in forum: Javascript
    Replies:
    17
    Views:
    480
Loading...

Share This Page