Age | Commit message (Collapse) | Author | Files | Lines |
|
Add a binding to get the current value of an EV_ABS value.
https://bugs.freedesktop.org/show_bug.cgi?id=102615
Signed-off-by: Benjamin Berg <bberg@redhat.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Python3 uses unicode and byte arrays need to be explicitly encoded/decoded in
Python3 to avoid the ctypes TypeError when converting between python strings
and C strings.
https://bugs.freedesktop.org/show_bug.cgi?id=97458
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
NULL-pointers are None, not 0. This only worked because we kept falling
through until some other later condition triggered and happened to return the
correct value at all times (usually because the type/code ended up as -1)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
A fairly subtle difference, but "is None" is preferred.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Allows running through the event sequence more than once without any extra
handling. In modern recordings the description and the event file is in the
same file and there is no extra fd handling for the events. So simple code to
check events would look like this:
d = evemu.Device("/path/to/file", create=False)
for e in d.events():
check_for_something()
for e in d.events():
check_for_something_else()
Simply rewinding the fd is sufficient here to avoid the caller having to keep
a copy of the events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Martin <consume.noise@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Martin <consume.noise@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Martin <consume.noise@gmail.com>
|
|
We use fileno() on the various file arguments, not read() so check for that.
And document it in the API that we need real file objects here, not just
something that's file-like.
Reported-by: Dan Callaghan
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
We do, but technically we just need the right permissions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Switch to isinstance to be more liberal in what we can accept.
Anything that looks like an int should be used as such, anything else we
assume to be a string that needs parsing. event_get_value() would do that for
us but we can't call it unconditionally - some events don't have names so they
cannot resolve.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
This was probably true at some point but it's not anymore now.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Module was dropped in 606d2135c5 after removing the need for it by using C
wrappers around libevdev instead.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Allows for:
if e.matches("EV_REL", "REL_X"):
print("Relative X events")
but it'll happily take integers as well.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
The API is forgiving to int/str where there shouldn't be any, so make sure we
test for that.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Nobody uses this file anymore, and it was never been a public python API.
We can safely kill it and remove the need to generate some files from
input.h.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Relying on an external lib removes the pain to maintain our own input.h
implementation.
The functions accept both strings and integer values in both directions of
conversion.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Relying on an external lib removes the pain to maintain our own input.h
implementation.
The functions accept both strings and integer values in both directions of
conversion.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
So we can get rid of the generated mapping tables.
Requires newest libevdev for libevdev_property_from_name()
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
ctypes.util.find_library doesn't honor LD_LIBRARY_PATH, instantiating directly
(like we do for for libevemu already) does.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Splitting the python_sources into a separate variable. No functional change,
just nicer to read than base_python_PYTHON in the CLEANFILES.
Python2 and Python3 have different behaviors for the pyc files, in Python3
they're inside a __pycache__ folder and named e.g. const.cpython-33.pyc.
We can just delete the folder itself here, not worrying about the specific
names.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Just to have things together
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Don't use a wildcard, avoids accidentally shipping files we shouldn't, and
clearly lists what we intend to ship.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
It's now unused in internal code. Leave it there to avoid breakage of older
clients, but otherwise ignore it for the future.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Using 'prop' instead of 'event_code' would be more sensible but it'd break
API, python allows named arguments.
Introduced in 385b6e3d8cd257e878cbe82e4bd0f38d8b8b1ca7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
We have make-event-names.py that generates the required mappings, there is no
need for having a hand-updated file around that provides some of these
constants.
Previously we compared the event names as well as the event values in
test_case.py. That was useful when we were using two different sources
(event_names.py and the hand-maintained const.py). Now we generate the dicts
from the same source. We have separate tests for evemu.event_get_(value|name)
so we don't need the this extra comparison against the names in test_get_abs_*
and friends anymore.
Special note on get_expected_propbits(): we previously returned a dict with
the absolute axes as keys. This is fixed here, we now return a dict with the
actual property bits as keys. Since all values were always False and both
absbits and propbits are just numbers this never got noticed before.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Needed for target systems without python support.
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
obviously, the function returns the value, not the name.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
With the goal of deprecating the evemu.const file.
This is the only class that cares about the name of the lib, so define it
here. Something fancier involving Makefiles and generation from base.py.in is
possible, but probably more trouble than it's worth.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Prep work for being able to deprecate evemu.const.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Inserting a tab in front of the top comment to have textwrap.dedent() work
correctly.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Export the new class and the two public conversion functions.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Return None if not found instead of throwing a KeyError which reveals too much
of the internal implementation anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Closest thing that python has to "private". These are generated and we reserve
the right to modify the generation in the future, so make sure they're private
by default.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
For toolchains without c++ support add option to disable
tests, because this is the only place c++ is needed (to
test the c++ binding).
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
- renamed "tests" into "enable_tests"
- used yes/no instead of true/false
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
While applying 381080815829 (python: move make-event-names to the python
directory), I made a mistake in the path. It should be read
$(srcdir)/make-event-names.py without the "/src/"
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Rather than having those hidden in a submodule, expose them as evemu
functions, with a defined behaviour and different naming for getting
values vs names.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Nothing in the C code uses it anymore
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
If you're dealing with C, use libevdev.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
- edited python/evemu/Makefile.am to remove the unused arguments
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Instead of our manual printf format, use the library. That's a bit convoluted
since evemu_write_event expects a FILE*, so we need to create a temporary file
just for the str() function.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
If we're just reading a file for info, we don't need to create a uinput
device.
This means we can now use the conversion script without being root. Oh, the
progress!
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
The conversion script now requires manually setting PYTHONPATH unless the
evemu python bits are installed systemwide, but it's not used that often
anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|