Preferred way to create & insert input events?
Peter Hutterer
peter.hutterer at who-t.net
Sun Mar 1 22:34:39 PST 2009
On Fri, Feb 27, 2009 at 04:33:36PM -0700, Chris Riddoch wrote:
> I'm working on some accessibility software that will enter events into
> X, and have had some difficulty finding the appropriate APIs to use to
> do so. I've looked at some existing software (cellwriter, easystroke,
> xvkbd, etc.) and it seems like this is a relatively tricky thing to
> do.
XTestFakeInput or create a device through uinput.
> I've learned quite a bit about the uinput kernel module, but I haven't
> figured out how to determine how it's been mapped to another key
> before it gets to the application, or how to get at the mapping from
> scancodes to keycodes, or even whether that's where I should be trying
> to hook in, in the first place. I have an old copy of O'Reilly's Xlib
> programming manual, volume 1, from 1995, but I'm sure things have
> moved on since then and there's a preferred way to generate input
> events in software in modern X.
scancode -> keysym is mostly done in xkb. if you're using uinput, just make
sure you post the right keycodes as defined in linux/input.h through the
device.
Same with XTestFakeInput keycodes, as long as you have the evdev ruleset
(xkeyboard-config 1.4 and later)
Cheers,
Peter
More information about the xorg
mailing list