Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Function Vknapp() As Boolean
Vknapp = (GetAsyncKeyState(vbKeyLButton) And &H8000)
End Function
Function Hknapp() As Boolean
Hknapp = (GetAsyncKeyState(vbKeyRButton) And &H8000)
End Function
Function Mknapp() As Boolean
Mknapp = (GetAsyncKeyState(vbKeyMButton) And &H8000)
End Function
Private Sub cmdH_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Print "Höger: " & Hknapp
End Sub
Private Sub cmdV_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Print "Vänster: " & Vknapp
End Sub
Private Sub cmdM_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Print "Mitten: " & Mknapp
End Sub