[PATCH libevdev 0/6] Add a bunch of setters and getters

Peter Hutterer peter.hutterer at who-t.net
Wed Jul 31 16:20:56 PDT 2013


On Wed, Jul 31, 2013 at 01:32:05PM +0200, Benjamin Tissoires wrote:
> On Mon, Jul 29, 2013 at 7:34 AM, Peter Hutterer
> <peter.hutterer at who-t.net> wrote:
> >
> > I'm currently working adding uinput device creation to libevdev (patches for
> > that soon), but to allow that I needed more access to the libevdev device so
> > one can set up a device from scratch.
> 
> Ok, I did review the 6 patches, but as mentioned in few of them, I'd
> rather see the deprecating patch series before, and then this one
> applied. So that we do not insert an already deprecated API.
> 
> Just to be sure: the following uinput series will allow users to:
> - create an libevdev device description
> - fill it through the setters
> - call a magical function which will create a uinput device
> - inject events to the (virtual/real) device
> If I'm wrong, then I don't get the purpose of this series.... :)
 
yes, the branch as-is is available here:
https://github.com/whot/libevdev/tree/uinput-devices
(still being rebased though)

I still want to get more use out of it before I sent out the patches, but
usage of it looks something like this:

        dev = libevev_new()
        libevdev_set_name(dev, "device");
        libevdev_enable_event_type(dev, EV_SYN);
        libevdev_enable_event_type(dev, EV_REL);
        libevdev_enable_event_code(dev, EV_REL, REL_X, NULL);
        libevdev_enable_event_code(dev, EV_REL, REL_Y, NULL);

        fd = open(UINPUT_NODE, O_RDWR);
        rc = libevdev_uinput_create_from_device(dev, fd, &uidev);

Cheers,
   Peter



More information about the Input-tools mailing list