sezanzeb / input-remapper

🎮 ⌨ An easy to use tool to change the behaviour of your input devices.
GNU General Public License v3.0
3.65k stars 153 forks source link

Automatically loading for bluetooth devices #25

Closed sojusnik closed 3 years ago

sojusnik commented 3 years ago

I've mapped some keys in your app, named, saved and applied the settings with autoload enabled, but after restarting Ubuntu the mapped keys stop working. key-mapper-autoload is enabled in the autostart settings of Ubuntu.

How to debug this?

I'm using v0.6.0 installed with .deb on Ubuntu 20.10 with Xorg.

sezanzeb commented 3 years ago

please show me the output of cat ~/.config/key-mapper/config.json

and after running key-mapper-control --command autoload your preset should be active, does that work?

if not, show me the output of journalctl -u key-mapper.service | tail -n 50

sojusnik commented 3 years ago
~$ cat ~/.config/key-mapper/config.json
{
    "autoload": {
        "M585/M590 Mouse": "tweaked",
        "Keyboard K380 Keyboard": "tweaked"
    },
    "macros": {
        "keystroke_sleep_ms": 10
    },
    "gamepad": {
        "joystick": {
            "non_linearity": 4,
            "pointer_speed": 80,
            "left_purpose": "mouse",
            "right_purpose": "wheel",
            "x_scroll_speed": 2,
            "y_scroll_speed": 0.5
        }
    }
}

After running key-mapper-control --command autoload in the terminal, they start to work again.

sezanzeb commented 3 years ago

ok thanks.

lets look at the logs for the previous reboot:

journalctl -u key-mapper.service | grep Reboot -A20 | tail -n 21

It's probably because the desktop file is broken for your environment though. Are you running Gnome?

sojusnik commented 3 years ago

Yes, I'm running Gnome 3.38.1.

$ journalctl -u key-mapper.service | grep Reboot -A20 | tail -n 21
-- Reboot --
Jän 18 11:03:07 mir systemd[1]: Starting Service to inject keycodes without the GUI application...
Jän 18 11:03:07 mir key-mapper-service[854]: Loaded config from "/home/root/.config/key-mapper/config.json"
Jän 18 11:03:07 mir key-mapper-service[1097]: xmodmap:  unable to open display ''
Jän 18 11:03:07 mir key-mapper-service[854]: This output is also stored in "~/.log/key-mapper"
Jän 18 11:03:07 mir key-mapper-service[854]: Logging to "/root/.log/key-mapper/log"
Jän 18 11:03:07 mir key-mapper-service[854]: key-mapper 0.6.0
Jän 18 11:03:07 mir key-mapper-service[854]: python-evdev 1.3.0
Jän 18 11:03:07 mir systemd[1]: Started Service to inject keycodes without the GUI application.
Jän 18 11:03:23 mir key-mapper-service[854]: Stopping all injections
Jän 18 11:03:23 mir key-mapper-service[854]: Loaded config from "/home/sojusnik/.config/key-mapper/config.json"
Jän 18 11:03:23 mir key-mapper-service[854]: Found "  RPI Wired Keyboard 5", "Video Bus"
Jän 18 11:03:23 mir key-mapper-service[854]: Found "  RPI Wired Keyboard 5", "Video Bus"
Jän 18 11:03:23 mir key-mapper-service[854]: Loading preset from "/home/sojusnik/.config/key-mapper/presets/M585/M590 Mouse/tweaked.json"
Jän 18 11:03:23 mir key-mapper-service[854]: ERROR: Cannot inject for unknown device "M585/M590 Mouse"
Jän 18 11:03:23 mir key-mapper-service[854]: Loaded config from "/home/sojusnik/.config/key-mapper/config.json"
Jän 18 11:03:24 mir key-mapper-service[854]: Found "  RPI Wired Keyboard 5", "Video Bus"
Jän 18 11:03:24 mir key-mapper-service[854]: Loading preset from "/home/sojusnik/.config/key-mapper/presets/Keyboard K380 Keyboard/tweaked.json"
Jän 18 11:03:24 mir key-mapper-service[854]: ERROR: Cannot inject for unknown device "Keyboard K380 Keyboard"
Jän 18 11:23:02 mir key-mapper-service[854]: Stopping all injections
Jän 18 11:23:02 mir key-mapper-service[54098]: xset:  unable to open display ""
sezanzeb commented 3 years ago
Jän 18 11:03:23 mir key-mapper-service[854]: ERROR: Cannot inject for unknown device "M585/M590 Mouse"
Jän 18 11:03:24 mir key-mapper-service[854]: ERROR: Cannot inject for unknown device "Keyboard K380 Keyboard"

