Laxkit
0.0.7.1
|
Class to translate various incoming device events into Lax events. More...
Public Member Functions | |
virtual int | init () |
virtual int | selectForWindow (anXWindow *win, unsigned long) |
Set proper settings for the window to select for device events. | |
virtual int | eventFilter (EventData **events_ret, XEvent *xev, anXWindow *target, int &isinput) |
Maybe turn an XEvent into zero or more EventData objects. | |
virtual int | SetFocus (anXWindow *win, LaxKeyboard *kb, clock_t t, int notifyonly) |
Tries to get the keyboard to set the focus. | |
virtual int | clearReceiver (EventReceiver *receiver) |
This gets called when a window is removed, and all references to it must be cleared. | |
virtual int | filedescriptors (fd_set *fds, int *n) |
Set any file descriptors in fds to pass on to select() in event loop. | |
virtual EventData * | getEvents (fd_set *fds) |
For any devices that do not use X, this allows devices to parse any pending events. | |
virtual LaxDevice * | findDevice (int id) |
Return a pointer to the device with the given id, or NULL if not found. | |
virtual LaxMouse * | findMouse (int id) |
Find a LaxMouse with the id, or any mouse if id==0. | |
virtual int | NumDevices () |
virtual LaxDevice * | Device (int i) |
Public Attributes | |
PtrStack< LaxDevice > | devices |
Class to translate various incoming device events into Lax events.
If you care about events outside of core X events, you would use a DeviceManagerXinput2. Otherwise, for only core events, use a DeviceManagerXlib.
|
virtual |
This gets called when a window is removed, and all references to it must be cleared.
Removes focus reference. Also remove any tooltip consideration reference.
Return 0 for focus removed. nonzero for focus not found.
References Laxkit::PtrStack< T >::e, Laxkit::IsWindowChild(), Laxkit::PtrStack< T >::n, and Laxkit::LaxKeyboard::SetFocus().
|
virtual |
Maybe turn an XEvent into zero or more EventData objects.
This will overwrite whataver was in *events_ret, replacing it with either a new event list, or NULL.
Return 0 if event is ignored. Return 1 for XEvent absorbed, and the returned EventData objects should be used instead (if any).
References Laxkit::PtrStack< T >::e, Laxkit::LaxDevice::eventFilter(), Laxkit::PtrStack< T >::n, and Laxkit::LaxDevice::usesX().
Set any file descriptors in fds to pass on to select() in event loop.
Return the number of file descriptors set in n_ret. Return value is the maximum value of the descriptors (select() needs this).
This uses LaxDevice::fd() and FD_SET() to set on the fds set.
References Laxkit::PtrStack< T >::e, and Laxkit::PtrStack< T >::n.
Set proper settings for the window to select for device events.
Default is simply to call LaxDevice::selectForWindow() with each device.
Note that this will be called automatically by anXApp::addwindow() after anXWindow::xlib_window exists.
References Laxkit::PtrStack< T >::e, Laxkit::PtrStack< T >::n, and Laxkit::LaxDevice::selectForWindow().
|
virtual |
Tries to get the keyboard to set the focus.
If the focus cannot be set based on the given information, return 1. If successful setting of focus, return 0;
If notifyonly, then this has been called in response to an event, not as a request to grab the focus.
This will typically prompt future focus on and off events. For instance, a core Xlib keyboard will use XSetInputFocus(), which will generate Xlib FocusIn and FocusOut events.
References Laxkit::PtrStack< T >::e, Laxkit::PtrStack< T >::n, and Laxkit::LaxKeyboard::SetFocus().