Results 1 to 4 of 4

Thread: Help need in getting keyboard events

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2001
    Posts
    27

    Help need in getting keyboard events

    Hi,
    I need to know how i can get whether the CAPS lock is on or off.
    the GetKeyState(VK_CAPITAL) is not returning me proper value, if the caps lock is toggled between the consequtive excecution of this function.
    Same thing i want to about the shift key. how can i get whether its pressed or not. I am running the VB application in background so i can use only win32 apis not any keypress event of VB.
    Thanks,
    Sachin

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Help need in getting keyboard events

    To find out if Caps lock is on look here : http://www.vbforums.com/showpost.php...6&postcount=19.
    The code for Shift will probably be with a different constant


    Has someone helped you? Then you can Rate their helpful post.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2001
    Posts
    27

    Re: Help need in getting keyboard events

    No, that is not returning the proper value. that function checks only if there is a change in the state of that key from the last time this fuction is called. so if you change the key state multiple times between the two exceution of this function it will not return a correct value.
    you can validate this by putting the function in a timer.

  4. #4
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Help need in getting keyboard events

    Quote Originally Posted by sachinsugandhi
    No, that is not returning the proper value. that function checks only if there is a change in the state of that key from the last time this fuction is called. so if you change the key state multiple times between the two exceution of this function it will not return a correct value.
    you can validate this by putting the function in a timer.
    It always returns the correct value for me...


    Has someone helped you? Then you can Rate their helpful post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width