From aa0b2c1a7eafc9703a71da455c6cb7f3e69da1df Mon Sep 17 00:00:00 2001 From: "Leandro M. Peralta" Date: Sat, 18 May 2024 15:00:45 +1200 Subject: [PATCH 1/4] Add examples for common patterns. --- examples/extend-layer.conf | 36 +++++++++++++++++++++++++++++++++++ examples/home-row-mods.conf | 23 ++++++++++++++++++++++ examples/layer-carousel.conf | 37 ++++++++++++++++++++++++++++++++++++ examples/shift-bar.conf | 14 ++++++++++++++ 4 files changed, 110 insertions(+) create mode 100644 examples/extend-layer.conf create mode 100644 examples/home-row-mods.conf create mode 100644 examples/layer-carousel.conf create mode 100644 examples/shift-bar.conf diff --git a/examples/extend-layer.conf b/examples/extend-layer.conf new file mode 100644 index 0000000..cdb1460 --- /dev/null +++ b/examples/extend-layer.conf @@ -0,0 +1,36 @@ +# This example demonstrates how to implement a variant of the Extend layer. +# Notice how you can pin the layer down with the space bar if you need to +# do complex operations using the fingers of both hands. Vim users might +# prefer to bind left, down up and right to h, j, k and l respectively. +[ids] + +* + +[main] + +capslock = overload(extend, capslock) + +[extend] + +q = overload(alt, escape) +y = pageup +u = home +i = up +o = end +p = insert +a = leftcontrol +s = leftshift +d = leftmeta +f = leftalt +h = pagedown +j = left +k = down +l = right +semicolon = delete +apostrophe = esc +n = compose +m = backspace +comma = space +dot = tab +slash = enter +space = overload(extend, capslock) diff --git a/examples/home-row-mods.conf b/examples/home-row-mods.conf new file mode 100644 index 0000000..eb19f8f --- /dev/null +++ b/examples/home-row-mods.conf @@ -0,0 +1,23 @@ +# This example demonstrates how to implement one of the variants of home row modifers. +# Notice we use the oneshot shift pattern. This is important to prevent shifting errors caused by +# the necessary delay with which characters are emitted under overloadt (on release, instead of on press). +# It is not recommended to use home-row shift for typing for the same reason. Home row modifiers +# are best suited for combinations (i.e., shortcuts). +[ids] + +* + +[main] + +a = overloadt(control, a, 200) +s = overloadt(shift, s, 200) +d = overloadt(meta, d, 200) +f = overloadt(alt, f, 200) +j = overloadt(alt, j, 200) +k = overloadt(meta, k, 200) +l = overloadt(shift, l, 200) +; = overloadt(control, ;, 200) +v = overloadt(altgr, v, 200) +m = overloadt(altgr, m, 200) +leftshift = oneshot(shift) +rightshift = oneshot(shift) diff --git a/examples/layer-carousel.conf b/examples/layer-carousel.conf new file mode 100644 index 0000000..a9986e2 --- /dev/null +++ b/examples/layer-carousel.conf @@ -0,0 +1,37 @@ +# This example demostrates how to implement a layer carousel by: +# - Hold space (numbers layer) +# - Tap right shift (functions layer) +# - Tap left shift (numbers layer) +# - Tap left shift (symbols layer) +# - Release space (main layer) +# By using swap in our secondary layers, the layer held by space, as determined in the main layer, +# changes and remains until another swap takes place or the space bar is released and the main layer +# is brought forward again. +[ids] + +* + +[main] + +space = overloadt(numbers, space, 200) + +[numbers] + +a = 1 +# Other numbers here. +leftshift = overload(shift, swap(symbols)) +rightshift = overload(shift, swap(functions)) + +[functions] + +a = f1 +# Other functions here. +leftshift = overload(shift, swap(numbers)) +rightshift = overload(shift, swap(symbols)) + +[symbols] + +a = grave +# Other symbols here. +leftshift = overload(shift, swap(functions)) +rightshift = overload(shift, swap(numbers)) diff --git a/examples/shift-bar.conf b/examples/shift-bar.conf new file mode 100644 index 0000000..d65c1d7 --- /dev/null +++ b/examples/shift-bar.conf @@ -0,0 +1,14 @@ +# This example demostrates how to use the space-bar as a shift key by: +# 1. Holding shift +# 2. Holding space +# 3. Releasing shift +# You can continue to type with the fingers of both hands and then release the space-bar to exit the shift layer. +# Consider this as an alternative to caps-word mode (see issue #711). + +[ids] + +* + +[shift] + +space = overloadt(shift, space) From d7a22457eed19356ad1fad6b89a95ee502b55051 Mon Sep 17 00:00:00 2001 From: "Leandro M. Peralta" Date: Sat, 18 May 2024 15:06:43 +1200 Subject: [PATCH 2/4] Fix error in shift-bar example. --- examples/shift-bar.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/shift-bar.conf b/examples/shift-bar.conf index d65c1d7..288420c 100644 --- a/examples/shift-bar.conf +++ b/examples/shift-bar.conf @@ -11,4 +11,4 @@ [shift] -space = overloadt(shift, space) +space = overloadt(shift, space, 200) From 5ad84bfa66803956fe83bad0fe5bebccb8a0c1c1 Mon Sep 17 00:00:00 2001 From: "Leandro M. Peralta" Date: Sat, 18 May 2024 18:12:37 +1200 Subject: [PATCH 3/4] Add simlayer example. --- examples/simlayer.conf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 examples/simlayer.conf diff --git a/examples/simlayer.conf b/examples/simlayer.conf new file mode 100644 index 0000000..a535dcc --- /dev/null +++ b/examples/simlayer.conf @@ -0,0 +1,18 @@ +# This example demonstrates what is sometimes calle a simlayer: when the layer is activated, +# if no action is taken within a specified period of time, another action takes place. This +# can be used, for example, to preserve the repeat action of a key (backspace in this case) +# that is being overloaded. +# +[ids] + +* + +[main] + +backspace = timeout(overload(shortcuts, backspace), 500, backspace) + +[shortcuts] + +1 = M-pageup +2 = M-pagedown +# Other shortcuts here. From a6cae4fbb25b2e96dd30df3ebab5479be702105a Mon Sep 17 00:00:00 2001 From: "Leandro M. Peralta" Date: Sun, 19 May 2024 17:13:46 +1200 Subject: [PATCH 4/4] Correct typos and tidy up example comments. --- examples/extend-layer.conf | 9 +++++---- examples/home-row-mods.conf | 9 +++++---- examples/layer-carousel.conf | 9 +++++---- examples/shift-bar.conf | 5 +++-- examples/simlayer.conf | 10 +++++----- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/examples/extend-layer.conf b/examples/extend-layer.conf index cdb1460..dab31b1 100644 --- a/examples/extend-layer.conf +++ b/examples/extend-layer.conf @@ -1,7 +1,8 @@ -# This example demonstrates how to implement a variant of the Extend layer. -# Notice how you can pin the layer down with the space bar if you need to -# do complex operations using the fingers of both hands. Vim users might -# prefer to bind left, down up and right to h, j, k and l respectively. +# This example demonstrates how to implement a variant of the Extend layer. Notice how +# you can pin the layer down with the space bar if you need to do complex operations +# using the fingers of both hands. Vim users might prefer to bind left, down up and right +# to h, j, k and l respectively. + [ids] * diff --git a/examples/home-row-mods.conf b/examples/home-row-mods.conf index eb19f8f..70bfec0 100644 --- a/examples/home-row-mods.conf +++ b/examples/home-row-mods.conf @@ -1,8 +1,9 @@ # This example demonstrates how to implement one of the variants of home row modifers. -# Notice we use the oneshot shift pattern. This is important to prevent shifting errors caused by -# the necessary delay with which characters are emitted under overloadt (on release, instead of on press). -# It is not recommended to use home-row shift for typing for the same reason. Home row modifiers -# are best suited for combinations (i.e., shortcuts). +# Notice we use the one-shot-shift pattern. This is important to prevent shifting errors +# caused by the necessary delay with which characters are emitted under overloadt (on +# release, instead of on press). It is not recommended to use home-row shift for typing +# for that reason. Home row modifiers are best suited for combinations (i.e., shortcuts). + [ids] * diff --git a/examples/layer-carousel.conf b/examples/layer-carousel.conf index a9986e2..4631591 100644 --- a/examples/layer-carousel.conf +++ b/examples/layer-carousel.conf @@ -1,12 +1,13 @@ -# This example demostrates how to implement a layer carousel by: +# This example demostrates how to implement a layer carousel which behaves as follows: # - Hold space (numbers layer) # - Tap right shift (functions layer) # - Tap left shift (numbers layer) # - Tap left shift (symbols layer) # - Release space (main layer) -# By using swap in our secondary layers, the layer held by space, as determined in the main layer, -# changes and remains until another swap takes place or the space bar is released and the main layer -# is brought forward again. +# By using swap in our secondary layers, the layer held by space (as determined in the +# main layer) is replaced and remains active until another swap takes place or the space +# is eventually released, which brings us back to the main layer. + [ids] * diff --git a/examples/shift-bar.conf b/examples/shift-bar.conf index 288420c..89a6e45 100644 --- a/examples/shift-bar.conf +++ b/examples/shift-bar.conf @@ -2,8 +2,9 @@ # 1. Holding shift # 2. Holding space # 3. Releasing shift -# You can continue to type with the fingers of both hands and then release the space-bar to exit the shift layer. -# Consider this as an alternative to caps-word mode (see issue #711). +# The space-bar will keep the shift layer active until your release it. The advanteage is +# that you can type using the fingers of both hands freely. Consider it as an alternative +# to caps-word mode (see issue #711). [ids] diff --git a/examples/simlayer.conf b/examples/simlayer.conf index a535dcc..12fa749 100644 --- a/examples/simlayer.conf +++ b/examples/simlayer.conf @@ -1,8 +1,8 @@ -# This example demonstrates what is sometimes calle a simlayer: when the layer is activated, -# if no action is taken within a specified period of time, another action takes place. This -# can be used, for example, to preserve the repeat action of a key (backspace in this case) -# that is being overloaded. -# +# This example demonstrates what is sometimes called a simlayer: when the layer is +# activated, if no action is taken within a specified period of time, another action +# takes place. This can be used, for example, to preserve the repeat action of the key +# that is being overloaded (backspace in this case). + [ids] *