ei_button

Button Object

Interface for button requests and events.

This interface is only provided once per device and where a client requests ei_button.release the interface does not get re-initialized. An EIS implementation may adjust the behavior of the device (including removing the device) if the interface is releasd.

Note that for a client to receive objects of this type, it must announce support for this interface in ei_handshake.interface_version.

Enums

Info

Enum names are shown here in uppercase. The exact name depends on the language bindings.

ei_button.button_state

The logical state of a button.

Name Value Summary
RELEASED 0 the button is logically up
PRESS 1 the button is logically down

Requests

ei_button.release

Since Version1 Request Opcode0

ei_button.release()

Notification that the client is no longer interested in this object. The EIS implementation will release any resources related to this object and send the ei_button.destroyed event once complete.

ei_button.button

Since Version1 Request Opcode1

ei_button.button(button, state)
Argument Type Summary
button uint32 button code
state uint32
Note

This request is only available for clients of ei_handshake.context_type.sender.

Generate a button event on this pointer.

The button codes must match the defines in linux/input-event-codes.h.

It is a client bug to send more than one button request for the same button within the same ei_device.frame and the EIS implementation may ignore either or all button state changes and/or disconnect the client.

It is a protocol violation to send this request for a client of an ei_handshake.context_type other than sender.

Events

ei_button.destroyed

Since Version1 Event Opcode0

ei_button.destroyed(serial)
Argument Type Summary
serial uint32 this event’s serial number
Destructor

Immediately after sending this request, the object is considered destroyed by the EIS implementation. It must no longer be used by the client.

This pointer has been removed and a client should release all associated resources.

This ei_scroll object will be destroyed by the EIS implementation immmediately after after this event is sent and as such the client must not attempt to use it after that point.

ei_button.button

Since Version1 Event Opcode1

ei_button.button(button, state)
Argument Type Summary
button uint32
state uint32
Note

This event is only available for clients of ei_handshake.context_type.receiver.

See the ei_scroll.button request for details.

It is a protocol violation to send this request for a client of an ei_handshake.context_type other than receiver.

It is an EIS implementation bug to send more than one button request for the same button within the same ei_device.frame.