Configuration guide
Link to the appropriate configuration guide version: guide link.
Changelog (since v1.9.0)
HIGHLIGHT: the years-old feature request to handle mouse activity in Windows LLHOOK (non-Intereception) is now implemented.
Change log
XX action now works with switch action's input logic
compose key
reset-timeout-on-press as an option to tap-hold-release-timeout
U+<hex_code> syntax for unicode action
on-physical-idle action
--list flag to list devices for all platforms
--cfg-stdin flag to read config from stdin instead of a file
tap-hold-release-tap-keys-release which has a similar behaviour to QMK "chordal hold"
EjectKey
Sample configuration file
The attached kanata.kbd file is tested to work with the current version. The one in the main branch of the repository may have extra features that are not supported in this release.
Windows
Instructions
NOTE: All Windows binaries are compiled for x86-64 architectures only.
Download kanata.exe. Optionally, download kanata.kbd. With the two files in the same directory, you can double-click the exe to start kanata. Kanata does not start a background process, so the window needs to stay open after startup. See this discussion for tips to run kanata in the background.
You need to run kanata.exe via cmd or powershell to use a different configuration file:
kanata.exe --cfg <cfg_file>
NOTE: The kanata_winIOv2.exe variant contains an experimental breaking change that fixes an issue where the Windows LLHOOK+SendInput version of kanata does not handle defsrc consistently compared to other versions and other operating systems. This variant will be of interest to you for any of the following reasons:
- you are a new user
- you are a cross-platform user
- you use multiple language layouts within Windows and want kanata to handle the key positions consistently
This variant contains the same output change as in the scancode variant below, and also changes the input to also operate on scancodes.
NOTE: The kanata_legacy_output.exe variant has the same input defsrc handling as the standard kanata.exe file. It uses the same output mechanism as the standard kanata.exe variant in version 1.6.1 and earlier. In other words the formerly experimental_scancode variant is now the default binary. The non-legacy variants contain changes for an issue; the fix is omitted from this legacy variant. The legacy variant is included in case issues are found with the new output mechanism.
Linux
Instructions
NOTE: All Linux binaries are compiled for x86 architectures only.
Download kanata.
Run it in a terminal and point it to a valid configuration file. Kanata does not start a background process, so the window needs to stay open after startup. See this discussion for how to set up kanata with systemd.
chmod +x kanata # may be downloaded without executable permissions
sudo ./kanata --cfg <cfg_file>`
To avoid requiring sudo, follow the instructions here.
macOS
Instructions
WARNING: feature support on macOS is limited.
Instructions for macOS 11 and newer
Please read through this issue comment:
Also have a read through this discussion:
Old instructions for macOS 11 and newer
Click to expand
First install Karabiner driver for macOS 11 and newer:
- Install the V5 Karabiner VirtualHiDDevice Driver.
To activate it:
sudo /Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate
Then you need to run the daemon. You should run this in the background somehow or leave the terminal window where you run this command open.
sudo '/Library/Application Support/org.pqrs/Karabiner-DriverKit-VirtualHIDDevice/Applications/Karabiner-VirtualHIDDevice-Daemon.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Daemon'
Install Karabiner driver for macOS 10 and older:
- Install the Karabiner kernel extension.
After installing the appropriate driver for your OS (both macOS <=10 and >=11)
Download a kanata_macos variant.
Run it in a terminal and point it to a valid configuration file. Kanata does not start a background process, so the window needs to stay open after startup.
Example
chmod +x kanata_macos_arm64 # may be downloaded without executable permissions
sudo ./kanata_macos_arm64 --cfg <cfg_file>`
Add permissions
If Kanata is not behaving correctly, you may need to add permissions. Please see this issue: link to macOS permissions issue.
cmd_allowed variants
Explanation
The binaries with the name cmd_allowed are conditionally compiled with the cmd action enabled.
Using the regular binaries, there is no way to get the cmd action to work. This action is restricted behind conditional compilation because I consider the action to be a security risk that should be explicitly opted into and completely forbidden by default.
wintercept variants
Explanation and instructions
Warning: known issue
This issue in the Interception driver exists: oblitum/Interception#25. This will affect you if you put your PC to sleep instead of shutting it down, or if you frequently plug/unplug USB devices.
Description
These variants use the Interception driver instead of Windows hooks. You will need to install the driver using the release or from the copy in this repo. The benefit of using this driver is that it is a lower-level mechanism than Windows hooks. This means kanata will work in more applications.
Steps to install the driver
- extract the
.zip - run a shell with administrator privilege
- run the script
"command line installer/install-interception.exe" - reboot
Additional installation steps
The above steps are those recommended by the interception driver author. However, I have found that those steps work inconsistently and sometimes the dll stops being able to be loaded. I think it has something to do with being installed in the privileged location of system32\drivers.
To help with the dll issue, you can copy the following file in the zip archive to the directory that kanata starts from: Interception\library\x64\interception.dll.
E.g. if you start kanata from your Documents folder, put the file there:
C:\Users\my_user\Documents\
kanata_wintercept.exe
kanata.kbd
interception.dll
kanata_passthru.dll
WARNING: In this version, the dll is not included because of a build issue. This will be fixed in the next release.
The Windows To make use of this, download Explanation and instructions
kanata_passthru.dll file allows using Kanata as a library within AutoHotkey to avoid conflicts between keyboard hooks installed by both. You can channel keyboard input events received by AutoHotkey into Kanata's keyboard engine and get the transformed keyboard output events (per your Kanata config) that AutoHotkey can then send to the OS.
kanata_passthru.dll, then the simulated_passthru_ahk folder with a brief example, place the dll there, open kanata_passthru.ahk to read what the example does and then double-click to launch it.
sha256 checksums
Sums
b2c695992094c8bcb0fad78ac70c1632dabb10c18bdd60a740c0020cafdaf032 kanata
52cce61f47f1267e7024b3588a4eb4f437688fc84a449ddcd20aa70079439744 kanata.exe
2015fdc16b63e3c23049ea539f90d050815fdf55e1ab207997a7b08f1d67e75b kanata.kbd
6381f88ac827f4a7be4bc732a5595b14b035a3f0ad0670ac8b58c228ac4272a8 kanata_cmd_allowed
5b6fd1081b29e9a800ce56402a0a4c4d2a3dccae115d2d3f0afa2af6e61a31e3 kanata_cmd_allowed.exe
bfaa8773e74e8d40e14768fa52c87ffef5d06049cd8c7ad44b5fcdc8095d5495 kanata_gui.exe
27720c7b8ef8c1d7616e04ee54aec79c48c2ba1b25b6637a1147052efd0e0bd1 kanata_gui_cmd_allowed.exe
86487a1d480525e90c12cda865cdfb7ff6770469868f4af4a591a42b4724ee6f kanata_gui_wintercept.exe
a7b5b75e339b40d1cc33f92ba4f570bf875adb82214668385c663095554d7a65 kanata_gui_wintercept_cmd_allowed.exe
859e1d9e4f5de89b85a6e861a1a008d29909de9a24fa0ade0821bd475ca07eed kanata_legacy_output.exe
f02702fdbf962586058cca2662e45d66a6237489982c5060eafbffa44f0d2e5e kanata_macos_arm64
32f10eed179a896d667b9c1ba08c08b2177655759d9582284005ece2a408bbde kanata_macos_cmd_allowed_arm64
7e7c19d5b4230f3693c9f551d968afae64f5c3355c1413347ccd29fe9b6a50de kanata_macos_cmd_allowed_x86_64
f0c2592bca26cd8c7f7a71cbe3f2dc13b4fe0c4f946dead7d39fc83cfaeaf1ac kanata_macos_x86_64
4f11b97d6d9907a2678e0280a058d4161b61deada4fe92064330fb275539b4c6 kanata_winIOv2.exe
120d8977e949ca5f9e374632235f0ff158d224386324f8595b5c63923fc1c9ec kanata_wintercept.exe
d6ea193ee0e76f1fd44ea2f95f8aaa1263813f765a4001569bacf226335033c3 kanata_wintercept_cmd_allowed.exe