houmain / keymapper

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

Question about a mapping #36

Closed mark2185 closed 1 year ago

mark2185 commented 1 year ago

I am trying to move Tilde (Shift{Backquote}) to some other key combination.

I managed to succeed with this:

Ctrl{BracketRight} >> !Ctrl Shift{BackQuote}

And since I have this already in my config, I wanted to have Ext{BracketRight} do the same, but it seems to pass through Ctrl{BracketRight} (i.e. <C-]>) no matter what I try.

# aliases
  Ext = CapsLock
  Ctrl = Control

  Ext{Any} >> !Ext Ctrl{Any}

# standalone capslock
  Ext >> Escape

I tried adding Ext{BracketRight} >> Ctrl{BracketRight} in all places, but couldn't quite figure out where it should be.

In the end I solved it with Ext{BracketRight} >> !Ctrl Shift{Backquote} but I am curious as to what would be the correct solution by reusing Ctrl{BracketRight}.

houmain commented 1 year ago

The output of Ext{BracketRight} >> Ctrl{BracketRight} is not mapped again. So there is no position where it would find Ctrl{BracketRight} >> !Ctrl Shift{BackQuote} and output !Ctrl Shift{BackQuote}. To deduplicate the definition of the Tilde output you could add an abstract command:

  Ext{BracketRight} >> Tilde
  Ctrl{BracketRight} >> Tilde
  Tilde >> !Ctrl Shift{Backquote}

or use an Alias:

  Tilde = !Ctrl Shift{Backquote}
  Ext{BracketRight} >> Tilde
  Ctrl{BracketRight} >> Tilde
mark2185 commented 1 year ago

Makes sense.

Thanks!