Results 1 to 2 of 2

Thread: how to tell if the shift and /or ctrl keys are up

  1. #1

    Thread Starter
    Addicted Member cwm's Avatar
    Join Date
    Mar 2000
    Posts
    133

    Post

    i have a program that uses sendkeys but it goes all fubar if you're holding either the shift or the ctrl key down (i'm pretty sure it's the ctrl key, but it may not me)

    is there any way i could tell my program to wait until they aren't being pressed down to send the info?

  2. #2
    Junior Member
    Join Date
    Mar 2000
    Location
    Montreal, QC
    Posts
    24

    Lightbulb

    Hmm, just a thought, but maybe you can see if they are held down by using the following code in the Form's Keydown event:

    Code:
       Dim ShiftDown, AltDown, CtrlDown
       ShiftDown = (Shift And vbShiftMask) > 0
       AltDown = (Shift And vbAltMask) > 0
       CtrlDown = (Shift And vbCtrlMask) > 0
    And then execute your code if it returns false, ie:

    Code:
    If Not CtrlDown Then
       SendKeys (...) 'Whatever you need to do
    End If
    Hope this helps! Now where's my two fifty?

    JMik



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