Skip to content

Commit 728fe38

Browse files
committed
windows: add LoadKeyboardLayout and UnloadKeyboardLayout
1 parent d4d009a commit 728fe38

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

windows/syscall_windows.go

+2
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ func NewCallbackCDecl(fn interface{}) uintptr {
213213
//sys OpenProcess(desiredAccess uint32, inheritHandle bool, processId uint32) (handle Handle, err error)
214214
//sys ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *uint16, showCmd int32) (err error) [failretval<=32] = shell32.ShellExecuteW
215215
//sys GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) = user32.GetWindowThreadProcessId
216+
//sys LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle) = user32.LoadKeyboardLayoutW
217+
//sys UnloadKeyboardLayout(hkl Handle) (v bool) = user32.UnloadKeyboardLayout
216218
//sys GetKeyboardLayout(tid uint32) (hkl Handle) = user32.GetKeyboardLayout
217219
//sys toUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32) = user32.ToUnicodeEx
218220
//sys GetShellWindow() (shellWindow HWND) = user32.GetShellWindow

windows/types_windows.go

+11
Original file line numberDiff line numberDiff line change
@@ -3404,3 +3404,14 @@ type DCB struct {
34043404
EvtChar byte
34053405
wReserved1 uint16
34063406
}
3407+
3408+
// Keyboard Layout Flags.
3409+
// See https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadkeyboardlayoutw
3410+
const (
3411+
KLF_ACTIVATE = 0x00000001
3412+
KLF_SUBSTITUTE_OK = 0x00000002
3413+
KLF_REORDER = 0x00000008
3414+
KLF_REPLACELANG = 0x00000010
3415+
KLF_NOTELLSHELL = 0x00000080
3416+
KLF_SETFORPROCESS = 0x00000100
3417+
)

windows/zsyscall_windows.go

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)