avyos.dev/pkg/graphics/input/evdev
package evdev
Package Overview
No package-level documentation is provided.
| Export Group | Count |
|---|---|
| Constants | 0 |
| Variables | 0 |
| Functions | 0 |
| Types | 3 |
Types
Device
type Device struct {
// contains filtered or unexported fields
}Device represents an evdev input device.
Handler
type Handler struct {
// contains filtered or unexported fields
}Handler manages evdev input devices.
Functions
func NewHandler() *HandlerNewHandler creates a new evdev input handler.
Methods
func (h *Handler) Close() errorClose closes all devices.
func (h *Handler) Devices() []stringDevices returns information about opened devices.
func (h *Handler) Events() <-chan graphics.EventEvents returns the event channel.
func (h *Handler) MousePosition() (x, y int)MousePosition returns the current mouse position.
func (h *Handler) Open() errorOpen scans for and opens input devices.
func (h *Handler) Poll() *graphics.EventPoll returns the next event or nil if none available.
func (h *Handler) SetLayout(layout KeyboardLayout)SetLayout sets the keyboard layout.
func (h *Handler) SetScreenSize(width, height int)SetScreenSize sets the screen size for mouse bounds.
func (h *Handler) Start()Start begins reading events from all devices.
func (h *Handler) Stop()Stop stops reading events.
func (h *Handler) Wait(timeout time.Duration) *graphics.EventWait waits for the next event with a timeout.
KeyboardLayout
type KeyboardLayout stringKeyboardLayout represents a keyboard layout.
Constants
const (
LayoutUS KeyboardLayout = "us"
LayoutUK KeyboardLayout = "uk"
LayoutDE KeyboardLayout = "de"
)