Copy props to the forwarded UInput (#319)

pull/329/head
Tobi 2 years ago committed by GitHub
parent 2badf2c5d3
commit 02a17d51bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -323,7 +323,8 @@ class Editor:
logger.debug("Disabling the text input")
text_input = self.get_text_input()
# beware that this also disables event listeners like focus-out-event:
# beware that this also appeared to disable event listeners like
# focus-out-event:
text_input.set_sensitive(False)
text_input.set_opacity(0.5)

@ -325,13 +325,18 @@ class Injector(multiprocessing.Process):
coroutines = []
for source in sources:
# certain capabilities can have side effects apparently. with an
# EV_ABS capability, EV_REL won't move the mouse pointer anymore.
# so don't merge all InputDevices into one UInput device.
# copy as much information as possible, because libinput uses the extra
# information to enable certain features like "Disable touchpad while
# typing"
forward_to = evdev.UInput(
name=get_udev_name(source.name, "forwarded"),
phys=DEV_NAME,
events=self._copy_capabilities(source),
phys=source.phys,
vendor=source.info.vendor,
product=source.info.product,
version=source.info.version,
bustype=source.info.bustype,
input_props=source.input_props(),
)
# actually doing things

@ -118,9 +118,9 @@ class InputEvent:
def __str__(self):
if self.type == evdev.ecodes.EV_KEY:
key_name = evdev.ecodes.bytype[self.type].get(self.code, self.code)
key_name = evdev.ecodes.bytype[self.type].get(self.code, "unknown")
action = "down" if self.value == 1 else "up"
return f"<InputEvent {key_name} {action}>"
return f"<InputEvent {key_name} ({self.code}) {action}>"
return f"<InputEvent {self.event_tuple}>"

@ -425,6 +425,9 @@ class InputDevice:
return result
def input_props(self):
return []
uinputs = {}

Loading…
Cancel
Save