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 ¶
- func Pair(h Handler, seat string, regions []Region) (*os.File, error)
- func Serve(conn *net.UnixConn, h Handler, seat string, regions []Region) error
- type Handler
- type Receiver
- func (r *Receiver) Button(code uint32, pressed bool) error
- func (r *Receiver) Close() error
- func (r *Receiver) Key(code uint32, pressed bool) error
- func (r *Receiver) Modifiers(depressed, latched, locked, group uint32) error
- func (r *Receiver) Motion(dx, dy float64) error
- func (r *Receiver) PointerFrame() error
- func (r *Receiver) Scroll(dx, dy float64) error
- func (r *Receiver) ScrollDiscrete(dx, dy int32) error
- func (r *Receiver) ScrollStop(x, y bool) error
- func (r *Receiver) SetKeymap(text string) error
- func (r *Receiver) Start(sequence uint32) error
- func (r *Receiver) Stop() error
- type Region
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Pair ¶
Pair makes a socket pair, serves h on one end as seat over regions and returns the other for the client.
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 ¶
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) PointerFrame ¶
PointerFrame ends a group of pointer events.
func (*Receiver) ScrollDiscrete ¶
ScrollDiscrete is wheel scrolling in 120ths of a detent.
func (*Receiver) ScrollStop ¶
ScrollStop ends smooth scrolling on the axes set.
func (*Receiver) SetKeymap ¶
SetKeymap replaces the keyboard's keymap; a bound keyboard is removed and announced again with it, and started if an emulation runs.
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. |