houmain / keymapper

A cross-platform context-aware key remapper.
GNU General Public License v3.0
306 stars 25 forks source link

Context awareness #168

Closed 86Atlas closed 2 months ago

86Atlas commented 2 months ago

Hi all,

I have these lines in my config:

comments start with # or ; and continue until the end of a line

ButtonLeft, ButtonRight, ButtonMiddle, ButtonBack and ButtonForward, the wheel is named WheelUp and WheelDown

[title = 'Path of Exile', class = 'steam_app_238960'] Control {WheelUp} >> Control {ButtonLeft} CapsLock >> (Control ButtonLeft)

And i have been trying for a couple of days to only apply these when the window of Path of Exile (with or without the "class") is focused. I am running the kwin script as well.

Problem is that this always applies to everything and i dont know how to make it work. Any help is highly appreciated.

houmain commented 2 months ago

Very strange, could you start keymapper with the -v flag in a terminal and focus some windows and post the output here? To see whether the configuration is really read from the file you are editing and the focused window detection is working.

86Atlas commented 2 months ago

Hi!

Sure:

Detected focused window changed: class = 'steam_app_238960' title = 'Path of Exile' path = '/usr/share/steam/compatibilitytools.d/proton-cachyos/files/bin/wine64-preloader' Active contexts updated Sending active contexts (2)

However, if i focus say the dolphin window, or just my desktop, there is no change in this output

houmain commented 2 months ago

I tried it with the latest Ubuntu/Wayland/KDE and could reproduce it was no longer working. This updated main.js in in /usr/share/kwin/scripts/keymapper/contents/code/ should make it work again. It will be in the next release. Thanks for reporting!

86Atlas commented 2 months ago

Glad i could help!

houmain commented 2 months ago

This is now in the 4.7.0 release.