Hello community,

here is the log from the commit of package python-evdev for openSUSE:Factory 
checked in at 2020-01-13 22:21:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-evdev (Old)
 and      /work/SRC/openSUSE:Factory/.python-evdev.new.6675 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-evdev"

Mon Jan 13 22:21:18 2020 rev:6 rq:763808 version:1.3.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-evdev/python-evdev.changes        
2019-05-14 13:43:48.636696303 +0200
+++ /work/SRC/openSUSE:Factory/.python-evdev.new.6675/python-evdev.changes      
2020-01-13 22:21:25.534515480 +0100
@@ -1,0 +2,16 @@
+Sun Jan 12 16:55:08 UTC 2020 - Matthias Bach <[email protected]>
+
+- Update to 1.3.0
+  * Fix build on 32bit arches with 64bit time_t.
+  * Add functionality to query device properties. See
+    InputDevice.input_props and the input_props argument to Uinput.
+  * KeyEvent received an allow_unknown constructor argument, which
+    determines what will happen when an event code cannot be mapped
+    to a keycode. The default and behavior so far has been to raise
+    KeyError. If set to True, the keycode will be set to the event
+    code formatted as a hex number.
+  * Add InputDevice.set_absinfo() and InputDevice.absinfo().
+  * Instruct the asyncio event loop to stop monitoring the fd of
+    the input device when the device is closed.
+
+-------------------------------------------------------------------

Old:
----
  v1.2.0.tar.gz

New:
----
  v1.3.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-evdev.spec ++++++
--- /var/tmp/diff_new_pack.A3YoHQ/_old  2020-01-13 22:21:28.662516930 +0100
+++ /var/tmp/diff_new_pack.A3YoHQ/_new  2020-01-13 22:21:28.686516942 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-evdev
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,13 +19,14 @@
 %define modname evdev
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-evdev
-Version:        1.2.0
+Version:        1.3.0
 Release:        0
 Summary:        Python bindings to the Linux input handling subsystem
 License:        BSD-3-Clause
 Group:          Development/Languages/Python
 URL:            https://github.com/gvalkov/python-evdev
-Source:         https://github.com/gvalkov/%{name}/archive/v%{version}.tar.gz
+# Source needs to be pulled form Github as the source distribution on PyPI 
lacks the test directory
+Source:         
https://github.com/gvalkov/python-evdev/archive/v%{version}.tar.gz
 BuildRequires:  %{python_module devel}
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}

