python3-evdev: update to 1.6.0.

This commit is contained in:
Đoàn Trần Công Danh 2022-09-22 21:47:35 +07:00
parent 22e365e10f
commit f9f56f02d3
2 changed files with 3 additions and 48 deletions

View file

@ -1,45 +0,0 @@
--- a/evdev/input.c 2019-04-07 17:40:25.000000000 +0200
+++ b/evdev/input.c 2020-12-14 14:48:49.568344738 +0100
@@ -60,8 +60,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 +102,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);
--- a/evdev/uinput.c 2019-04-07 17:40:25.000000000 +0200
+++ b/evdev/uinput.c 2020-12-14 14:51:58.809761744 +0100
@@ -226,6 +226,7 @@
static PyObject *
uinput_write(PyObject *self, PyObject *args)
{
+ struct timeval tv;
int fd, type, code, value;
int ret = PyArg_ParseTuple(args, "iiii", &fd, &type, &code, &value);
@@ -233,7 +234,9 @@
struct input_event event;
memset(&event, 0, sizeof(event));
- gettimeofday(&event.time, 0);
+ gettimeofday(&tv, 0);
+ event.input_event_sec = tv.tv_sec;
+ event.input_event_usec = tv.tv_usec;
event.type = type;
event.code = code;
event.value = value;

View file

@ -1,7 +1,7 @@
# Template file for 'python3-evdev' # Template file for 'python3-evdev'
pkgname=python3-evdev pkgname=python3-evdev
version=1.2.0 version=1.6.0
revision=5 revision=1
wrksrc="python-evdev-$version" wrksrc="python-evdev-$version"
build_style=python3-module build_style=python3-module
hostmakedepends="python3-setuptools" hostmakedepends="python3-setuptools"
@ -11,7 +11,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
license="BSD-3-Clause" license="BSD-3-Clause"
homepage="https://github.com/gvalkov/python-evdev" homepage="https://github.com/gvalkov/python-evdev"
distfiles="https://github.com/gvalkov/python-evdev/archive/v${version}.tar.gz" distfiles="https://github.com/gvalkov/python-evdev/archive/v${version}.tar.gz"
checksum=f788584510620251c6a6c68802935b71c4b474df99b87ee223e18b84dd1719a6 checksum=85877121b46e0eacf390c1ee4a07e6f5fcb3c603c1649efcccdd554f2fe0c3ab
post_install() { post_install() {
vlicense LICENSE vlicense LICENSE