are those plugged in during ~boot~ login?

sojusnik commented 3 years ago

No, those are Bluetooth devices, that are usually connected when Ubuntu has booted completely.

sezanzeb commented 3 years ago

*login

so are you able to enter your password and such with the bluetooth keyboard? or are they connected after entering your desktop environment? I don't have bluetooth devices so I can't try.

sojusnik commented 3 years ago

No, I'm entering my password with a wired keyboard and only upon booting has finished completely I start to use my Bluetooth mouse and keyboard, so I connect them after the login.

sezanzeb commented 3 years ago

ok thanks. I'll see what I can do about that.

Triggering the preset when devices connect would be the clean solution, but I'd like to avoid that since unplugging is currently the last resort if a preset is so screwed up that the computer cannot be used anymore with that device. Unplugging and plugging back in makes the mapping stop.

Maybe it should do it when the device connects for the first time, but won't autoload when it connects for a second time. The service could keep track of that and the (future) udev rule could ask the service to only autoload when the device is new.

It will take some time until I'll be able to release that since I need to work on something different first. But I'll most likely solve it that way.

sezanzeb commented 3 years ago

https://github.com/sezanzeb/key-mapper/tree/udev

Please try to install from this branch and give me feedback if it works now. It's not thoroughly tested though ~and the changes don't have unittests yet~. If you need help, please let me know. After cloning just do git checkout udev

Make sure to restart the service after the installation sudo systemctl restart key-mapper

Afterwards, set your bluetooth preset to autoload and test if it starts injecting after logging in.

Thanks.

Repeatedly unplugging and plugging in won't autoload again. Only when the device is connected for the first time, as explained in my previous comment.

sezanzeb commented 3 years ago

Unittests are pushed, waiting for your feedback now before releasing

sojusnik commented 3 years ago

Can you give me please a step-by-step instruction how to install from the "bluetooth" branch on Ubuntu 20.10.

sezanzeb commented 3 years ago

the branch is udev

open a terminal and paste the following line by line:

sudo apt install git python3-setuptools
git clone https://github.com/sezanzeb/key-mapper.git
git checkout udev
cd key-mapper && ./scripts/build.sh
sudo dpkg -i ./dist/key-mapper-0.6.1.deb; sudo apt -f install
sudo systemctl restart key-mapper
sojusnik commented 3 years ago

Do I have to uninstall my .deb installation before?

sezanzeb commented 3 years ago

no, ubuntu will know that it is an update for the previous version

actually, I could also just hand you a .deb file over that includes the changes. Would you prefer that?

sezanzeb commented 3 years ago

http://hip70890b.de/static/downloads/key-mapper-0.6.0.deb

sojusnik commented 3 years ago

Installed the above linked .deb and restarted Ubuntu. It works as expected, but with reservations.

On every Ubuntu installation my Bluetooth devices are connected twice at startup. The first time when I do something with the devices, usually at the login screen or shortly after, and the second time after 30-60 seconds after the login, when the desktop has loaded, so I assume. I don't know why the latter has to happen, but I observed this behaviour on all previous Ubuntu installations.

So your app works after the first connection, but stops after the second reconnect.

Additionally, my Bluetooth devices go into standby mode, presumably after one hour of inactivity. In this case, your app won't continue to work too. This is a huge drawback that should be somehow fixed in order to fully enjoy the benefits of your wonderful app.

sezanzeb commented 3 years ago

Thanks a lot for trying out!

I'll loosen the constraints a bit more and will let you know when I have something new

sezanzeb commented 3 years ago

Try this please:

http://hip70890b.de/static/downloads/key-mapper-0.6.1.deb

it allows redundant autoloadings 15 seconds after the previous one

