Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggested examples for common patterns. #750

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions examples/extend-layer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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)
24 changes: 24 additions & 0 deletions examples/home-row-mods.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This example demonstrates how to implement one of the variants of home row modifers.
# 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]

*

[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)
38 changes: 38 additions & 0 deletions examples/layer-carousel.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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) 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]

*

[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))
15 changes: 15 additions & 0 deletions examples/shift-bar.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This example demostrates how to use the space-bar as a shift key by:
# 1. Holding shift
# 2. Holding space
# 3. Releasing shift
# 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]

*

[shift]

space = overloadt(shift, space, 200)
18 changes: 18 additions & 0 deletions examples/simlayer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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]

*

[main]

backspace = timeout(overload(shortcuts, backspace), 500, backspace)

[shortcuts]

1 = M-pageup
2 = M-pagedown
# Other shortcuts here.