svn commit: r397098 - in head/devel: . py-evdev py-evdev/files

Jan Beich jbeich at FreeBSD.org
Thu Sep 17 04:19:03 UTC 2015


Jan Beich <jbeich at FreeBSD.org> writes:

> Author: jbeich
> Date: Thu Sep 17 04:14:08 2015
> New Revision: 397098
> URL: https://svnweb.freebsd.org/changeset/ports/397098
>
> Log:
>   devel/py-evdev: add new port
>   
>   This package provides bindings to the generic input event interface in
>   Linux. The evdev interface serves the purpose of passing events
>   generated in the kernel directly to userspace through character
>   devices that are typically located in /dev/input/.
[...]
> @@ -0,0 +1,46 @@
> +# XXX Patch churn from GSoC 2014, expect v4l_compat for now
> +
> +--- evdev/genecodes.py~	2014-10-07 20:16:56 UTC
> ++++ evdev/genecodes.py
> +@@ -11,11 +11,7 @@ import os, sys, re
> + 
> + template = r'''
> + #include <Python.h>
> +-#ifdef __FreeBSD__
> +-#include <dev/evdev/input.h>
> +-#else
> + #include <linux/input.h>
> +-#endif

As ABI is same the package works with both e.g.,

  # webcamd
  $ sudo python2.7 test.py
  ('/dev/input/event0', 'Wacom Bamboo 16FG 4x5 Pen', 'usb-/dev/usb-/dev/usb/input0')
  ('/dev/input/event1', 'Wacom Bamboo 16FG 4x5 Finger', 'usb-/dev/usb-/dev/usb/input1')
  ('/dev/input/event2', 'Wacom Bamboo 16FG 4x5 Pad', 'usb-/dev/usb-/dev/usb/input1')

  # evdev(4) from gsoc2014
  $ sudo python2.7 test.py
  ('/dev/input/event0', 'System keyboard multiplexer', '')
  ('/dev/input/event1', 'Microsoft Comfort Curve Keyboard 3000, class 0/0, rev 2.00/1.70, addr 2', 'ukbd0')
  ('/dev/input/event2', 'Logitech USB Laser Mouse, class 0/0, rev 2.00/31.00, addr 3', 'ums0')

  $ cat test.py
  #! /usr/bin/env python

  from evdev import InputDevice, list_devices

  devices = [InputDevice(fn) for fn in list_devices()]
  for dev in devices:
      print(dev.fn, dev.name, dev.phys)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 602 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-ports-head/attachments/20150917/61c1eda8/attachment.bin>


More information about the svn-ports-head mailing list