sojusnik commented 3 years ago

Works great! Even after an Ubuntu restart and manually turning off the Bluetooth mouse for 5 minutes and reconnecting.

sezanzeb commented 3 years ago

Great! thank you

I'll push it to the main branch then later

sojusnik commented 3 years ago

Very strange...

Now, after a cold reboot, the settings aren't applied automatically, only after pressing "apply" in your app they are applied again, even if I disconnect and reconnect my Bluetooth mouse manually.

sezanzeb commented 3 years ago

interesting

journalctl -u key-mapper.service | tail -n 50 please

sezanzeb commented 3 years ago

did you install using the latest release file? If so, it doesn't contain the udev stuff yet. That will be included in 0.7.0 later. Or is it still from when I sent you the file?

It currently is part of the latest source though, if you install via the instructions shown at https://github.com/sezanzeb/key-mapper#ubuntudebian (the 4 lines that you need to insert in your terminal) it is included

sojusnik commented 3 years ago
$ journalctl -u key-mapper.service | tail -n 100
-- Reboot --
Feb 08 09:58:05 mir systemd[1]: Starting Service to inject keycodes without the GUI application...
Feb 08 09:58:06 mir key-mapper-service[799]: Loaded config from "/home/root/.config/key-mapper/config.json"
Feb 08 09:58:06 mir key-mapper-service[799]: This output is also stored in "/root/.log/key-mapper"
Feb 08 09:58:06 mir key-mapper-service[799]: Logging to "/root/.log/key-mapper/log"
Feb 08 09:58:06 mir key-mapper-service[799]: key-mapper 0.6.1 3ecfb71e8c74a8705db27d61bef561e66b7093b3
Feb 08 09:58:06 mir key-mapper-service[799]: python-evdev 1.3.0
Feb 08 09:58:06 mir systemd[1]: Started Service to inject keycodes without the GUI application.
Feb 08 09:58:06 mir key-mapper-service[799]: ERROR: Tried to autoload /dev/input/mice without configuring the daemon first via set_config_dir.
Feb 08 09:58:07 mir key-mapper-service[799]: ERROR: Tried to autoload /dev/input/event7 without configuring the daemon first via set_config_dir.
Feb 08 09:58:07 mir key-mapper-service[799]: ERROR: Tried to autoload /dev/input/event4 without configuring the daemon first via set_config_dir.
Feb 08 09:58:07 mir key-mapper-service[799]: ERROR: Tried to autoload /dev/input/event9 without configuring the daemon first via set_config_dir.
Feb 08 09:58:07 mir key-mapper-service[799]: ERROR: Tried to autoload /dev/input/event12 without configuring the daemon first via set_config_dir.
Feb 08 09:58:07 mir key-mapper-service[799]: ERROR: Tried to autoload /dev/input/event0 without configuring the daemon first via set_config_dir.
Feb 08 09:58:07 mir key-mapper-service[799]: ERROR: Tried to autoload /dev/input/event5 without configuring the daemon first via set_config_dir.
Feb 08 09:58:08 mir key-mapper-service[799]: ERROR: Tried to autoload /dev/input/event8 without configuring the daemon first via set_config_dir.
Feb 08 09:58:08 mir key-mapper-service[799]: ERROR: Tried to autoload /dev/input/event2 without configuring the daemon first via set_config_dir.
Feb 08 09:58:08 mir key-mapper-service[799]: ERROR: Tried to autoload /dev/input/event10 without configuring the daemon first via set_config_dir.
Feb 08 09:58:08 mir key-mapper-service[799]: ERROR: Tried to autoload /dev/input/event6 without configuring the daemon first via set_config_dir.
Feb 08 09:58:08 mir key-mapper-service[799]: ERROR: Tried to autoload /dev/input/event1 without configuring the daemon first via set_config_dir.
Feb 08 09:58:08 mir key-mapper-service[799]: ERROR: Tried to autoload /dev/input/event3 without configuring the daemon first via set_config_dir.
Feb 08 09:58:08 mir key-mapper-service[799]: ERROR: Tried to autoload /dev/input/event13 without configuring the daemon first via set_config_dir.
Feb 08 09:58:08 mir key-mapper-service[799]: ERROR: Tried to autoload /dev/input/event11 without configuring the daemon first via set_config_dir.
Feb 08 09:58:58 mir key-mapper-service[799]: Loaded config from "/home/sojusnik/.config/key-mapper/config.json"
Feb 08 09:58:58 mir key-mapper-service[799]: Stopping all injections
Feb 08 09:58:58 mir key-mapper-service[799]: Loaded config from "/home/sojusnik/.config/key-mapper/config.json"
Feb 08 09:58:58 mir key-mapper-service[799]: Autoloading for all devices
Feb 08 09:58:58 mir key-mapper-service[799]: Autoloading "M585/M590 Mouse"
Feb 08 09:58:58 mir key-mapper-service[799]: Found "  RPI Wired Keyboard 5", "Video Bus"
Feb 08 09:58:58 mir key-mapper-service[799]: Found "  RPI Wired Keyboard 5", "Video Bus"
Feb 08 09:58:58 mir key-mapper-service[799]: ERROR: Could not find device "M585/M590 Mouse"
Feb 08 09:58:58 mir key-mapper-service[799]: Autoloading "Keyboard K380 Keyboard"
Feb 08 09:58:58 mir key-mapper-service[799]: Found "  RPI Wired Keyboard 5", "Video Bus"
Feb 08 09:58:58 mir key-mapper-service[799]: ERROR: Could not find device "Keyboard K380 Keyboard"
Feb 08 10:02:20 mir key-mapper-service[799]: Loaded config from "/home/sojusnik/.config/key-mapper/config.json"
Feb 08 10:02:21 mir key-mapper-service[799]: Found "M585/M590 Mouse", "Keyboard K380 Keyboard", "  RPI Wired Keyboard 5", "Video Bus"
Feb 08 10:02:21 mir key-mapper-service[799]: Loading preset from "/home/sojusnik/.config/key-mapper/presets/M585/M590 Mouse/tweaked.json"
Feb 08 10:02:21 mir key-mapper-service[29531]: Starting injecting the mapping for "M585/M590 Mouse"
Feb 08 10:02:29 mir key-mapper-service[799]: Loaded config from "/home/sojusnik/.config/key-mapper/config.json"
Feb 08 10:02:29 mir key-mapper-service[799]: Loading preset from "/home/sojusnik/.config/key-mapper/presets/Keyboard K380 Keyboard/tweaked.json"
Feb 08 10:02:29 mir key-mapper-service[29555]: Starting injecting the mapping for "Keyboard K380 Keyboard"
Feb 08 10:03:21 mir key-mapper-service[29531]: ERROR: [Errno 19] No such device
Feb 08 10:03:28 mir key-mapper-service[799]: Autoloading "M585/M590 Mouse"
Feb 08 10:03:28 mir key-mapper-service[799]: Loading preset from "/home/sojusnik/.config/key-mapper/presets/M585/M590 Mouse/tweaked.json"
Feb 08 10:03:28 mir key-mapper-service[799]: Stopping injecting keycodes for device "M585/M590 Mouse"
Feb 08 10:03:28 mir key-mapper-service[799]: Autoloading "M585/M590 Mouse"
Feb 08 10:03:28 mir key-mapper-service[799]: Not autoloading the same preset "tweaked" again for device "M585/M590 Mouse"
Feb 08 10:03:28 mir key-mapper-service[31396]: Starting injecting the mapping for "M585/M590 Mouse"
Feb 08 13:56:41 mir key-mapper-service[29555]: ERROR: [Errno 19] No such device
Feb 08 13:58:06 mir key-mapper-service[31396]: ERROR: [Errno 19] No such device
Feb 08 14:47:34 mir key-mapper-service[799]: Autoloading "M585/M590 Mouse"
Feb 08 14:47:34 mir key-mapper-service[799]: Loading preset from "/home/sojusnik/.config/key-mapper/presets/M585/M590 Mouse/tweaked.json"
Feb 08 14:47:34 mir key-mapper-service[799]: Stopping injecting keycodes for device "M585/M590 Mouse"
Feb 08 14:47:34 mir key-mapper-service[187562]: Starting injecting the mapping for "M585/M590 Mouse"
Feb 08 14:47:34 mir key-mapper-service[799]: Autoloading "M585/M590 Mouse"
Feb 08 14:47:34 mir key-mapper-service[799]: Not autoloading the same preset "tweaked" again for device "M585/M590 Mouse"
Feb 08 14:47:35 mir key-mapper-service[799]: Autoloading "Keyboard K380 Keyboard"
Feb 08 14:47:35 mir key-mapper-service[799]: Loading preset from "/home/sojusnik/.config/key-mapper/presets/Keyboard K380 Keyboard/tweaked.json"
Feb 08 14:47:35 mir key-mapper-service[799]: Stopping injecting keycodes for device "Keyboard K380 Keyboard"
Feb 08 14:47:35 mir key-mapper-service[187583]: Starting injecting the mapping for "Keyboard K380 Keyboard"
Feb 08 14:47:35 mir key-mapper-service[187583]: ERROR: Could not find "/dev/input/event18"
Feb 08 14:47:35 mir key-mapper-service[187583]: ERROR: Could not find "/dev/input/event17"
Feb 08 14:47:35 mir key-mapper-service[187583]: ERROR: Did not grab any device
Feb 08 14:49:25 mir key-mapper-service[799]: Autoloading "Keyboard K380 Keyboard"
Feb 08 14:49:25 mir key-mapper-service[799]: Loading preset from "/home/sojusnik/.config/key-mapper/presets/Keyboard K380 Keyboard/tweaked.json"
Feb 08 14:49:25 mir key-mapper-service[799]: Stopping injecting keycodes for device "Keyboard K380 Keyboard"
Feb 08 14:49:25 mir key-mapper-service[187705]: Starting injecting the mapping for "Keyboard K380 Keyboard"
Feb 08 14:49:25 mir key-mapper-service[799]: Autoloading "Keyboard K380 Keyboard"
Feb 08 14:49:25 mir key-mapper-service[799]: Not autoloading the same preset "tweaked" again for device "Keyboard K380 Keyboard"
Feb 08 18:22:11 mir key-mapper-service[187705]: ERROR: [Errno 19] No such device
Feb 08 18:24:41 mir key-mapper-service[187562]: ERROR: [Errno 19] No such device
Feb 08 20:09:04 mir key-mapper-service[799]: Autoloading "M585/M590 Mouse"
Feb 08 20:09:04 mir key-mapper-service[799]: Loading preset from "/home/sojusnik/.config/key-mapper/presets/M585/M590 Mouse/tweaked.json"
Feb 08 20:09:04 mir key-mapper-service[799]: Stopping injecting keycodes for device "M585/M590 Mouse"
Feb 08 20:09:04 mir key-mapper-service[202021]: Starting injecting the mapping for "M585/M590 Mouse"
Feb 08 20:09:04 mir key-mapper-service[799]: Autoloading "M585/M590 Mouse"
Feb 08 20:09:04 mir key-mapper-service[799]: Not autoloading the same preset "tweaked" again for device "M585/M590 Mouse"
Feb 08 20:09:05 mir key-mapper-service[799]: Autoloading "Keyboard K380 Keyboard"
Feb 08 20:09:05 mir key-mapper-service[799]: Loading preset from "/home/sojusnik/.config/key-mapper/presets/Keyboard K380 Keyboard/tweaked.json"
Feb 08 20:09:05 mir key-mapper-service[799]: Stopping injecting keycodes for device "Keyboard K380 Keyboard"
Feb 08 20:09:05 mir key-mapper-service[202041]: Starting injecting the mapping for "Keyboard K380 Keyboard"
Feb 08 20:09:05 mir key-mapper-service[202041]: ERROR: Could not find "/dev/input/event18"
Feb 08 20:09:05 mir key-mapper-service[202041]: ERROR: Could not find "/dev/input/event17"
Feb 08 20:09:05 mir key-mapper-service[202041]: ERROR: Did not grab any device
Feb 08 20:20:27 mir key-mapper-service[799]: Autoloading "Keyboard K380 Keyboard"
Feb 08 20:20:27 mir key-mapper-service[799]: Loading preset from "/home/sojusnik/.config/key-mapper/presets/Keyboard K380 Keyboard/tweaked.json"
Feb 08 20:20:27 mir key-mapper-service[799]: Stopping injecting keycodes for device "Keyboard K380 Keyboard"
Feb 08 20:20:27 mir key-mapper-service[203617]: Starting injecting the mapping for "Keyboard K380 Keyboard"
Feb 08 20:20:27 mir key-mapper-service[799]: Autoloading "Keyboard K380 Keyboard"
Feb 08 20:20:27 mir key-mapper-service[799]: Not autoloading the same preset "tweaked" again for device "Keyboard K380 Keyboard"

