Results 1 to 3 of 3

Thread: Keydown with no form (possible?)

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 1999
    Location
    Bucks
    Posts
    12

    Post

    How can I get the current keyboard input from within my module which has no form or UI? I just want to be able to detect the Shift status with a timer event.

    Any help appreciated.

  2. #2
    Guest

    Post

    Try this in a new module and set the startup to sub main

    Code:
    Option Explicit
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    
    Sub Main()
        Do
            If GetAsyncKeyState(vbKeyShift) <> 0 Then
                MsgBox "Shift pressed"
            End If
            DoEvents
        Loop
    End Sub
    [This message has been edited by Azzmodan (edited 11-08-1999).]

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 1999
    Location
    Bucks
    Posts
    12

    Post

    Fantastic.

    Thanks for the help, works a treat.

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