Crates.io | kanata |
lib.rs | kanata |
version | 1.7.0-prerelease-2 |
source | src |
created_at | 2022-04-30 23:57:29.345188 |
updated_at | 2024-10-19 23:59:21.513707 |
description | Multi-layer keyboard customization |
homepage | https://github.com/jtroo/kanata |
repository | https://github.com/jtroo/kanata |
max_upload_size | |
id | 578396 |
size | 1,343,014 |
This is a cross-platform software keyboard remapper for Linux, macOS and Windows. A short summary of the features:
Check out the examples directory and the online simulator.
To see all of the features, see the configuration guide. The configuration guide aims to be up-to-date with main and may have features not in your version. See the applicable link in the releases page.
The most similar project is kmonad, which served as the inspiration for kanata. Here's a comparison document.
You can see a list of known issues here.
Showcase of multi-layer functionality (30s, 1.7 MB).
Imagine if, instead of pressing Shift to type uppercase letters, we had giant keyboards with separate keys for lowercase and uppercase letters. I hope we can all agree: that would be a terrible user experience!
A way to think of how Shift keys work is that they switch your input to another layer of functionality where you now type uppercase letters and symbols instead of lowercase letters and numbers.
What kanata allows you to do is take this alternate layer concept that Shift keys have and apply it to any key. You can then customize what those layers do to suit your exact needs and workflows.
Running kanata currently does not start it in a background process. You will need to keep the window that starts kanata running to keep kanata active. Some tips for running kanata in the background:
See the releases page for executables and instructions.
This project uses the latest Rust stable toolchain. If you installed the
Rust toolchain using rustup
, e.g. by using the instructions from the
official website,
you can get the latest stable toolchain with rustup update stable
.
Using cargo install
:
cargo install kanata
# On Linux and macOS, this may not work without `sudo`, see below
kanata --cfg <your_configuration_file>
Build and run yourself in Linux:
git clone https://github.com/jtroo/kanata && cd kanata
cargo build # --release optional, not really perf sensitive
# sudo is used because kanata opens /dev/ files
#
# See below if you want to avoid needing sudo:
# https://github.com/jtroo/kanata/wiki/Avoid-using-sudo-on-Linux
sudo target/debug/kanata --cfg <your_configuration_file>
Build and run yourself in Windows.
git clone https://github.com/jtroo/kanata; cd kanata
cargo build # --release optional, not really perf sensitive
target\debug\kanata --cfg <your_configuration_file>
Build and run yourself in macOS:
For macOS version 11 and newer: Install the Karabiner VirtualHiDDevice Driver.
To activate it:
/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate
For macOS version 10 and older: Install the Karabiner kernel extension.
git clone https://github.com/jtroo/kanata && cd kanata
cargo build # --release optional, not really perf sensitive
# sudo is needed to gain permission to intercept the keyboard
sudo target/debug/kanata --cfg <your_configuration_file>
The full configuration guide is found here.
Sample configuration files are found in cfg_samples. The
simple.kbd file contains a basic configuration file
that is hopefully easy to understand but does not contain all features. The
kanata.kbd
contains an example of all features with documentation. The
release assets also have a kanata.kbd
file that is tested to work with that
release. All key names can be found in the keys module,
and you can also define your own key names.
When either building yourself or using cargo install
,
you can add feature flags that
enable functionality that is turned off by default.
If you want to enable the cmd
actions,
add the flag --features cmd
.
For example:
cargo build --release --features cmd
cargo install --features cmd
On Windows,
if you want to compile a binary that uses the Interception driver,
you should add the flag --features interception_driver
.
For example:
cargo build --release --features interception_driver
cargo install --features interception_driver
To combine multiple flags,
use a single --features
flag
and use a comma to separate the features.
For example:
cargo build --release --features cmd,interception_driver
cargo install --features cmd,interception_driver
kanata_wintercept.exe
)
Contributions are welcome!
Unless explicitly stated otherwise, your contributions to kanata will be made under the LGPL-3.0-only* license.
Some directories are exceptions:
Here's a basic low-effort design doc of kanata
komorebi
(Windows)I wanted a "k" word since this relates to keyboards. According to Wikipedia, kanata is an indigenous Iroquoian word meaning "village" or "settlement" and is the origin of Canada's name.
There's also PPT✧.
TLDR: QMK features but for any keyboard, not just fancy mechanical ones.
I have a few keyboards that run QMK. QMK allows the user to customize the functionality of their keyboard to their heart's content.
One great use case of QMK is its ability map keys so that they overlap with the home row keys but are accessible on another layer. I won't comment on productivity, but I find this greatly helps with my keyboard comfort.
For example, these keys are on the right side of the keyboard:
7 8 9
u i o
j k l
m , .
On one layer I have arrow keys in the same position, and on another layer I have a numpad.
arrows: numpad:
- - - 7 8 9
- ↑ - 4 5 6
← ↓ → 1 2 3
- - - 0 * .
One could add as many customizations as one likes to improve comfort, speed, etc. Personally my main motivator is comfort due to a repetitive strain injury in the past.
However, QMK doesn't run everywhere. In fact, it doesn't run on most hardware you can get. You can't get it to run on a laptop keyboard or any mainstream office keyboard. I believe that the comfort and empowerment QMK provides should be available to anyone with a computer on their existing hardware, instead of having to purchase an enthusiast mechanical keyboard (which are admittedly very nice — I own a few — but can be costly).
The best alternative solution that I found for keyboards that don't run QMK was kmonad. This is an excellent project and I recommend it if you want to try something similar.
The reason for this project's existence is that kmonad is written in Haskell and I have no idea how to begin contributing to a Haskell project. From an outsider's perspective I think Haskell is a great language but I really can't wrap my head around it. And there are a few outstanding issues at the time of writing that make kmonad suboptimal for my personal workflows.
This project is written in Rust because Rust is my favourite programming language and the prior work of the awesome keyberon crate exists.
#[no_std]
library intended for keyboard firmwareWhile kanata is the best tool for some, it may not be the best tool for you. I'm happy to introduce you to tools that may better suit your needs. This list is also useful as reference/inspiration for functionality that could be added to kanata.
The author (jtroo) will not accept monetary donations for work on kanata. Please instead donate your time and/or money to charity.
Some links are below. These links are provided for learning and as interesting reads. They are not an endorsement.