43 lines
920 B
Go
43 lines
920 B
Go
package input
|
|
|
|
import "context"
|
|
|
|
type Point struct {
|
|
X, Y int32
|
|
}
|
|
|
|
type MouseEvent struct {
|
|
Message uint32
|
|
Point Point
|
|
Data uint32
|
|
}
|
|
|
|
type KeyboardEvent struct {
|
|
Message uint32
|
|
VKCode uint32
|
|
ScanCode uint32
|
|
Flags uint32
|
|
}
|
|
|
|
type InputHandler interface {
|
|
Install(ctx context.Context, onMouse func(MouseEvent) bool, onKey func(KeyboardEvent) bool) error
|
|
Uninstall()
|
|
SetCursorPos(x, y int32) bool
|
|
ShowCursor(show bool)
|
|
GetScreenResolution() (int32, int32)
|
|
RequestFocus()
|
|
SetCursorClip(clip bool)
|
|
GetWindowPos() (int32, int32)
|
|
GetWindowSize() (int32, int32)
|
|
GetMonitorWorkArea() (x, y, w, h int32)
|
|
MoveWindow(x, y, w, h int32, topmost bool)
|
|
GetDpiScale() float64
|
|
GetForegroundWindow() uintptr
|
|
SetForegroundTo(hwnd uintptr)
|
|
GetAppHwnd() uintptr
|
|
IsMinimized(hwnd uintptr) bool
|
|
RestoreWindow(hwnd uintptr)
|
|
MinimizeWindow(hwnd uintptr)
|
|
RegisterRawScrollSink(callback func(delta int16)) error
|
|
}
|