houmain / keymapper

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

Context not being updated on the same window #3

Closed Azarattum closed 3 years ago

Azarattum commented 3 years ago

Issue: When title of a focused windows changes the context is not being updated, because it is still considered the same window.

Why this is a problem: When using applications in terminal like vim it's nice to have a special bindings for them. But when you open such a program from a command line it changes the title but still appears in the same window, therefore the context update is being ignored by the keymapper.

Solution: Update context on title change. Implemented here: https://github.com/Azarattum/UniversalHotkeyer/commit/80a1374540b7c85422cbcef89dd343f6322979fd

If you consider this an intended behavior, feel free to close the issue.

Azarattum commented 3 years ago

Just for clarification, the config file I'm currently using: https://github.com/Azarattum/DotFiles/blob/master/.config/hotkeyer.conf (written in hotkeyer syntax)

houmain commented 3 years ago

No, this is not intended behavior. Just the result of an optimization. I will fix it.

I had a look at your configuration. I am wondering whether the system specific mappings work when e.g. vim is focused? Currently only one context can be active at a time...

Azarattum commented 3 years ago

Yeah, they work because of the fix I implemented for that https://github.com/Azarattum/UniversalHotkeyer/commit/8625c9185fa0ed2cf543f69b4cd27263a3d9c235

It treats mappings as default ones when they have no class and title and the system matches. This is not the most elegant solution, but it works for me. The ideal would be to allow overlapping contexts, but that maybe needs a separate issue.

houmain commented 3 years ago

I fixed this issue and am applying the system contexts similarly to your implementation. Thank you!