avyos.dev/pkg/graphics/input/evdev
package evdev
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
NewHandler
func NewHandler() *HandlerNewHandler creates a new evdev input handler.
Methods
Close
func (h *Handler) Close() errorClose closes all devices.
Devices
func (h *Handler) Devices() []stringDevices returns information about opened devices.
Events
func (h *Handler) Events() <-chan gfxinput.EventEvents returns the event channel.
MousePosition
func (h *Handler) MousePosition() (x, y int)MousePosition returns the current mouse position.
Open
func (h *Handler) Open() errorOpen scans for and opens input devices.
Poll
func (h *Handler) Poll() *gfxinput.EventPoll returns the next event or nil if none available.
SetLayout
func (h *Handler) SetLayout(layout KeyboardLayout)SetLayout sets the keyboard layout.
SetScreenSize
func (h *Handler) SetScreenSize(width, height int)SetScreenSize sets the screen size for mouse bounds.
Start
func (h *Handler) Start()Start begins reading events from all devices.
Stop
func (h *Handler) Stop()Stop stops reading events.
Wait
func (h *Handler) Wait(timeout time.Duration) *gfxinput.EventWait waits for the next event with a timeout.
KeyboardLayout
type KeyboardLayout stringKeyboardLayout represents a keyboard layout.
Constants
LayoutUS, LayoutUK, LayoutDE
const (
LayoutUS KeyboardLayout = "us"
LayoutUK KeyboardLayout = "uk"
LayoutDE KeyboardLayout = "de"
)