Replies: 1 comment 1 reply
-
|
This is cross-platform solution, am i right? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This is an introduction to Kanata for opening pie menus with custom shortcuts.
When creating a pie menu with Kando, you will generally want to use shortcuts that are not already used by any software. One way to solve this issue is to use function keys from F13 to F24, which are usually unused since most keyboards dont include them.
Let’s now see how Kanata can be used to access these keys efficiently.
There are multiple ways to do this. I’ll introduce three of them:
Installation
Follow this link](https://github.com/jtroo/kanata/releases) to install Kanata.
Once downloaded and extracted, create a configuration file named kanata.kbd in the same directory.
If you have downloaded the original [kanata.kbd](https://github.com/jtroo/kanata/blob/main/cfg_samples/kanata.kbd), you can directly modify it or keep it in a subfolder as a reference.
Configuration file
Basic remapping
Before explaining the actions available in Kanata, let's start with the most basic config file.
If you have unused keys or extra mouse buttons you want to remap, this config will be sufficient.
Inside (defsrc ), list all the keys separated by whitespace. You can find the syntax for keys in the [kanata.kbd](https://github.com/jtroo/kanata/blob/main/cfg_samples/kanata.kbd) file or in [mod.rs](https://github.com/jtroo/kanata/blob/main/parser/src/keys/mod.rs).
In this example:
Tap-Hold fonction
Defcfg: Add (defcfg process-unmapped-keys yes) [more info](https://jtroo.github.io/config.html#introduction-defcfg)
Defsrc: Choose the physical keys to remap with: (defsrc )
Aliases: (defalias ) define all your functions.
Deflayer: Replace the original q key by the tap-hold function (@name)
layer-while-held function
Let's reuse the previous configuration to implement a keyboard layer.
Choose a key to activate our Function layer. Here, we add the spacebar (spc) to defsrc.
Add a layer-while-held function in defalias
syntax: $name (layer-while-held $layer-name)
(optional) Use a tap-hold function to activate the layer-while-held function.
Define the new layer using deflayer.
In this exemple if you hold Space and then tap E, it will output F15.
Combos / Chords
Let's see an example of a chord configuration, it will send F19 if Q and W is are pressed together and send F20 for Q and E.
There are multiples way to create chords in Kanata. I personally use defchordsv2. To see the other methods check the configuration guide.
you can list in () layer were chords should be disable and choose if the chord activate at first-release or all-released
Exemple of configuration:
Here is an example from my own configuration for inspiration. You can find more example on the [Kanata Github page](https://github.com/jtroo/kanata/tree/main/cfg_samples)
In this configuration, I'm also using a repeat action
([rpt](https://jtroo.github.io/config.html#repeat-key): String action that outputs the single most-recently typed key ).
Kanata doesn't read the key output of Kando, which makes possible to use the rpt action to reopen the last pie menu instead of typing a chord twice. This can be more ergonomic.
Making your own config
To make your own configuration I recommend using the [Kanata simulator](https://jtroo.github.io).
It allows you to test your config and will point out exactly where errors occur if something is wrong.
For more actions or issues not covered in this guide, you can find detailed explanations in the complete configuration guide:
https://jtroo.github.io/config.html
Beta Was this translation helpful? Give feedback.
All reactions