31 lines
517 B
Go
31 lines
517 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)
|
|
}
|