Skip to content

GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.

feat(infra): add keyboard-related methods from Windows API

Lars Bergere8e8496bb8e2
diff --git a/LarsWM.Infrastructure/WindowsApi/WindowsApiService.cs b/LarsWM.Infrastructure/WindowsApi/WindowsApiService.cs
index d34849cb..b4b1b8e1 100644
--- a/LarsWM.Infrastructure/WindowsApi/WindowsApiService.cs
+++ b/LarsWM.Infrastructure/WindowsApi/WindowsApiService.cs
@@ -250,9 +250,16 @@ namespace LarsWM.Infrastructure.WindowsApi
[DllImport("user32.dll")]
public static extern IntPtr CallNextHookEx([Optional] IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
+ [DllImport("user32.dll")]
+ public static extern int GetKeyboardState(byte[] pbKeyState);
+
[DllImport("user32.dll")]
public static extern short GetKeyState(Keys nVirtKey);
+
+ [DllImport("User32.dll")]
+ public static extern short GetAsyncKeyState(Keys key);
+
public delegate void WindowEventProc(IntPtr hWinEventHook, EventConstant eventType, IntPtr hwnd, ObjectIdentifier idObject, int idChild, uint dwEventThread, uint dwmsEventTime);
[DllImport("user32.dll")]