did you install using the latest release file? If so, it doesn't contain the udev stuff yet. That will be included in 0.7.0 later. Or is it still from when I sent you the file?

The file you've sent me, http://hip70890b.de/static/downloads/key-mapper-0.6.1.deb

sezanzeb commented 3 years ago

I wonder if the paths to /dev are outdated in the daemons memory

~can you please try http://sezanzeb.de/static/downloads/key-mapper-0.6.1.deb?~

EDIT: wait a bit, there are more potential flaws if that was the cause

sezanzeb commented 3 years ago

please try http://sezanzeb.de/static/downloads/key-mapper-0.6.1.deb

it has some logic for scanning all devices again on autoload if the old information is older than 10 seconds or if the device name or path are unknown.

sojusnik commented 3 years ago

Installed your last linked version and restarted Ubuntu.

Now, the settings were applied after the second reconnect of the Bluetooth mouse. But for the Bluetooth keyboard no settings were applied at all. Only after manually turning it off an on, they get applied.

$ journalctl -u key-mapper.service | tail -n 100
-- Reboot --
Feb 09 08:45:53 mir systemd[1]: Starting Service to inject keycodes without the GUI application...
Feb 09 08:45:54 mir key-mapper-service[841]: Loaded config from "/home/root/.config/key-mapper/config.json"
Feb 09 08:45:54 mir key-mapper-service[841]: This output is also stored in "/root/.log/key-mapper"
Feb 09 08:45:54 mir key-mapper-service[841]: Logging to "/root/.log/key-mapper/log"
Feb 09 08:45:54 mir key-mapper-service[841]: key-mapper 0.6.1 49910202e97a5210383d0fc32a9a48e5a7d00336
Feb 09 08:45:54 mir key-mapper-service[841]: python-evdev 1.3.0
Feb 09 08:45:54 mir systemd[1]: Started Service to inject keycodes without the GUI application.
Feb 09 08:45:55 mir key-mapper-service[841]: ERROR: Tried to autoload /dev/input/event2 without configuring the daemon first via set_config_dir.
Feb 09 08:45:55 mir key-mapper-service[841]: ERROR: Tried to autoload /dev/input/event3 without configuring the daemon first via set_config_dir.
Feb 09 08:45:55 mir key-mapper-service[841]: ERROR: Tried to autoload /dev/input/mice without configuring the daemon first via set_config_dir.
Feb 09 08:45:55 mir key-mapper-service[841]: ERROR: Tried to autoload /dev/input/event0 without configuring the daemon first via set_config_dir.
Feb 09 08:45:55 mir key-mapper-service[841]: ERROR: Tried to autoload /dev/input/event5 without configuring the daemon first via set_config_dir.
Feb 09 08:45:56 mir key-mapper-service[841]: ERROR: Tried to autoload /dev/input/event4 without configuring the daemon first via set_config_dir.
Feb 09 08:45:56 mir key-mapper-service[841]: ERROR: Tried to autoload /dev/input/event7 without configuring the daemon first via set_config_dir.
Feb 09 08:45:56 mir key-mapper-service[841]: ERROR: Tried to autoload /dev/input/event1 without configuring the daemon first via set_config_dir.
Feb 09 08:45:56 mir key-mapper-service[841]: ERROR: Tried to autoload /dev/input/event8 without configuring the daemon first via set_config_dir.
Feb 09 08:45:56 mir key-mapper-service[841]: ERROR: Tried to autoload /dev/input/event9 without configuring the daemon first via set_config_dir.
Feb 09 08:45:56 mir key-mapper-service[841]: ERROR: Tried to autoload /dev/input/event6 without configuring the daemon first via set_config_dir.
Feb 09 08:45:56 mir key-mapper-service[841]: ERROR: Tried to autoload /dev/input/event10 without configuring the daemon first via set_config_dir.
Feb 09 08:45:56 mir key-mapper-service[841]: ERROR: Tried to autoload /dev/input/event13 without configuring the daemon first via set_config_dir.
Feb 09 08:45:56 mir key-mapper-service[841]: ERROR: Tried to autoload /dev/input/event12 without configuring the daemon first via set_config_dir.
Feb 09 08:45:56 mir key-mapper-service[841]: ERROR: Tried to autoload /dev/input/event11 without configuring the daemon first via set_config_dir.
Feb 09 08:46:10 mir key-mapper-service[841]: Loaded config from "/home/sojusnik/.config/key-mapper/config.json"
Feb 09 08:46:10 mir key-mapper-service[841]: Stopping all injections
Feb 09 08:46:11 mir key-mapper-service[841]: Loaded config from "/home/sojusnik/.config/key-mapper/config.json"
Feb 09 08:46:11 mir key-mapper-service[841]: Autoloading for all devices
Feb 09 08:46:11 mir key-mapper-service[841]: Found "  RPI Wired Keyboard 5", "Video Bus"
Feb 09 08:46:11 mir key-mapper-service[841]: Autoloading "M585/M590 Mouse"
Feb 09 08:46:12 mir key-mapper-service[841]: Found "  RPI Wired Keyboard 5", "Video Bus"
Feb 09 08:46:12 mir key-mapper-service[841]: ERROR: Could not find device "M585/M590 Mouse"
Feb 09 08:46:12 mir key-mapper-service[841]: Found "  RPI Wired Keyboard 5", "Video Bus"
Feb 09 08:46:12 mir key-mapper-service[841]: Autoloading "Keyboard K380 Keyboard"
Feb 09 08:46:13 mir key-mapper-service[841]: Found "  RPI Wired Keyboard 5", "Video Bus"
Feb 09 08:46:13 mir key-mapper-service[841]: ERROR: Could not find device "Keyboard K380 Keyboard"
Feb 09 08:46:15 mir key-mapper-service[841]: Found "M585/M590 Mouse", "  RPI Wired Keyboard 5", "Video Bus"
Feb 09 08:46:15 mir key-mapper-service[841]: Autoloading "M585/M590 Mouse"
Feb 09 08:46:15 mir key-mapper-service[841]: Not autoloading the same preset "tweaked" again for device "M585/M590 Mouse"
Feb 09 08:46:15 mir key-mapper-service[841]: Autoloading "M585/M590 Mouse"
Feb 09 08:46:15 mir key-mapper-service[841]: Not autoloading the same preset "tweaked" again for device "M585/M590 Mouse"
Feb 09 08:46:26 mir key-mapper-service[841]: Found "Keyboard K380 Keyboard", "M585/M590 Mouse", "  RPI Wired Keyboard 5", "Video Bus"
Feb 09 08:46:26 mir key-mapper-service[841]: Autoloading "Keyboard K380 Keyboard"
Feb 09 08:46:26 mir key-mapper-service[841]: Not autoloading the same preset "tweaked" again for device "Keyboard K380 Keyboard"
Feb 09 08:46:26 mir key-mapper-service[841]: Autoloading "Keyboard K380 Keyboard"
Feb 09 08:46:26 mir key-mapper-service[841]: Not autoloading the same preset "tweaked" again for device "Keyboard K380 Keyboard"
Feb 09 08:46:26 mir key-mapper-service[841]: Autoloading "Keyboard K380 Keyboard"
Feb 09 08:46:26 mir key-mapper-service[841]: Not autoloading the same preset "tweaked" again for device "Keyboard K380 Keyboard"
Feb 09 08:46:48 mir key-mapper-service[841]: Found "M585/M590 Mouse", "Keyboard K380 Keyboard", "  RPI Wired Keyboard 5", "Video Bus"
Feb 09 08:46:48 mir key-mapper-service[841]: Autoloading "M585/M590 Mouse"
Feb 09 08:46:48 mir key-mapper-service[841]: Loading preset from "/home/sojusnik/.config/key-mapper/presets/M585/M590 Mouse/tweaked.json"
Feb 09 08:46:48 mir key-mapper-service[14824]: Starting injecting the mapping for "M585/M590 Mouse"
Feb 09 08:46:49 mir key-mapper-service[841]: Found "key-mapper M585/M590 Mouse", "M585/M590 Mouse", "Keyboard K380 Keyboard", "  RPI Wired Keyboard 5", "Video Bus"
Feb 09 08:46:49 mir key-mapper-service[841]: Autoloading "M585/M590 Mouse"
Feb 09 08:46:49 mir key-mapper-service[841]: Not autoloading the same preset "tweaked" again for device "M585/M590 Mouse"
Feb 09 08:46:50 mir key-mapper-service[841]: Found "key-mapper M585/M590 Mouse", "M585/M590 Mouse", "Keyboard K380 Keyboard", "  RPI Wired Keyboard 5", "Video Bus"
Feb 09 08:46:50 mir key-mapper-service[841]: Found "key-mapper M585/M590 Mouse", "M585/M590 Mouse", "Keyboard K380 Keyboard", "  RPI Wired Keyboard 5", "Video Bus"
Feb 09 08:55:55 mir key-mapper-service[841]: Found "Keyboard K380 Keyboard", "key-mapper M585/M590 Mouse", "M585/M590 Mouse", "  RPI Wired Keyboard 5", "Video Bus"
Feb 09 08:55:55 mir key-mapper-service[841]: Autoloading "Keyboard K380 Keyboard"
Feb 09 08:55:55 mir key-mapper-service[841]: Loading preset from "/home/sojusnik/.config/key-mapper/presets/Keyboard K380 Keyboard/tweaked.json"
Feb 09 08:55:55 mir key-mapper-service[841]: Autoloading "Keyboard K380 Keyboard"
Feb 09 08:55:55 mir key-mapper-service[841]: Not autoloading the same preset "tweaked" again for device "Keyboard K380 Keyboard"
Feb 09 08:55:55 mir key-mapper-service[841]: Autoloading "Keyboard K380 Keyboard"
Feb 09 08:55:55 mir key-mapper-service[841]: Not autoloading the same preset "tweaked" again for device "Keyboard K380 Keyboard"
Feb 09 08:55:55 mir key-mapper-service[42162]: Starting injecting the mapping for "Keyboard K380 Keyboard"
Feb 09 08:55:56 mir key-mapper-service[841]: Found "key-mapper M585/M590 Mouse", "Keyboard K380 Keyboard", "M585/M590 Mouse", "  RPI Wired Keyboard 5", "Video Bus"
sezanzeb commented 3 years ago

