Using Kanata to remap your keyboard

Hey @Kolev , here’s a config that I was able to test and it work https://0x0.st/XHoO.kbd

As you were wishing for in IRC, this is pretty straightforward to add any mapping to AltGr. You add the key you want to add a layer to defsrc and in the corresponding position in deflayer altGr add the altered character. Just like h and .

Hope this works for you, let me know!

1 Like

ẖ ẖ ẖ ẖ. It works! :grinning: Now I just need to figure out how to map AltGr H to H̱.

@Kolev this was more complicated than I thought because H̲ isn’t a single unicode character, it’s H + ̲ . So I had to write a macro and to use Shift as you’d expect I had to learn to use multi and then drop a layer. This was a fun puzzle. You can use both Right and Left Shift but the caveat is that you have to press AltGr first and when you’re done typing H̲ you have to release AltGr, just releasing Shift will keep you typing H̲ instead of ẖ.

Here’s the new config that does bot ẖ and H̲.

Config archived here to not rely on paste bin #| This configuration can be run as a systemd.service https://shom.dev/start/using-kanata-to-remap-any-keyboard/#running-kanata-as-a-service |#

;; global configuration options
(defcfg
process-unmapped-keys yes
log-layer-changes yes
)

;; define keys that will be modified (all keys still processed)
(defsrc
h
lsft ralt rsft
)

;; default/base layer modifications always active
(deflayer default
_
_ @altGr _
)

;; shifted layer activated by holding Right Alt (ALtGr) key
(deflayer altGr
@H̲
_ _ _
)

;; shifted layer activated by holding Right Alt (ALtGr) and Shift key
(deflayer S-altGr
(unicode ẖ)
(release-layer S-altGr) _ (release-layer S-altGr)
)

;; values used by multiple changes
(defvar
tap-time 200
hold-time 250
)

;; remapping between physical keys and functionality
(defalias
altGr (multi (layer-while-held altGr) (layer-while-held S-altGr))
0 0
3 3
2 2
H̲ (macro S-h C-S-u @0 @3 @3 @2 spc)
)

1 Like

I’m trying to add a letter. It seems like I have to repeat everything four times, to add one letter. It looks very tedious.