eis

package
v0.3.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package eis is an EIS server: the receiving end of libei, which remote-desktop clients prefer over the portal's Notify* D-Bus calls. A portal's ConnectToEIS hands the app one end of a socket pair; Serve speaks the ei protocol on the other, advertises a named seat with a pointer, a keyboard and, over the regions it is given, an absolute pointer and a touchscreen, and replays what the client emulates onto a Handler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pair

func Pair(h Handler, seat string, regions []Region) (*os.File, error)

Pair makes a socket pair, serves h on one end as seat over regions and returns the other for the client.

func Serve

func Serve(conn *net.UnixConn, h Handler, seat string, regions []Region) error

Serve runs the protocol on conn until the client disconnects, advertising a seat called seat whose devices are seat-keyboard and seat-pointer, and with regions also seat-absolute and seat-touchscreen, which reach those regions. A clean disconnect is nil.

Types

type Handler

type Handler interface {
	Motion(dx, dy float64)
	Button(code uint32, pressed bool)
	// Scroll is smooth scrolling in logical pixels.
	Scroll(dx, dy float64)
	// ScrollDiscrete is wheel scrolling in 120ths of a detent.
	ScrollDiscrete(dx, dy int32)
	// ScrollStop ends the smooth scrolling on the axes set (the
	// fingers lifted); a cancel ends it the same way.
	ScrollStop(x, y bool)
	Key(code uint32, pressed bool)
	Keysym(sym uint32, pressed bool)
	// MotionAbsolute places the pointer at a point of the compositor's
	// logical layout, inside one of the regions.
	MotionAbsolute(x, y float64)
	// TouchDown, TouchMotion, TouchUp and TouchCancel drive the touch
	// point id, placed in the layout as MotionAbsolute is. A touch that
	// went down outside every region never reaches the Handler.
	TouchDown(id uint32, x, y float64)
	TouchMotion(id uint32, x, y float64)
	TouchUp(id uint32)
	TouchCancel(id uint32)
}

Handler receives the emulated input.

type Receiver

type Receiver struct {
	// contains filtered or unexported fields
}

Receiver serves a libei receiver context: the client binds a keyboard and a pointer, and the caller emulates the input it captured on them, between Start and Stop.

func NewReceiver

func NewReceiver(seat, keymapText string) (*Receiver, *os.File, error)

NewReceiver serves a receiver on one end of a socket pair, with a seat called seat whose keyboard carries the xkb keymap keymapText, and returns the other end for the client.

func (*Receiver) Button

func (r *Receiver) Button(code uint32, pressed bool) error

Button presses or releases the evdev button code.

func (*Receiver) Close

func (r *Receiver) Close() error

Close disconnects the client.

func (*Receiver) Key

func (r *Receiver) Key(code uint32, pressed bool) error

Key presses or releases the evdev key code, in a frame of its own.

func (*Receiver) Modifiers

func (r *Receiver) Modifiers(depressed, latched, locked, group uint32) error

Modifiers is the keyboard's xkb modifier state and layout group.

func (*Receiver) Motion

func (r *Receiver) Motion(dx, dy float64) error

Motion is relative pointer motion in logical pixels.

func (*Receiver) PointerFrame

func (r *Receiver) PointerFrame() error

PointerFrame ends a group of pointer events.

func (*Receiver) Scroll

func (r *Receiver) Scroll(dx, dy float64) error

Scroll is smooth scrolling in logical pixels.

func (*Receiver) ScrollDiscrete

func (r *Receiver) ScrollDiscrete(dx, dy int32) error

ScrollDiscrete is wheel scrolling in 120ths of a detent.

func (*Receiver) ScrollStop

func (r *Receiver) ScrollStop(x, y bool) error

ScrollStop ends smooth scrolling on the axes set.

func (*Receiver) SetKeymap

func (r *Receiver) SetKeymap(text string) error

SetKeymap replaces the keyboard's keymap; a bound keyboard is removed and announced again with it, and started if an emulation runs.

func (*Receiver) Start

func (r *Receiver) Start(sequence uint32) error

Start begins an emulation on every device, now and as the client binds more, numbered sequence (the portal's activation id).

func (*Receiver) Stop

func (r *Receiver) Stop() error

Stop ends the emulation Start began.

type Region

type Region struct {
	X, Y, Width, Height uint32
	Scale               float32
	MappingID           string
}

Region is an area of the compositor's logical layout the absolute devices reach: its offset and size in logical pixels, the scale of the output it shows, and the mapping id that pairs it with the screen-cast stream of the same area (empty for none).

Directories

Path Synopsis
Package eistest drives an EIS server with libei, the reference C client, loaded through purego: the oracle an EIS server, and a portal serving one, are held to in tests.
Package eistest drives an EIS server with libei, the reference C client, loaded through purego: the oracle an EIS server, and a portal serving one, are held to in tests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL