houmain / keymapper

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

Force Application Focus Check #51

Closed C-H-F closed 1 year ago

C-H-F commented 1 year ago

Some applications provide a Tab control but do not implement a middle mouse button close for those tabs. It would be great to create a mapping for only this application.

[title="Dumb App"]
Button Middle >> Button Right ^ Arrow Down Enter

In this case the the context menu of the tab is opened and the first option of it (close) will be executed. The problem is: when "Dumb App" is focused a Middle click to another Window will trigger this sequence too. It would be great if there was a possibility to create a "check focus" command after ^ Or some kind of virtual key press that gets re-evaluated.

houmain commented 1 year ago

Hi, interesting use-case! A simple solution would be to discard the on-release-output when the focus changed in the meantime. I will implement that.

houmain commented 1 year ago

Hi, this should work now in the 2.4.0 release.