Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move syn() convenience method from InputDevice to EventIO #224

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions evdev/eventio.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,14 @@ def write(self, etype, code, value):

_uinput.write(self.fd, etype, code, value)

def syn(self):
"""
Inject a ``SYN_REPORT`` event into the input subsystem. Events
queued by :func:`write()` will be fired. If possible, events
will be merged into an 'atomic' event.
"""

self.write(ecodes.EV_SYN, ecodes.SYN_REPORT, 0)

def close(self):
pass
9 changes: 0 additions & 9 deletions evdev/uinput.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,6 @@ def close(self):
_uinput.close(self.fd)
self.fd = -1

def syn(self):
"""
Inject a ``SYN_REPORT`` event into the input subsystem. Events
queued by :func:`write()` will be fired. If possible, events
will be merged into an 'atomic' event.
"""

_uinput.write(self.fd, ecodes.EV_SYN, ecodes.SYN_REPORT, 0)

def capabilities(self, verbose=False, absinfo=True):
"""See :func:`capabilities <evdev.device.InputDevice.capabilities>`."""
if self.device is None:
Expand Down