Skip to content

Commit

Permalink
windows: add console input api
Browse files Browse the repository at this point in the history
Add Console API input handling syscall wrappers. This is an effort to
upstream the amazing coninput library by @erikgeiser
https://github.com/erikgeiser/coninput

Related golang#98
  • Loading branch information
aymanbagabas committed Jun 6, 2024
1 parent 673e0f9 commit a9a4b62
Show file tree
Hide file tree
Showing 3 changed files with 423 additions and 0 deletions.
4 changes: 4 additions & 0 deletions windows/syscall_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ func NewCallbackCDecl(fn interface{}) uintptr {
//sys WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) = kernel32.WriteConsoleW
//sys ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) = kernel32.ReadConsoleW
//sys resizePseudoConsole(pconsole Handle, size uint32) (hr error) = kernel32.ResizePseudoConsole
//sys ReadConsoleInput(console Handle, buf *InputRecord, toread uint32, read *uint32) (err error) = kernel32.ReadConsoleInputW
//sys PeekConsoleInput(console Handle, buf *InputRecord, toread uint32, read *uint32) (err error) = kernel32.PeekConsoleInputW
//sys GetNumberOfConsoleInputEvents(console Handle, numevents *uint32) (err error) = kernel32.GetNumberOfConsoleInputEvents
//sys FlushConsoleInputBuffer(console Handle) (err error) = kernel32.FlushConsoleInputBuffer
//sys CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error) [failretval==InvalidHandle] = kernel32.CreateToolhelp32Snapshot
//sys Module32First(snapshot Handle, moduleEntry *ModuleEntry32) (err error) = kernel32.Module32FirstW
//sys Module32Next(snapshot Handle, moduleEntry *ModuleEntry32) (err error) = kernel32.Module32NextW
Expand Down
Loading

0 comments on commit a9a4b62

Please sign in to comment.