migrate Pilz.Win32 & optimize Pilz & Pilz.IO

This commit is contained in:
2024-09-01 08:54:57 +02:00
parent f370642354
commit 7a94fcf360
55 changed files with 700 additions and 1427 deletions

View File

@@ -0,0 +1,22 @@
using Microsoft.VisualBasic.CompilerServices;
using Pilz.Win32.Native;
using Keys = System.Windows.Forms.Keys;
namespace Pilz.Win32.Mapped;
public class Keyboard
{
public static bool IsKeyDown(int keyCode)
{
return Conversions.ToDouble(User32.GetKeyState(keyCode).ToString() + 0x8000) < 0d;
}
public static bool IsKeyDown(Keys keyCode)
{
return IsKeyDown((int)keyCode);
}
}