Skip to content

Commit

Permalink
fix(ergol-kanata): CapsLock-related bugs
Browse files Browse the repository at this point in the history
Fix bugs on some keys when CapsLock is enabled by using the `unicode`
function throughout, instead of aliasing keys from the base layout.

This also increases portability to non-AZERTY system keymaps, as the
non-base layers are now completely keymap-agnostic.

NB The `unicode` function works with the parenthesis and double quote
characters only starting with Kanata 1.7.0.
  • Loading branch information
cypriani authored and trilowy committed Oct 20, 2024
1 parent d433298 commit 2aa9171
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 46 deletions.
5 changes: 4 additions & 1 deletion drivers/ergol-kanata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

An Ergo-L "portable" driver, emulated with Kanata over your regular keymap.

## Prerequisites

Kanata v1.7.0+ is required.

## Caveats

- Only Windows is supported at this point; this *doesn’t work* on GNU/Linux
(yet?) and is untested on macOS.
- Only Azerty-FR is supported as the base keymap at this point.
- Mac keyboards are not supported at this point.
- CapsLock can have unexpected behaviour, please report bugs.
- Not all the dead keys on the AltGr-Shift layer are implemented yet.
- Some other exotic characters may be missing, please report bugs.
- Layer taps are not supported at this point.
Expand Down
37 changes: 0 additions & 37 deletions drivers/ergol-kanata/defalias_azerty_pc.kbd
Original file line number Diff line number Diff line change
Expand Up @@ -26,43 +26,6 @@
. S-,
)

;; Symbols layer
(defalias

^ (macro [ spc)
< <
> S-<
$ ]
% S-'
@ AG-0
& 1
* \
' 4
` (macro AG-7 spc)

{ AG-4
pl 5
pr -
} AG-=
= =
\ AG-8
+ S-=
- 6
/ S-.
'' 3

~ (macro AG-2 spc)
[ AG-5
] AG--
_ 8
# AG-3
| AG-6
! /
; ,
: .
? S-m
)

;; NumRow layer
(defalias

Expand Down
16 changes: 8 additions & 8 deletions drivers/ergol-kanata/deflayer_base_over_azerty.kbd
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
;; right-hand "extras"
brk1 (t! dk-sft [ {)
brk2 (t! dk-sft ] })
qte (fork 4 (unshift 3) (lsft rsft)) ;; ' "
qte (t! dk-sft ' r#"""#) ;; ' "
bksl (t! dk-sft \ |)

;; lower row
Expand All @@ -58,10 +58,10 @@

;; sft0
(defalias
?sft m
!sft (unshift /)
;sft (unshift ,)
:sft (unshift .)
?sft (unicode ?)
!sft (unicode !)
;sft (unicode ;)
:sft (unicode :)
)

;; Dead key layer 1
Expand All @@ -82,16 +82,16 @@
Œ (t! dk-sft œ Œ)
Ô (t! dk-sft ô Ô)
µ (fork (unicode µ) XX (lsft rsft))
_dk (unshift 8)
_dk (unicode _)
Û (t! dk-sft û Û)

À (t! dk-sft à À)
É (t! dk-sft é É)
È (t! dk-sft è È)
Ê (t! dk-sft ê Ê)
Ñ (t! dk-sft ñ Ñ)
lpar (fork 5 XX (lsft rsft))
rpar (fork - XX (lsft rsft))
lpar (unicode r#"("#) ;; (
rpar (unicode r#")"#) ;; )
Î (t! dk-sft î Î)
Ï (t! dk-sft ï Ï)
Ù (t! dk-sft ù Ù)
Expand Down
33 changes: 33 additions & 0 deletions drivers/ergol-kanata/deflayer_symbols_lafayette.kbd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,39 @@
₈ (unicode ₈)
₉ (unicode ₉)
₀ (unicode ₀)

^ (unicode ^)
< (unicode <)
> (unicode >)
$ (unicode $)
% (unicode %)
@ (unicode @)
& (unicode &)
* (unicode *)
' (unicode ')
` (unicode `)

{ (unicode {)
pl (unicode r#"("#) ;; (
pr (unicode r#")"#) ;; )
} (unicode })
= (unicode =)
\ (unicode \)
+ (unicode +)
- (unicode -)
/ (unicode /)
'' (unicode r#"""#) ;; "

~ (unicode ~)
[ (unicode [)
] (unicode ])
_ (unicode _)
# (unicode #)
| (unicode |)
! (unicode !)
; (unicode ;)
: (unicode :)
? (unicode ?)
)

;; shifted symbols layer aliases
Expand Down

0 comments on commit 2aa9171

Please sign in to comment.