Win32: add Keyboard
This commit is contained in:
19
Pilz.Win32/Mapped/Keyboard.vb
Normal file
19
Pilz.Win32/Mapped/Keyboard.vb
Normal file
@@ -0,0 +1,19 @@
|
||||
Imports Pilz.Win32.Native
|
||||
|
||||
Imports Keys = System.Windows.Forms.Keys
|
||||
|
||||
Namespace Mapped
|
||||
|
||||
Public Class Keyboard
|
||||
|
||||
Public Shared Function IsKeyDown(keyCode As Integer) As Boolean
|
||||
Return (User32.GetKeyState(keyCode) & &H8000) < 0
|
||||
End Function
|
||||
|
||||
Public Shared Function IsKeyDown(keyCode As Keys) As Boolean
|
||||
Return IsKeyDown(CInt(keyCode))
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
Reference in New Issue
Block a user