-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: add press/release-only+toggle cfg sample
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#| | ||
|
||
This configuration showcases all of: | ||
- key toggle | ||
- press-only | ||
- release-only | ||
|
||
|# | ||
|
||
(deftemplate toggle-key (vkey-name output-key alias) | ||
(defvirtualkeys $vkey-name $output-key) | ||
(defalias $alias (on-press toggle-vkey $vkey-name)) | ||
) | ||
|
||
(deftemplate press-only-release-only-pair | ||
(vkey-name output-key press-alias release-alias) | ||
(defvirtualkeys $vkey-name $output-key) | ||
(defalias $press-alias (on-press press-vkey $vkey-name)) | ||
(defalias $release-alias (on-press release-vkey $vkey-name)) | ||
) | ||
|
||
(template-expand toggle-key v-lctl lctl lcl) | ||
(template-expand toggle-key v-rctl rctl rcl) | ||
|
||
;; t! is a short form of template-expand | ||
(t! press-only-release-only-pair v-lalt lalt p-a r-a) | ||
|
||
(defsrc | ||
lctl rctl lalt ralt | ||
) | ||
|
||
(deflayer base | ||
@lcl @rcl @p-a @r-a | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters