Xtst::RecordExtension
Inherits Reference < Object
Constructors
Connects to the display and raises if Record Extension Library was not found on the system.
Instance methods
Returns a new context.
A range can be created with create_range.
Example usage:
range = record.create_range
range.device_events.first = X11::KeyPress
range.device_events.last = X11::ButtonRelease
context = record.create_context(record_range)
The underlying Display object. Docs recommend using two separate connections for control and data.
The underlying Display object. Docs recommend using two separate connections for control and data.
Start listening for the events configured in context.range.
This method does not block. The block does not get run on its own,
you need to additionally repeatedly call process_replies.
For the structure of record_data.data, please refer to xEvent (NOT XEvent)
at _xEvent in Xproto.h. There are no docs available for this, only
other reference implementations.
Example usage:
record.enable_context_async(context) do |record_data|
next if record_data.category != Xtst::LibXtst::RecordInterceptDataCategory::FromServer.value
xevent = record_data.data
repeat = xevent[2] == 1
next if repeat
type = xevent[0]
keycode = xevent[1]
state = xevent[28]
pp! type, keycode, state
end
fd = IO::FileDescriptor.new record.data_display.connection_number
loop do
dpy_fd.wait_readable
record.process_replies
end