Win32: add Keyboard

This commit is contained in:
2023-11-13 14:49:44 +01:00
parent 75c916b0b6
commit f79939413b
3 changed files with 24 additions and 1 deletions

View 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

View File

@@ -14,6 +14,10 @@ Namespace Native
Public Shared Function ChildWindowFromPointEx(ByVal hWndParent As IntPtr, ByVal pt As POINT, ByVal uFlags As UInteger) As IntPtr
End Function
<DllImport(LIB_USER32)>
Public Shared Function GetKeyState(keyCode As Integer) As Short
End Function
End Class
End Namespace

View File

@@ -28,7 +28,7 @@
<PropertyGroup>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<IncrementVersionOnBuild>1.yyyy.Mdd.Hmm</IncrementVersionOnBuild>
<Version>1.2023.1027.851</Version>
<Version>1.2023.1113.1443</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />