Skip to content

Commit 8dc39ad

Browse files
committed
windows: add GetKeyboardLayout & ToUnicodeEx
These are used along with GetForegroundWindow and GetWindowThreadProcessId to determine the current user layout and translate the base key the user has pressed.
1 parent 95f07ec commit 8dc39ad

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

windows/syscall_windows.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ func NewCallbackCDecl(fn interface{}) uintptr {
211211
//sys OpenProcess(desiredAccess uint32, inheritHandle bool, processId uint32) (handle Handle, err error)
212212
//sys ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *uint16, showCmd int32) (err error) [failretval<=32] = shell32.ShellExecuteW
213213
//sys GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) = user32.GetWindowThreadProcessId
214+
//sys GetKeyboardLayout(tid uint32) (hkl Handle, err error) = user32.GetKeyboardLayout
215+
//sys ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32, err error) = user32.ToUnicodeEx
214216
//sys GetShellWindow() (shellWindow HWND) = user32.GetShellWindow
215217
//sys MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) [failretval==0] = user32.MessageBoxW
216218
//sys ExitWindowsEx(flags uint32, reason uint32) (err error) = user32.ExitWindowsEx

windows/zsyscall_windows.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)