20 lines
372 B
C#
20 lines
372 B
C#
using Pilz.Win32.Native;
|
|
using Keys = System.Windows.Forms.Keys;
|
|
|
|
namespace Pilz.Win32.Mapped;
|
|
|
|
|
|
public class Keyboard
|
|
{
|
|
|
|
public static bool IsKeyDown(int keyCode)
|
|
{
|
|
return Convert.ToDouble(User32.GetKeyState(keyCode).ToString() + 0x8000) < 0d;
|
|
}
|
|
|
|
public static bool IsKeyDown(Keys keyCode)
|
|
{
|
|
return IsKeyDown((int)keyCode);
|
|
}
|
|
|
|
} |