Skip to content

Commit

Permalink
feat: add windows
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed May 8, 2024
1 parent 1af817f commit 90c752c
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 0 deletions.
3 changes: 3 additions & 0 deletions windows/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package windows

//go generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go syscall_windows.go
5 changes: 5 additions & 0 deletions windows/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/charmbracelet/x/windows

go 1.18

require golang.org/x/sys v0.20.0
2 changes: 2 additions & 0 deletions windows/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
10 changes: 10 additions & 0 deletions windows/syscall_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package windows

import "golang.org/x/sys/windows"

var NewLazySystemDLL = windows.NewLazySystemDLL

type Handle = windows.Handle

//sys GetKeyboardLayout(threadId uint32) (hkl Handle, err error) = user32.GetKeyboardLayout
//sys ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32, err error) = user32.ToUnicodeEx
61 changes: 61 additions & 0 deletions windows/zsyscall_windows.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 90c752c

Please sign in to comment.