Results 1 to 4 of 4

Thread: [RESOLVED] global shift key released

  1. #1

    Thread Starter
    Junior Member Thunder!'s Avatar
    Join Date
    Feb 2008
    Posts
    22

    Resolved [RESOLVED] global shift key released

    helo

    how to detect the shift key being released on a global not app specific basis?

    system wide hook is overkill, what about hotkey, any other better approaches?

  2. #2

  3. #3

    Thread Starter
    Junior Member Thunder!'s Avatar
    Join Date
    Feb 2008
    Posts
    22

    Re: global shift key released

    ok thank RhinoBull... how to detect key released with it?

    Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
    Private Sub Timer1_Timer()
    Debug.Print GetKeyState(16)
    End Sub
    Last edited by Thunder!; Feb 25th, 2008 at 09:43 PM.

  4. #4
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: global shift key released

    A little different:
    Code:
    Option Explicit
    
    Private Const VK_SHIFT = &H10
    
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    
    Private Sub Timer1_Timer()
        If (GetAsyncKeyState(VK_SHIFT) And &HF0000000) = &HF0000000 Then
            Debug.Print "shift key is down"
        Else
            Debug.Print "shift key is up"
        End If
    End Sub

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