Git Product home page Git Product logo

Comments (4)

SamuelBorn avatar SamuelBorn commented on June 8, 2024 2

I can recover from the issue by executing the following command: systemctl restart input-remapper.service && input-remapper-control --command autoload

For me just input-remapper-control --command autoload works too

from input-remapper.

rodrigoreyes79 avatar rodrigoreyes79 commented on June 8, 2024

Same issue here using MX Master 3s on a Lenovo Flex but it tends to happen when the laptop is left unattended for a while. Not sure if it's related to the laptop going into some "sleep" state (don´t think so as I have configured it not to but the laptop's screen still goes dark) or the mouse going to sleep.

I can recover from the issue by executing the following command: systemctl restart input-remapper.service && input-remapper-control --command autoload

from input-remapper.

dmersiowsky avatar dmersiowsky commented on June 8, 2024

Same here with the MX Master 3 connected via Bluetooth.
Service says:

input-remapper-service[17283]: ERROR: fd broke, was the device unplugged?
input-remapper-service[17283]: read loop for /dev/input/event13 stopped

Version:

input-remapper 2.0.0 9e04df79ca4dca77516a9864d740b9b2d4aef788 https://github.com/sezanzeb/input-remapper
python-evdev 1.4.0

Using Ubuntu 22.04 LTS.

from input-remapper.

christopherseaman avatar christopherseaman commented on June 8, 2024

Adding a quote of my comment on a possibly related issue as it might help with yours.

This is definitely not the Right Way (tm) to do this, but it works for my use case with a single bluetooth device being remapped and input-remapper sometimes failing on reconnect. If you have multiple devices being remapped, this will cause an interruption whenever a device disconnects. Also, it's quite hacky as I didn't spend a lot of time learning the codebase ¯\_(ツ)_/¯

I updated inputremapper/injection/event_reader.py to send stop_all and autoload commands to the daemon upon device disconnect. Here's the diff with added lines identified with +'s, surrounding lines (without "+") are provided for context:

# Added lines for inputremapper/injection/event_reader.py


# ---------------- import daemon methods ----------------
from inputremapper.input_event import InputEvent
from inputremapper.logger import logger

+# Load daemon methods to send commands upon device disconnect
+import inputremapper.daemon as ir_daemon
+

class Context(Protocol):


# ---------------- send `stop_all` and `autoload` to daemon ----------------
                loop.remove_reader(self._source.fileno())
                logger.debug("read loop stopped")
+                # Connect to daemon and send "stop_all" and "autoload" commands
+                daemon = ir_daemon.Daemon.connect()
+                await daemon.send_stop_all()
+                await daemon.send_autoload()
                return

            events_ready.clear()

Modified event_reader.py attached, had to rename to event_reader.py.txt because GH restricts attachment file types.

from input-remapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.