houmain / keymapper

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

Fake ALT >> CONTROL remap. #154

Closed miron2363 closed 2 weeks ago

miron2363 commented 2 weeks ago

I use the left alt as a control.

Then I assign control + j/k/h/l to the arrows and expect that when I physically press alt left +j/k/h/l it will be treated as control + j/k/h/l and activate arrow keys due to the fact that I assigned left alt as Control.

This is how it works in powertoys and I expected the same behavior, because now when I physically press alt+h/j/k/l it doesn't activate the arrows. Is there a way to achieve the desired behavior?

image

ristomatti commented 2 weeks ago

I also got confused with this in the beginning. I suggest reading the functional principle section from the README a few times. It can save a lot of time later on.

The input keys should in this case correspond to the actual physical keys as the mappings done earlier in the config won't apply to the ones following(*).

Just changing Control to AltLeft on the hjkl mappings would likely do the trick.

*) This used to be always the case prior to Keymapper 4.4.0 which introduced support for multi stage processing. I have not yet experimented with the feature but I believe it could be used to achieve a solution that could perhaps be more intuitive for you. If you wish to try it, add this before the hjkl mappings:

[stage]
# HJKL mappings here

P.S. Please use a code block formatting instead of a screenshot so it's easy to just copy the config for testing or to provide a modified version in the reply.

Screenshot_20240704_152920_Opera

miron2363 commented 2 weeks ago

Thanks! That works!

AltLeft >> Control

[stage]
Control{J} >> ArrowDown
Control{K} >> ArrowUp
Control{H} >> ArrowLeft
Control{L} >> ArrowRight`