|
Public NotInheritable Class winKeyboardAPI
#Region " Public Types "
Public Enum eKeys As Integer
kLeftMouse = &H1
kRightMouse = &H2
kMiddleMouse = &H4
kTab = &H9
kReturn = &HD
kShift = &H10
kControl = &H11
kEscape = &H1B
kSpace = &H20
kLeftArrow = &H25
kUpArrow = &H26
kRightArrow = &H27
kDownArrow = &H28
kF1 = &H70
kF2 = &H71
kF3 = &H72
kF4 = &H73
kF5 = &H74
kF6 = &H75
kF7 = &H76
kF8 = &H77
kF9 = &H78
kF10 = &H79
kF11 = &H7A
kF12 = &H7B
End Enum
Public Structure KBDLLHOOKSTRUCT
Public vkCode As Integer
Public scanCode As Integer
Public flags As Integer
Public time As Integer
Public dwExtraInfo As Integer
End Structure
#End Region
#Region " Const "
Public Const HC_ACTION As Integer = 0
Public Const WH_KEYBOARD_LL As Integer = 13&
Public Const WM_KEYDOWN As Short = &H100S
#End Region
#Region " Delegates "
Public Delegate Function KeyboardHookDelegate(ByVal Code As Integer, ByVal wParam As Integer, _
ByRef lParam As winKeyboardAPI.KBDLLHOOKSTRUCT) As Integer
#End Region
#Region " Declares "
Public Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Integer) As Integer
Public Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" _
(ByVal idHook As Integer, ByVal lpfn As KeyboardHookDelegate, ByVal hmod As Integer, _
ByVal dwThreadId As Integer) As Integer
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Integer
Public Declare Function CallNextHookEx Lib "user32" _
(ByVal hHook As Integer, ByVal nCode As Integer, ByVal wParam As Integer, _
ByVal lParam As KBDLLHOOKSTRUCT) As Integer
#End Region
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.