~Some improved logs are in this package:~

~http://sezanzeb.de/static/downloads/key-mapper-0.6.1.deb~

~And it sleeps before injecting to make sure devices are properly available, but I don't think this was the issue.~

~This time, please try to reproduce it via:~

sudo systemctl stop key-mapper
sudo key-mapper-service -d
key-mapper-control --command stop-all

~now (disconnect and) connect your keyboard. Is the injection running now?~

~Please share the logs again if you can reproduce it like that as well~

~It's quite troublesome, sorry. Looks like getting udev to work is not that easy. Maybe I can try to find a bluetooth device at work in the next few days and try to reproduce it.~

sezanzeb commented 3 years ago

ah wait, I think I got the problem

sezanzeb commented 3 years ago

Now try again please, just like you would normally use it http://sezanzeb.de/static/downloads/key-mapper-0.6.1.deb

bblanke commented 3 years ago

Hey thanks for making this! I have a Keycron K4 and am using Ubuntu 20.04. I'm using the keyboard in bluetooth mode. The last release that you produced on the "releases" page (also 0.6.1) didn't reload key configs when I rebooted. But the update you just posted works great! Everything persists after a reboot. This saved me a lot of time and headache.

sezanzeb commented 3 years ago

nice, thanks a lot for trying. lets also wait for sojusnik feedback and then I'll push it to main.

I'll probably put it into 0.7.0 next weekend together with some other new feature

sojusnik commented 3 years ago

The new version works great, thanks!