++++++ v1.2.0.tar.gz -> v1.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-evdev-1.2.0/.gitignore 
new/python-evdev-1.3.0/.gitignore
--- old/python-evdev-1.2.0/.gitignore   2019-04-07 17:40:25.000000000 +0200
+++ new/python-evdev-1.3.0/.gitignore   2020-01-12 00:41:29.000000000 +0100
@@ -13,6 +13,7 @@
 TAGS
 evdev/*.so
 evdev/ecodes.c
+evdev/iprops.c
 docs/_build
 .#*
 __pycache__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-evdev-1.2.0/docs/changelog.rst 
new/python-evdev-1.3.0/docs/changelog.rst
--- old/python-evdev-1.2.0/docs/changelog.rst   2019-04-07 17:40:25.000000000 
+0200
+++ new/python-evdev-1.3.0/docs/changelog.rst   2020-01-12 00:41:29.000000000 
+0100
@@ -1,6 +1,25 @@
 Changelog
 ---------
 
+1.3.0 (Jan 12, 2020)
+====================
+
+- Fix build on 32bit arches with 64bit time_t
+
+- Add functionality to query device properties. See ``InputDevice.input_props``
+  and the ``input_props`` argument to ``Uinput``.
+
+- ``KeyEvent`` received an ``allow_unknown`` constructor argument, which
+  determines what will happen when an event code cannot be mapped to a keycode.
+  The default and behavior so far has been to raise ``KeyError``. If set to
+  ``True``, the keycode will be set to the event code formatted as a hex 
number.
+
+- Add ``InputDevice.set_absinfo()`` and ``InputDevice.absinfo()``.
+
+- Instruct the asyncio event loop to stop monitoring the fd of the input device
+  when the device is closed.
+
+
 1.2.0 (Apr 7, 2019)
 ====================
 
@@ -134,7 +153,7 @@
 0.6.1 (Jun 04, 2016)
 ====================
 
-- Dissable tty echoing while evtest is running.
+- Disable tty echoing while evtest is running.
 - Allow evtest to listen to more than one devices.
 
 - The setup.py script now allows the location of the input header files to be
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-evdev-1.2.0/docs/conf.py 
new/python-evdev-1.3.0/docs/conf.py
--- old/python-evdev-1.2.0/docs/conf.py 2019-04-07 17:40:25.000000000 +0200
+++ new/python-evdev-1.3.0/docs/conf.py 2020-01-12 00:41:29.000000000 +0100
@@ -60,7 +60,7 @@
 # built documents.
 #
 # The full version, including alpha/beta/rc tags.
-release = '1.2.0'
+release = '1.3.0'
 
 # The short X.Y version.
 version = release
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-evdev-1.2.0/docs/tutorial.rst 
new/python-evdev-1.3.0/docs/tutorial.rst
--- old/python-evdev-1.2.0/docs/tutorial.rst    2019-04-07 17:40:25.000000000 
+0200
+++ new/python-evdev-1.3.0/docs/tutorial.rst    2020-01-12 00:41:29.000000000 
+0100
@@ -363,7 +363,7 @@
 
 .. _`async/await`:  https://docs.python.org/3/library/asyncio-task.html
 
-Create ``uinput`` device capable of recieving FF-effects
+Create ``uinput`` device capable of receiving FF-effects
 ========================================================
 
 ::
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-evdev-1.2.0/evdev/device.py 
new/python-evdev-1.3.0/evdev/device.py
--- old/python-evdev-1.2.0/evdev/device.py      2019-04-07 17:40:25.000000000 
+0200
+++ new/python-evdev-1.3.0/evdev/device.py      2020-01-12 00:41:29.000000000 
+0100
@@ -223,6 +223,27 @@
         else:
             return self._capabilities(absinfo)
 
+    def input_props(self, verbose=False):
+        '''
+        Get device properties and quirks.
+
+        Example
+        -------
+        >>> device.input_props()
+        [0, 5]
+
+        If ``verbose`` is ``True``, input properties are resolved to their
+        names. Unknown codes are resolved to ``'?'``::
+
+        [('INPUT_PROP_POINTER', 0), ('INPUT_PROP_POINTING_STICK', 5)]
+
+        '''
+        props = _input.ioctl_EVIOCGPROP(self.fd)
+        if verbose:
+            return util.resolve_ecodes(ecodes.INPUT_PROP, props)
+
+        return props
+
     def leds(self, verbose=False):
         '''
         Return currently set LED keys.
@@ -280,6 +301,7 @@
     def close(self):
         if self.fd > -1:
             try:
+                super().close()
                 os.close(self.fd)
             finally:
                 self.fd = -1
@@ -377,3 +399,46 @@
         msg = 'Please use {0}.path instead of 
{0}.fn'.format(self.__class__.__name__)
         warnings.warn(msg, DeprecationWarning, stacklevel=2)
         return self.path
+
+    def absinfo(self, axis_num):
+        '''
+        Return current :class:`AbsInfo` for input device axis
+
+        Arguments
+        ---------
+        axis_num : int
+          EV_ABS keycode (example :attr:`ecodes.ABS_X`)
+
+        Example
+        -------
+        >>> device.absinfo(ecodes.ABS_X)
+        AbsInfo(value=1501, min=-32768, max=32767, fuzz=0, flat=128, 
resolution=0)
+        '''
+        return AbsInfo(*_input.ioctl_EVIOCGABS(self.fd, axis_num))
+
+    def set_absinfo(self, axis_num, value=None, min=None, max=None, fuzz=None, 
flat=None, resolution=None):
+        '''
+        Update :class:`AbsInfo` values. Only specified values will be 
overwritten.
+
+        Arguments
+        ---------
+        axis_num : int
+          EV_ABS keycode (example :attr:`ecodes.ABS_X`)
+
+        Example
+        -------
+        >>> device.set_absinfo(ecodes.ABS_X, min=-2000, max=2000)
+
+        You can also unpack AbsInfo tuple that will overwrite all values
+
+        >>> device.set_absinfo(ecodes.ABS_Y, *AbsInfo(0, -2000, 2000, 0, 15, 
0))
+        '''
+
+        cur_absinfo = self.absinfo(axis_num)
+        new_absinfo = AbsInfo(value if value else cur_absinfo.value,
+                              min if min else cur_absinfo.min,
+                              max if max else cur_absinfo.max,
+                              fuzz if fuzz else cur_absinfo.fuzz,
+                              flat if flat else cur_absinfo.flat,
+                              resolution if resolution else 
cur_absinfo.resolution)
+        _input.ioctl_EVIOCSABS(self.fd, axis_num, new_absinfo)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-evdev-1.2.0/evdev/ecodes.py 
new/python-evdev-1.3.0/evdev/ecodes.py
--- old/python-evdev-1.2.0/evdev/ecodes.py      2019-04-07 17:40:25.000000000 
+0200
+++ new/python-evdev-1.3.0/evdev/ecodes.py      2020-01-12 00:41:29.000000000 
+0100
@@ -7,7 +7,7 @@
 Exposed constants::
 
     KEY, ABS, REL, SW, MSC, LED, BTN, REP, SND, ID, EV,
-    BUS, SYN, FF, FF_STATUS
+    BUS, SYN, FF, FF_STATUS, INPUT_PROP
 
 This module also provides reverse and forward mappings of the names and values
 of the above mentioned constants::
@@ -47,7 +47,7 @@
 #: Mapping of names to values.
 ecodes = {}
 
-prefixes = 'KEY ABS REL SW MSC LED BTN REP SND ID EV BUS SYN FF_STATUS FF'
+prefixes = 'KEY ABS REL SW MSC LED BTN REP SND ID EV BUS SYN FF_STATUS FF 
INPUT_PROP'
 prev_prefix = ''
 g = globals()
 
@@ -94,7 +94,8 @@
     _ecodes.EV_SND: SND,
     _ecodes.EV_SYN: SYN,
     _ecodes.EV_FF:  FF,
-    _ecodes.EV_FF_STATUS: FF_STATUS, }
+    _ecodes.EV_FF_STATUS: FF_STATUS,
+}
 
 from evdev._ecodes import *
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-evdev-1.2.0/evdev/eventio.py 
new/python-evdev-1.3.0/evdev/eventio.py
--- old/python-evdev-1.2.0/evdev/eventio.py     2019-04-07 17:40:25.000000000 
+0200
+++ new/python-evdev-1.3.0/evdev/eventio.py     2020-01-12 00:41:29.000000000 
+0100
@@ -134,3 +134,6 @@
         '''
 
         _uinput.write(self.fd, etype, code, value)
+
+    def close(self):
+        pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-evdev-1.2.0/evdev/eventio_async.py 
new/python-evdev-1.3.0/evdev/eventio_async.py
--- old/python-evdev-1.2.0/evdev/eventio_async.py       2019-04-07 
17:40:25.000000000 +0200
+++ new/python-evdev-1.3.0/evdev/eventio_async.py       2020-01-12 
00:41:29.000000000 +0100
@@ -50,6 +50,10 @@
         '''
         return ReadIterator(self)
 
+    def close(self):
+        loop = asyncio.get_event_loop()
+        loop.remove_reader(self.fileno())
+
 
 class ReadIterator(object):
     def __init__(self, device):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-evdev-1.2.0/evdev/events.py 
new/python-evdev-1.3.0/evdev/events.py
--- old/python-evdev-1.2.0/evdev/events.py      2019-04-07 17:40:25.000000000 
+0200
+++ new/python-evdev-1.3.0/evdev/events.py      2020-01-12 00:41:29.000000000 
+0100
@@ -86,7 +86,15 @@
 
     __slots__ = 'scancode', 'keycode', 'keystate', 'event'
 
-    def __init__(self, event):
+    def __init__(self, event, allow_unknown=False):
+        '''
+        The ``allow_unknown`` argument determines what to do in the event of a 
event code
+        for which a key code cannot be found. If ``False`` a ``KeyError`` will 
be raised.
+        If ``True`` the keycode will be set to the hex value of the event code.
+        '''
+
+        self.scancode = event.code
+
         if event.value == 0:
             self.keystate = KeyEvent.key_up
         elif event.value == 2:
@@ -94,8 +102,13 @@
         elif event.value == 1:
             self.keystate = KeyEvent.key_down
 
-        self.keycode  = keys[event.code]  # :todo:
-        self.scancode = event.code
+        try:
+            self.keycode = keys[event.code]
+        except KeyError:
+            if allow_unknown:
+                self.keycode = '0x{:02X}'.format(event.code)
+            else:
+                raise
 
         #: Reference to an :class:`InputEvent` instance.
         self.event = event
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-evdev-1.2.0/evdev/evtest.py 
new/python-evdev-1.3.0/evdev/evtest.py
--- old/python-evdev-1.2.0/evdev/evtest.py      2019-04-07 17:40:25.000000000 
+0200
+++ new/python-evdev-1.3.0/evdev/evtest.py      2020-01-12 00:41:29.000000000 
+0100
@@ -121,6 +121,7 @@
 
 def print_capabilities(device):
     capabilities = device.capabilities(verbose=True)
+    input_props = device.input_props(verbose=True)
 
     print('Device name: {.name}'.format(device))
     print('Device info: {.info}'.format(device))
@@ -133,6 +134,12 @@
     active_keys = ','.join(k[0] for k in device.active_keys(True))
     print('Active keys: %s\n' % active_keys)
 
+    if input_props:
+        print('Input properties:')
+        for type, code in input_props:
+            print('  %s %s' % (type, code))
+        print()
+
     print('Device capabilities:')
     for type, codes in capabilities.items():
         print('  Type {} {}:'.format(*type))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-evdev-1.2.0/evdev/genecodes.py 
new/python-evdev-1.3.0/evdev/genecodes.py
--- old/python-evdev-1.2.0/evdev/genecodes.py   2019-04-07 17:40:25.000000000 
+0200
+++ new/python-evdev-1.3.0/evdev/genecodes.py   2020-01-12 00:41:29.000000000 
+0100
@@ -20,7 +20,7 @@
 
 
 #-----------------------------------------------------------------------------
-macro_regex = r'#define 
+((?:KEY|ABS|REL|SW|MSC|LED|BTN|REP|SND|ID|EV|BUS|SYN|FF|UI_FF)_\w+)'
+macro_regex = r'#define 
+((?:KEY|ABS|REL|SW|MSC|LED|BTN|REP|SND|ID|EV|BUS|SYN|FF|UI_FF|INPUT_PROP)_\w+)'
 macro_regex = re.compile(macro_regex)
 
 uname = list(os.uname()); del uname[1]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-evdev-1.2.0/evdev/input.c 
new/python-evdev-1.3.0/evdev/input.c
--- old/python-evdev-1.2.0/evdev/input.c        2019-04-07 17:40:25.000000000 
+0200
+++ new/python-evdev-1.3.0/evdev/input.c        2020-01-12 00:41:29.000000000 
+0100
@@ -24,6 +24,11 @@
 #include <linux/input.h>
 #endif
 
+#ifndef input_event_sec
+#define input_event_sec time.tv_sec
+#define input_event_usec time.tv_usec
+#endif
+
 #define MAX_NAME_SIZE 256
 
 extern char*  EV_NAME[EV_CNT];
@@ -60,8 +65,8 @@
         return NULL;
     }
 
-    PyObject* sec  = PyLong_FromLong(event.time.tv_sec);
-    PyObject* usec = PyLong_FromLong(event.time.tv_usec);
+    PyObject* sec  = PyLong_FromLong(event.input_event_sec);
+    PyObject* usec = PyLong_FromLong(event.input_event_usec);
     PyObject* val  = PyLong_FromLong(event.value);
     PyObject* py_input_event = NULL;
 
@@ -102,8 +107,8 @@
 
     // Construct a list of event tuples, which we'll make sense of in Python
     for (unsigned i = 0 ; i < nread/event_size ; i++) {
-        sec  = PyLong_FromLong(event[i].time.tv_sec);
-        usec = PyLong_FromLong(event[i].time.tv_usec);
+        sec  = PyLong_FromLong(event[i].input_event_sec);
+        usec = PyLong_FromLong(event[i].input_event_usec);
         val  = PyLong_FromLong(event[i].value);
 
         py_input_event = Py_BuildValue("OOhhO", sec, usec, event[i].type, 
event[i].code, val);
@@ -243,6 +248,63 @@
 
 
 static PyObject *
+ioctl_EVIOCGABS(PyObject *self, PyObject *args)
+{
+    int fd, ev_code;
+    struct input_absinfo absinfo;
+    PyObject* py_absinfo = NULL;
+
+    int ret = PyArg_ParseTuple(args, "ii", &fd, &ev_code);
+    if (!ret) return NULL;
+
+    memset(&absinfo, 0, sizeof(absinfo));
+    ret = ioctl(fd, EVIOCGABS(ev_code), &absinfo);
+    if (ret == -1) {
+        PyErr_SetFromErrno(PyExc_IOError);
+        return NULL;
+    }
+
+    py_absinfo = Py_BuildValue("(iiiiii)",
+                               absinfo.value,
+                               absinfo.minimum,
+                               absinfo.maximum,
+                               absinfo.fuzz,
+                               absinfo.flat,
+                               absinfo.resolution);
+    return py_absinfo;
+}
+
+
+static PyObject *
+ioctl_EVIOCSABS(PyObject *self, PyObject *args)
+{
+    int fd, ev_code;
+    struct input_absinfo absinfo;
+
+    int ret = PyArg_ParseTuple(args,
+                               "ii(iiiiii)",
+                               &fd,
+                               &ev_code,
+                               &absinfo.value,
+                               &absinfo.minimum,
+                               &absinfo.maximum,
+                               &absinfo.fuzz,
+                               &absinfo.flat,
+                               &absinfo.resolution);
+    if (!ret) return NULL;
+
+    ret = ioctl(fd, EVIOCSABS(ev_code), &absinfo);
+    if (ret == -1) {
+        PyErr_SetFromErrno(PyExc_IOError);
+        return NULL;
+    }
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+static PyObject *
 ioctl_EVIOCGREP(PyObject *self, PyObject *args)
 {
     int fd, ret;
@@ -449,16 +511,46 @@
     return Py_None;
 }
 
+static PyObject *
+ioctl_EVIOCGPROP(PyObject *self, PyObject *args)
+{
+    int fd, ret;
+
+    ret = PyArg_ParseTuple(args, "i", &fd);
+    if (!ret) return NULL;
+
+    char bytes[(INPUT_PROP_MAX+7)/8];
+    memset(bytes, 0, sizeof bytes);
+
+    ret = ioctl(fd, EVIOCGPROP(sizeof(bytes)), &bytes);
+
+    if (ret == -1)
+        return NULL;
+
+    PyObject* res = PyList_New(0);
+    for (int i=0; i<INPUT_PROP_MAX; i++) {
+        if (test_bit(bytes, i)) {
+            PyList_Append(res, Py_BuildValue("i", i));
+        }
+    }
+
+    return res;
+}
+
+
 
 static PyMethodDef MethodTable[] = {
     { "ioctl_devinfo",        ioctl_devinfo,        METH_VARARGS, "fetch input 
device info" },
     { "ioctl_capabilities",   ioctl_capabilities,   METH_VARARGS, "fetch input 
device capabilities" },
+    { "ioctl_EVIOCGABS",      ioctl_EVIOCGABS,      METH_VARARGS, "get input 
device absinfo"},
+    { "ioctl_EVIOCSABS",      ioctl_EVIOCSABS,      METH_VARARGS, "set input 
device absinfo"},
     { "ioctl_EVIOCGREP",      ioctl_EVIOCGREP,      METH_VARARGS},
     { "ioctl_EVIOCSREP",      ioctl_EVIOCSREP,      METH_VARARGS},
     { "ioctl_EVIOCGVERSION",  ioctl_EVIOCGVERSION,  METH_VARARGS},
     { "ioctl_EVIOCGRAB",      ioctl_EVIOCGRAB,      METH_VARARGS},
     { "ioctl_EVIOCGEFFECTS",  ioctl_EVIOCGEFFECTS,  METH_VARARGS, "fetch the 
number of effects the device can keep in its memory." },
     { "ioctl_EVIOCG_bits",    ioctl_EVIOCG_bits,    METH_VARARGS, "get state 
of KEY|LED|SND|SW"},
+    { "ioctl_EVIOCGPROP",     ioctl_EVIOCGPROP,     METH_VARARGS, "get device 
properties"},
     { "device_read",          device_read,          METH_VARARGS, "read an 
input event from a device" },
     { "device_read_many",     device_read_many,     METH_VARARGS, "read all 
available input events from a device" },
     { "upload_effect",        upload_effect,        METH_VARARGS, "" },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-evdev-1.2.0/evdev/uinput.c 
new/python-evdev-1.3.0/evdev/uinput.c
--- old/python-evdev-1.2.0/evdev/uinput.c       2019-04-07 17:40:25.000000000 
+0200
+++ new/python-evdev-1.3.0/evdev/uinput.c       2020-01-12 00:41:29.000000000 
+0100
@@ -16,6 +16,10 @@
 #include <linux/uinput.h>
 #endif
 
+#ifndef input_event_sec
+#define input_event_sec time.tv_sec
+#define input_event_usec time.tv_usec
+#endif
 
 // Workaround for installing on kernels newer than 4.4.
 #ifndef FF_MAX_EFFECTS
@@ -73,6 +77,26 @@
         return NULL;
 }
 
+static PyObject *
+uinput_set_prop(PyObject *self, PyObject *args)
+{
+    int fd;
+    uint16_t prop;
+
+    int ret = PyArg_ParseTuple(args, "ih", &fd, &prop);
+    if (!ret) return NULL;
+
+    if (ioctl(fd, UI_SET_PROPBIT, prop) < 0)
+        goto on_err;
+
+    Py_RETURN_NONE;
+
+    on_err:
+        _uinput_close(fd);
+        PyErr_SetFromErrno(PyExc_IOError);
+        return NULL;
+}
+
 
 // Different kernel versions have different device setup methods. You can read
 // more about it here:
@@ -232,8 +256,11 @@
     if (!ret) return NULL;
 
     struct input_event event;
+    struct timeval tval;
     memset(&event, 0, sizeof(event));
-    gettimeofday(&event.time, 0);
+    gettimeofday(&tval, 0);
+    event.input_event_usec = tval.tv_usec;
+    event.input_event_sec = tval.tv_sec;
     event.type = type;
     event.code = code;
     event.value = value;
@@ -332,6 +359,9 @@
     { "set_phys", uinput_set_phys, METH_VARARGS,
       "Set physical path"},
 
+    { "set_prop", uinput_set_prop, METH_VARARGS,
+      "Set device input property"},
+
     { NULL, NULL, 0, NULL}
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-evdev-1.2.0/evdev/uinput.py 
new/python-evdev-1.3.0/evdev/uinput.py
--- old/python-evdev-1.2.0/evdev/uinput.py      2019-04-07 17:40:25.000000000 
+0200
+++ new/python-evdev-1.3.0/evdev/uinput.py      2020-01-12 00:41:29.000000000 
+0100
@@ -77,7 +77,7 @@
                  events=None,
                  name='py-evdev-uinput',
                  vendor=0x1, product=0x1, version=0x1, bustype=0x3,
-                 devnode='/dev/uinput', phys='py-evdev-uinput'):
+                 devnode='/dev/uinput', phys='py-evdev-uinput', 
input_props=None):
         '''
         Arguments
         ---------
@@ -96,13 +96,16 @@
           Product identifier.
 
         version
-          version identifier.
+          Version identifier.
 
         bustype
-          bustype identifier.
+          Bustype identifier.
 
         phys
-          physical path.
+          Physical path.
+
+        input_props
+          Input properties and quirks.
 
         Note
         ----
@@ -132,6 +135,11 @@
         # Set phys name
         _uinput.set_phys(self.fd, phys)
 
+        # Set properties
+        input_props = input_props or []
+        for prop in input_props:
+            _uinput.set_prop(self.fd, prop)
+
         for etype, code in prepared_events:
             _uinput.enable(self.fd, etype, code)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-evdev-1.2.0/setup.cfg 
new/python-evdev-1.3.0/setup.cfg
--- old/python-evdev-1.2.0/setup.cfg    2019-04-07 17:40:25.000000000 +0200
+++ new/python-evdev-1.3.0/setup.cfg    2020-01-12 00:41:29.000000000 +0100
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 1.2.0
+current_version = 1.3.0
 message = Bump version: {current_version} -> {new_version}
 commit = True
 tag = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-evdev-1.2.0/setup.py 
new/python-evdev-1.3.0/setup.py
--- old/python-evdev-1.2.0/setup.py     2019-04-07 17:40:25.000000000 +0200
+++ new/python-evdev-1.3.0/setup.py     2020-01-12 00:41:29.000000000 +0100
@@ -44,7 +44,7 @@
 #-----------------------------------------------------------------------------
 kw = {
     'name':                 'evdev',
-    'version':              '1.2.0',
+    'version':              '1.3.0',
 
     'description':          'Bindings to the Linux input handling subsystem',
     'long_description':     open(pjoin(here, 'README.rst')).read(),


Reply via email to