Releases: jtroo/kanata
v1.7.0
Configuration guide
Link to the appropriate configuration guide version: guide link.
Known issue(s)
- Windows: keypad Enter (
kprt
) and potentially other keys in the extended scancode range do not output correctly with the defaultkanata.exe
binary. Use winiov2 instead.- Potential fix: #1321
Changelog (since v1.6.1)
BREAKING FIX: On Linux, mouse device auto-grabbing will happen only if mouse buttons are mapped in defsrc
. This is breaking if all of the following apply:
- you rely on auto-grabbing
- you use a mouse with keyboard actions for kanata-relevant actions
- your mouse isn't identified as also being a keyboard
- you do not have any mouse button defined in defsrc
BEHAVIOUR CHANGE: include
no longer errors on missing files.
Change log
Added: O-(...)
for any-order overlapping keys in sequences.
Added: conditional configuration using environment variables via (environment (name val) ...)
Added: allow double-quotes within strings by adding Rust-style strings r#"<content>"#
. Potentially breaking, but seems doubtful that anyone has a good reason to be doing this
Added: --log-layer-changes
flag to override false
configuration temporarily for testing
Added: parse numbers as a delay (unit milliseconds) for cmd-output-keys
Added: unmod can accept a modifier list as the first parameter to selectively undo only some modifiers
Added: option to eagerly release override output to help with some use cases
Added: cmd-log
Added: reverse-release-order
within multi
Added: base-layer
for switch logic
Added: alias-to-trigger-on-load
for defcfg
Added: allow-hardware-repeat
for defcfg
Added: --quiet
CLI argument to suppress warning and info logs
Added(Windows): capability to use Kanata as a library for AHK
Added(Windows): GUI tray app (gui variants of the executable)
Added(Windows): JIS key mappings
Added(Windows-Interception): add device exclusion (include by default) in defcfg
Added(Linux): linux-use-trackpoint-property
for middle mouse scrolling on ThinkPads
Added(Linux): linux-output-device-bus-type
for defcfg
Added(Linux): linux-device-detect-mode
for defcfg
Added(macOS): unicode
action is now implemented
Added(macOS): mouse actions are now implemented (some bugs still exist)
Fixed: chordsv2
now eagerly activates tap-hold-press|release
Fixed: chordsv2
preserves event release order
Fixed: chordsv2
configuration errors point to precise location
Fixed: chordsv2
configuration causes error on duplicate input keys where before it would silently overwrite earlier configurations
Fixed: one-shot
activations from within chordsv2
are preserved
Fixed: keep other macros around when another macro
completes
Fixed: swap incorrect unmod
with custom mod keys for alt/meta
Fixed: block-unmapped-keys
now only blocks unspecified actions, where before it would block explicitly transparent keys as well
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 Linux 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.
The gui variants only use the winiov2 I/O mechanism.
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 Windows binaries are compiled for x86-64 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.
For macOS 11 and newer:
- Install the Karabiner VirtualHiDDevice Driver.
To activate it:
/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate
For macOS 10 and older:
- Install the Karabiner kernel extension.
After installing the appropriate driver for your OS
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>`
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
Explanation and instructions
The Windows 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.
To make use of this, download kanata_passthru.dll
, then the simulated_passthru_ahk folder with a brief example, place the dll there, open `...
v1.7.0-prerelease-2
Configuration guide
Link to the appropriate configuration guide version: guide link.
Changelog (since v1.6.1)
BREAKING FIX: On Linux, mouse device auto-grabbing will happen only if mouse buttons are mapped in defsrc
. This is breaking if all of the following apply:
- you rely on auto-grabbing
- you use a mouse with keyboard actions for kanata-relevant actions
- your mouse isn't identified as also being a keyboard
- you do not have any mouse button defined in defsrc
Change log
Added: O-(...)
for any-order overlapping keys in sequences.
Added: conditional configuration using environment variables via (environment (name val) ...)
Added: allow double-quotes within strings by adding Rust-style strings r#"<content>"#
. Potentially breaking, but seems doubtful that anyone has a good reason to be doing this
Added: --log-layer-changes
flag to override false
configuration temporarily for testing
Added: parse numbers as a delay (unit milliseconds) for cmd-output-keys
Added: unmod can accept a modifier list as the first parameter to selectively undo only some modifiers
Added: option to eagerly release override output to help with some use cases
Added: cmd-log
Added: reverse-release-order
within multi
Added: base-layer
for switch logic
Added: alias-to-trigger-on-load
for defcfg
Added: allow-hardware-repeat
for defcfg
Added: --quiet
CLI argument to suppress warning and info logs
Added(Windows): capability to use Kanata as a library for AHK
Added(Windows): GUI tray app (gui variants of the executable)
Added(Windows): JIS key mappings
Added(Windows-Interception): add device exclusion (include by default) in defcfg
Added(Linux): linux-use-trackpoint-property
for middle mouse scrolling on ThinkPads
Added(Linux): linux-output-device-bus-type
for defcfg
Added(Linux): linux-device-detect-mode
for defcfg
Added(macOS): unicode
action is now implemented
Added(macOS): mouse actions are now implemented (some bugs still exist)
Fixed: chordsv2
now eagerly activates tap-hold-press|release
Fixed: chordsv2
preserves event release order
Fixed: chordsv2
configuration errors point to precise location
Fixed: chordsv2
configuration causes error on duplicate input keys where before it would silently overwrite earlier configurations
Fixed: one-shot
activations from within chordsv2
are preserved
Fixed: keep other macros around when another macro
completes
Fixed: swap incorrect unmod
with custom mod keys for alt/meta
Fixed: block-unmapped-keys
now only blocks unspecified actions, where before it would block explicitly transparent keys as well
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 Linux 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.
The gui variants only use the winiov2 I/O mechanism.
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 Windows binaries are compiled for x86-64 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.
For macOS 11 and newer:
- Install the Karabiner VirtualHiDDevice Driver.
To activate it:
/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate
For macOS 10 and older:
- Install the Karabiner kernel extension.
After installing the appropriate driver for your OS
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>`
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
Explanation and instructions
The Windows 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.
To make use of this, download 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
3f7223f37f86bc86872284a15f9efb4ae35a96073efd7986f106e1612bc5c65d kanata
022bd3ab22d40a909cb9bde6a9e44b2cd981e22876efcfa29ebbcf89aa41b883 kanata.ex...
v1.7.0-prerelease-1
Configuration guide
Link to the appropriate configuration guide version: guide link.
Changelog (since v1.6.1)
Change log
Added: O-(...)
for any-order overlapping keys in sequences.
Added: conditional configuration using environment variables via (environment (name val) ...)
Added: allow double-quotes within strings by adding Rust-style strings r#"<content>"#
. Potentially breaking, but seems doubtful that anyone has a good reason to be doing this
Added: --log-layer-changes
flag to override false
configuration temporarily for testing
Added: parse numbers as a delay (unit milliseconds) for cmd-output-keys
Added: unmod can accept a modifier list as the first parameter to selectively undo only some modifiers
Added: option to eagerly release override output to help with some use cases
Added(Windows): capability to use Kanata as a library for AHK
Added(Windows): GUI tray app (gui variants of the executable)
Added(Windows-Interception): add device exclusion (include by default) in defcfg
Added(Linux): linux-use-trackpoint-property
for middle mouse scrolling on ThinkPads
Added(macOS): unicode
action is now implemented
Added(macOS): mouse actions are now implemented (some bugs still exist)
Fixed: chordsv2
now eagerly activates tap-hold-press|release
Fixed: block-unmapped-keys
now only blocks unspecified actions, where before it would block explicitly transparent keys as well
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 Linux 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.
The gui variants only use the winiov2 I/O mechanism.
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 Windows 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.
For macOS 11 and newer:
- Install the Karabiner VirtualHiDDevice Driver.
To activate it:
/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate
For macOS 10 and older:
- Install the Karabiner kernel extension.
After installing the appropriate driver for your OS
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>`
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 assets from the linked website 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, including administrator-privileged apps.
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
Explanation and instructions
The Windows 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.
To make use of this, download 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
5d3245e092e5b4f0d42669cbe666210bccbfcc11fe700f8d3b3e0c475aef3cfd kanata
fb58bbdc83f151199a0a990657f403baf08ddda532f1fe552f4e37db88671e8b kanata.exe
f7e1543ffb7c2a610c60822b753d78c29e0ac501806ea3aba5192cecac02cb25 kanata.kbd
f290678681e91688a4ee662bdd3f3f03ccf7ba54e9b9683ffe0e96ab49cbe000 kanata_cmd_allowed
09c9119d8cd3df67a47cb040028977e26ba938572128eb1b2887baf0ed9f9d76 kanata_cmd_allowed.exe
36857288e9df2227b4378013998af64a0241a6f50d99a514cb8fe9be70fd5914 kanata_gui.exe
3669ebde601388cd2bcb3e9389be0c00b283520cad457211023e87854426dfa1 kanata_gui_cmd_allowed.exe
3669ebde601388cd2bcb3e9389be0c00b283520cad457211023e87854426dfa1 kanata_gui_wintercept.exe
b1acef7457be03e0143a3d8f5cfb0c43a63eb79ee20338a7ccdde33b96633316 kanata_gui_wintercept_cmd_allowed.exe
3c7ee427208886c7269cc1483abf363b3ce09f9105b5579fe59ba3416d997360 kanata_legacy_output.exe
cb7643f72801f124935692fd7b632a0df904a1c07e27f1188605048862ebdd23 kanata_macos_arm64
5509b1bf491287408e903fc729f6d3ad03643997f2b1ebdf088857aa098920b0 kanata_macos_cmd_allowed_arm64
c8345c43d2304ba8b9af1b5e7b8c2187705329532d02aa43611f8ecfca8d6288 kanata_macos_cmd_allowed_x86_64
69ad95857db5d33ec3170f4ad0acf535dea9e340e1962979ab2368a77e603360 kanata_macos_x86_64
33144159cef3b8d4e2a45d3b9ce58c763bf188f8ca6b86029dfbfea9d2dabbce ka...
v1.6.1
Configuration guide
Link to the appropriate configuration guide version: guide link.
Changelog (since v1.6.0)
- Fixed: some major issues with
defchordsv2-experimental
usability - Fixed: key repeat now works again for transparent/unmapped-but-processed keys in Windows and Linux TTY (macOS unknown if affected).
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 binaries are 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_scancode_experimental.exe
variant has the same input defsrc
handling as the standard kanata.exe
file but contains a change for an issue where kanata outputs are not handled correctly by some applications. This has not yet been extensively tested but the hope is that it is a strict improvement in scenarios where kanata operates correctly.
Linux
Instructions
NOTE: All Windows 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.
For macOS 11 and newer:
- Install the Karabiner VirtualHiDDevice Driver.
To activate it:
/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate
For macOS 10 and older:
- Install the Karabiner kernel extension.
After installing the appropriate driver for your OS
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>`
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 assets from the linked website 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, including administrator-privileged apps.
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
sha256 checksums
Sums
fd04643bf21f4cd0f805b31b5ef512e63251b815bae24ae4dc1839475c7de8fd kanata
27744c112a316e5d7efd0e90876f928f9900bae10a91cbb34fba303cbaffb762 kanata.exe
75619c377a5609f4d1426d9f316fde1cd6a3f48b9950269823485401f833f22e kanata.kbd
065c9abca2e3dc8c01956c2b11115f75a846c4e2cf13e693c2455c6e46508029 kanata_cmd_allowed
057eb7bf857b432671b30115cacf47757a37ac1ef588681ee5dd13ebbea2c77e kanata_cmd_allowed.exe
ea060822daa70c02a34c2b2ea85f35aa6bda62960b2798a97ad2a8ee55ef47f6 kanata_macos_arm64
492cb7b4eea7f1b43c33b6c82b9ca30bb3b4923843efe1fe7237039ec7491a60 kanata_macos_cmd_allowed_arm64
93065d246b1c302df3b98ae53827f2f182224181aa221f86debfd0b54fa63811 kanata_macos_cmd_allowed_x86_64
d99be3c45ca7772f6bb4c3918e279154797f51386d1a89dc5adffdff2c8b9b03 kanata_macos_x86_64
94f5f28d760bdd1022c45ec51b800975daf9523a868de0fbcab61d5171264553 kanata_scancode_experimental.exe
914f82fef1dd5ade6c823bbc44da6231c40fd3c4df6eb7db27e7a7209256586d kanata_winIOv2.exe
4bfe84d0275b82febf5e3f05879beeee743ba304f4a6f51c7fd406587a2a3e75 kanata_wintercept.exe
15d892ae23b80dd211dc1baf3462c45a2f651c456449f91c70fd9280cc03839e kanata_wintercept_cmd_allowed.exe
v1.6.1-prerelease-1
Configuration guide
Link to the appropriate configuration guide version: guide link.
Changelog (since v1.6.0)
- Fixed: some major issues with
defchordsv2-experimental
usability - Fixed: key repeat now works again for transparent/unmapped-but-processed keys in Windows and Linux TTY (macOS unknown if affected).
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 binaries are 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_scancode_experimental.exe
variant has the same input defsrc
handling as the standard kanata.exe
file but contains a change for an issue where kanata outputs are not handled correctly by some applications. This has not yet been extensively tested but the hope is that it is a strict improvement in scenarios where kanata operates correctly.
Linux
Instructions
NOTE: All Windows 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.
For macOS 11 and newer:
- Install the Karabiner VirtualHiDDevice Driver.
To activate it:
/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate
For macOS 10 and older:
- Install the Karabiner kernel extension.
After installing the appropriate driver for your OS
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>`
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 assets from the linked website 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, including administrator-privileged apps.
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
sha256 checksums
Sums
50f909e882703cb121b8dd038bc561e588a1793f0585b62bd4dd50bfbd816f1c kanata
ea4908d41f191beb7a43ab212f000e501910b301b76b0222fe480fb29c94b6bc kanata.exe
75619c377a5609f4d1426d9f316fde1cd6a3f48b9950269823485401f833f22e kanata.kbd
a7cba50a4ccc0bc7e48ff5fdbd04e5e429ae40819f8b677b92b0cf4d8e1e3d28 kanata_cmd_allowed
c3ab7f7ecf4244304cd9ca84b88de23d497a75e0bd97ee913f4c9a3f986f3145 kanata_cmd_allowed.exe
f343aee021901716f63ee9089a8e4fcda1d42ba505e8a5cb3372de781ba381dc kanata_macos_arm64
54693decc2a0640c42ec321b36ad38e6e6473effc51aea6a08d7a90b09df1130 kanata_macos_cmd_allowed_arm64
4964e5cb9bdda99d357bf5be19439f4f2de1892a543918b54d51feff32428fd5 kanata_macos_cmd_allowed_x86_64
2c397c591f12c8081feb3e36798f527d7f35ab4b9499ff8b9db44ad4804e0337 kanata_macos_x86_64
43f095428c7305b5edd745885f8fc9846cf6aec9456517439672eea45e4b613f kanata_scancode_experimental.exe
de641bb24cfe4572d67498bdd0ca8c999c504e3b95556b1c477623a12a0caff9 kanata_winIOv2.exe
54c35a78c532aad8dd7490e79d612d343f0edde36c95a101696e9cf90c9cd159 kanata_wintercept.exe
0c309d0229004ca24e3629f2169eef0f8d4c2d6df4f3c2b25b1f47ed60ba32ab kanata_wintercept_cmd_allowed.exe
v1.6.0
Configuration guide
Link to the appropriate configuration guide version: guide link.
Known issues
- Some major issues with
defchordsv2-experimental
usability- Fixed in
main
and inv1.6.1-prerelease-1
- Fixed in
- Key repeat stopped working for transparent/unmapped-but-processed keys in Windows and Linux TTY (macOS unknown if affected)
- Fixed in
main
and inv1.6.1-prerelease-1
- Fixed in
Changelog (since v1.5.0)
BREAKING FIX: dynamic-macro
now records and simulates delays by default to reproduce tap-hold effects correctly. It can be turned off via an undocumented defcfg entry.
BREAKING FIX: TCP server messages now emit newline terminators for easier message differentiation.
BREAKING FIX: Add concat
keyword for defvar that enables appending strings together. This will only break you if you happened to use concat as the very first string in a list value in defvar, which seems unlikely.
BREAKING FIX: Input chord release behaviour has been improved but might affect existing workflows
BREAKING FIX: TCP server now only listens to localhost by default. This can be opted out of by specifying the server address (originally it was 0.0.0.0
) as part of the -p
command line argument.
BREAKING CHANGE: Transparent key behaviour now checks all active layers by default, as opposed to the old behaviour where it would only go to the base layer. This change can be opted out of by adding transparent-key-resolution to-base-layer
to defcfg
.
Change log
- Added:
deflayermap
- an alternate way to define layers that may be more preferable to some - Added:
concurrent-tap-hold
to defcfg, allowing tap-hold actions to time out in parallel - Added:
--check
argument to verify config file without starting kanata - Added:
lrld-num
action, allowing live reloading a specific config argument position - Added:
block-unmapped-keys
to defcfg - Added:
rapid-event-delay
as a mitigation around desktop environments incorrectly handling some rapid events - Added: template definition and expansion for reducing boilerplate
- Added: more switch logic (
not
,key-timing
,input
,input-history
) - Added:
lrld-file
action - Added: improved wording + syntax of fake key operations, changing name from fake to virtual
- Added: more TCP client requests and server events
- Added:
platform
top-level configuration item to conditionally use configurations depending on the running platform - Added: experimental V2 of chords, which is a global configuration and is a separate system from existing actions
- Added: maximum layers is increased from 25 to 60000
- Added: special
nopX
keys that can be used for sequences,fork
, andswitch
- Added (Windows): binary now has a manifest that can be manipulated to allow LLHOOK-based binaries to operate in administrator-privileged windows
- Added (Windows winIOv2): added
deflocalkeys-winiov2
variant - Added (Windows Interception):
windows-interception-keyboard-hwids
to specify specific keyboards to intercept - Added (Windows Interception):
windows-interception-mouse-hwids
to specify multiple mice to intercept - Added (macOS): kext support for macOS version 10
- Fixed: input chord key association for presses/releases
- Fixed: input chords resulting in multiple tap-holds can now activate both holds
- Fixed: permit optional UTF8 BOM at the beginning of a configuration file
- Fixed: allow all symbols to be overridden in
deflocalkeys
- Fixed: right-hand modifiers are released properly for visible-backspaced sequences
- Fixed: mouse buttons and wheel actions are now forwarded correctly with
process-unmapped-keys yes
, without explicit definition of mouse buttons, while grabbing the mouse - Fixed (Linux): exit on
SIGTSTP
to prevent locking out users from using the keyboard - Fixed (Windows LLHOOK): reduced blast radius of lsft workaround (properly this time)
- Fixed (Windows LLHOOK): handling of locking via Win+L works correctly
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 binaries are 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_scancode_experimental.exe
variant has the same input defsrc
handling as the standard kanata.exe
file but contains a change for an issue where kanata outputs are not handled correctly by some applications. This has not yet been extensively tested but the hope is that it is a strict improvement in scenarios where kanata operates correctly.
Linux
Instructions
NOTE: All Windows 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.
For macOS 11 and newer:
- Install the Karabiner VirtualHiDDevice Driver.
To activate it:
/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate
For macOS 10 and older:
- Install the Karabiner kernel extension.
After installing the appropriate driver for your OS
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>`
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 assets from the linked website 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, including administrator-privileged apps.
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
kanat...
v1.6.0-prerelease-4
Configuration guide
Link to the appropriate configuration guide version: guide link.
Notable changes since earlier v1.6.0 prereleases
BREAKING CHANGE: deflayermap
no longer uses the mapping string - it now uses configuration pairs similar items like defvar
and defalias
, instead of triples.
Known Issue(s): =
cannot be used in deflayermap
. Fixed in latest main. Workarounds in this version: use eql
or Equal
.
Changelog (since v1.5.0)
BREAKING FIX: dynamic-macro
now records and simulates delays by default to reproduce tap-hold effects correctly. It can be turned off via an undocumented defcfg entry.
BREAKING FIX: TCP server messages now emit newline terminators for easier message differentiation.
BREAKING FIX: Add concat
keyword for defvar that enables appending strings together. This will only break you if you happened to use concat as the very first string in a list value in defvar, which seems unlikely.
BREAKING FIX: Input chord release behaviour has been improved but might affect existing workflows
BREAKING FIX: TCP server now only listens to localhost by default. This can be opted out of by specifying the server address (originally it was 0.0.0.0
) as part of the -p
command line argument.
BREAKING CHANGE: Transparent key behaviour now checks all active layers by default, as opposed to the old behaviour where it would only go to the base layer. This change can be opted out of by adding transparent-key-resolution to-base-layer
to defcfg
.
Change log
- Added:
deflayermap
- an alternate way to define layers that may be more preferable to some - Added:
concurrent-tap-hold
to defcfg, allowing tap-hold actions to time out in parallel - Added:
--check
argument to verify config file without starting kanata - Added:
lrld-num
action, allowing live reloading a specific config argument position - Added:
block-unmapped-keys
to defcfg - Added:
rapid-event-delay
as a mitigation around desktop environments incorrectly handling some rapid events - Added: template definition and expansion for reducing boilerplate
- Added: more switch logic (
not
,key-timing
,input
,input-history
) - Added:
lrld-file
action - Added: improved wording + syntax of fake key operations, changing name from fake to virtual
- Added: more TCP client requests and server events
- Added:
platform
top-level configuration item to conditionally use configurations depending on the running platform - Added: experimental V2 of chords, which is a global configuration and is a separate system from existing actions
- Added: maximum layers is increased from 25 to 30000
- Added(Windows winIOv2): added
deflocalkeys-winiov2
variant - Added (Windows Interception):
windows-interception-keyboard-hwids
to specify specific keyboards to intercept - Added (Windows Interception):
windows-interception-mouse-hwids
to specify multiple mice to intercept - Added (macOS): kext support for macOS version 10
- Fixed: input chord key association for presses/releases
- Fixed: input chords resulting in multiple tap-holds can now activate both holds
- Fixed: permit optional UTF8 BOM at the beginning of a configuration file
- Fixed: allow all symbols to be overridden in
deflocalkeys
- Fixed (Linux): exit on
SIGTSTP
to prevent locking out users from using the keyboard - Fixed (Windows LLHOOK): reduced blast radius of lsft workaround (properly this time)
- Fixed (Windows LLHOOK): handling of locking via Win+L works correctly
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 binaries are 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 and want kanata to handle the key positions consistently
This variant contains the same change as in the scancode
variant below, and also changes the input to also handle scancodes instead of only the output.
NOTE: The kanata_scancode_experimental.exe
variant has the same defsrc
handling as the standard kanata.exe
file but contains a change for an issue where kanata outputs are not handled correctly by some applications. This has not yet been extensively tested but the hope is that it is a strict improvement in scenarios where kanata operates correctly.
Linux
Instructions
NOTE: All Windows 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
For macOS 11 and newer:
- Install the Karabiner VirtualHiDDevice Driver.
To activate it:
/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate
For macOS 10 and older:
- Install the Karabiner kernel extension.
After installing the appropriate driver for your OS
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>`
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 assets from the linked website 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, including administrator-privileged apps.
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
sha256 checksums
Sums
2fda915d56c962f74adb605ff11c64631722c2c7783d5fe9bffd0d3378ee8937 kanata
9f9e30516acb1ce56219f0e34e75aab4b6960a63534435435704dec2c97d10eb kanata.exe
2a9b66957103c769baa9b0154dfac685ae30f79bf4e1224b9ed183be46b89db0 kanata.kbd
0befc6648a5a816699a33ad15208424108544e214dc439d9e72aa12b347a428f kanata_cmd_allowed
4a96a016...
Windows key code tester v0.3.0
Binaries to help test Windows keycodes without having to have a kanata config. Simply run the program and see the logs.
Notes for interception variant:
Running the binary has the same requirements as kanata. See the wintercept variants of the kanata release.
v1.6.0-prerelease-3
Configuration guide
Link to the appropriate configuration guide version: guide link.
Notable changes since prerelease-2
BREAKING CHANGE: deflayer-custom-map
is renamed to deflayermap
Fix: kanata_winIOv2.exe
now handles arrow keys and other "extended scancode" keys correctly at the input side.
Changelog (since v1.5.0)
BREAKING FIX: dynamic-macro
now records and simulates delays by default to reproduce tap-hold effects correctly. It can be turned off via an undocumented defcfg entry.
BREAKING FIX: TCP server messages now emit newline terminators for easier message differentiation.
BREAKING FIX: Add concat
keyword for defvar that enables appending strings together. This will only break you if you happened to use concat as the very first string in a list value in defvar, which seems unlikely.
BREAKING FIX: Input chord release behaviour has been improved but might affect existing workflows
BREAKING CHANGE: Add web event.code names as usable configuration key names, making them no longer usable in deflocalkeys
.
Change log
- Added:
deflayermap
- an alternate way to define layers that may be more preferable to some - Added:
concurrent-tap-hold
to defcfg, allowing tap-hold actions to time out in parallel - Added:
--check
argument to verify config file without starting kanata - Added:
lrld-num
action, allowing live reloading a specific config argument position - Added:
block-unmapped-keys
to defcfg - Added:
rapid-event-delay
as a mitigation around desktop environments incorrectly handling some rapid events - Added: template definition and expansion for reducing boilerplate
- Added: more switch logic (
not
,key-timing
,input
,input-history
) - Added:
lrld-file
action - Added: improved wording + syntax of fake key operations, changing name from fake to virtual
- Added: more TCP client requests and server events
- Added (Windows Interception):
windows-interception-keyboard-hwids
to specify specific keyboards to intercept - Added (Windows Interception):
windows-interception-mouse-hwids
to specify multiple mice to intercept - Added (macOS): kext support for macOS version 10
- Fixed: input chord key association for presses/releases
- Fixed: input chords resulting in multiple tap-holds can now activate both holds
- Fixed (Linux): exit on
SIGTSTP
to prevent locking out users from using the keyboard - Fixed (Windows LLHOOK): reduced blast radius of lsft workaround (properly this time)
- Fixed (Windows LLHOOK): handling of locking via Win+L works correctly
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 binaries are for x86 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 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 and want kanata to handle the key positions consistently
Known issues:
deflocalkeys-win
does not work properly for this variant. It needs a different variant (or use the values you would use for deflocalkeys-wintercept.
NOTE: The kanata_scancode_experimental.exe
variant has the same defsrc
handling as the standard kanata.exe
file but contains a change for an issue where kanata outputs are not handled correctly by some applications. This has not yet been extensively tested but the hope is that it is a strict improvement in scenarios where kanata operates correctly.
Linux
Instructions
NOTE: All binaries are 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
WARNING: the provided binaries are only for x86 devices. If you are using ARM macs, e.g. M1/M2, you must compile kanata yourself
For macOS 11 and newer:
- Install the Karabiner VirtualHiDDevice Driver.
To activate it:
/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate
For macOS 10 and older:
- Install the Karabiner kernel extension.
After installing the appropriate driver for your OS
Download kanata_macos
.
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.
chmod +x kanata_macos # may be downloaded without executable permissions
sudo ./kanata_macos --cfg <cfg_file>`
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 assets from the linked website 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, including administrator-privileged apps.
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
sha256 checksums
Sums
a26bb1bc8f30c407c16e96dd8010549f11e7fd340f5949ab4ca9f23841c61e3f kanata
bd862b85a66fbd59c7de3183e16393fed1bd0a76c1cf76621259286248108cda kanata.exe
989e64c5ba85f2930ba3e4b4bcac54c93412466529b7cc7de5c6bd3f299414f7 kanata.kbd
b78229867c90a05a0c214b018ed65044087b4ea4b702c33700e0afe2c0ee3f2d kanata_cmd_allowed
aff4b2f1ea4169a2ee1294f99129fe7a09c911e853c88a41acca13c43c68ebe2 kanata_cmd_allowed.exe
3f03620db1480af4aee3035a8daf1f152bf88ada43d2ff3f5b8cd2caf5005b55 kanata_macos_cmd_allowed_x86
2002e97124f10542d3907a37d82ab94acc760c1080e931555e9410c3c8e06fbe kanata_macos_x86
c053e0c278f90dc0bcf925cf69c9c1c8023ed6d4c6332b6ba8722ad3536132c2 kanata_scancode_experimental.exe
59041479ba1a2e5440ae9dd9904d31bf0097f30f7c4bc190167ea9b8d628dc58 kanata_winIOv2.exe
a2941cf08f6cb885bd96343eb16ec0f62c6c63e2093a62221ef66e660e7b97b8 kanata_wintercept.exe
ef4b3071a54ecab324b5890569adc01a6c4f03aff5f7cb88ad6dd5a8b0a9b9fb kanata_wintercept_cmd_allowed.exe
v1.6.0-prerelease-2
Configuration guide
Link to the appropriate configuration guide version: guide link.
Changelog (since v1.5.0)
BREAKING FIX: dynamic-macro
now records and simulates delays by default to reproduce tap-hold effects correctly. It can be turned off via an undocumented defcfg entry.
BREAKING FIX: TCP server messages now emit newline terminators for easier message differentiation.
BREAKING FIX: Add concat
keyword for defvar that enables appending strings together. This will only break you if you happened to use concat as the very first string in a list value in defvar, which seems unlikely.
BREAKING FIX: Chord release behaviour has been improved but might affect existing workflows
BREAKING CHANGE: Add web event.code names as usable configuration key names, making them no longer usable in deflocalkeys
.
Change log
- Added:
concurrent-tap-hold
to defcfg, allowing tap-hold actions to time out in parallel - Added:
--check
argument to verify config file without starting kanata - Added:
lrld-num
action, allowing live reloading a specific config argument position - Added:
block-unmapped-keys
to defcfg - Added:
rapid-event-delay
as a mitigation around desktop environments incorrectly handling some rapid events - Added: template definition and expansion for reducing boilerplate
- Added: more switch logic (
not
,key-timing
,input
,input-history
) - Added:
lrld-file
action - Added: improved wording + syntax of fake key operations, changing name from fake to virtual
- Added: more TCP client requests and server events
- Added (Windows Interception):
windows-interception-keyboard-hwids
to specify specific keyboards to intercept - Added (Windows Interception):
windows-interception-mouse-hwids
to specify multiple mice to intercept - Added (macOS): kext support for macOS version 10
- Fixed: chord key association for presses/releases
- Fixed: chords resulting in multiple tap-holds can now activate both holds
- Fixed (Linux): exit on
SIGTSTP
to prevent locking out users from using the keyboard - Fixed (Windows LLHOOK): reduced blast radius of lsft workaround (properly this time)
- Fixed (Windows LLHOOK): handling of locking via Win+L works correctly
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
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. This 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 and want kanata to handle the key positions consistently
Known issues:
deflocalkeys-win
does not work properly for this variant. It needs a different variant (or use the values you would use fordeflocalkeys-wintercept
NOTE: The kanata_scancode_experimental.exe
variant has the same defsrc
handling as the standard kanata.exe
file but contains an change for an issue where kanata outputs are not handled correctly by some applications. This has not yet been extensively tested but the hope is that it is a strict improvement in scenarios where kanata operates correctly.
Linux
Instructions
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
WARNING: the provided binaries are only for x86 devices. If you are using ARM macs, e.g. M1/M2, you must compile kanata yourself
For macOS 11 and newer:
- Install the Karabiner VirtualHiDDevice Driver.
To activate it:
/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate
For macOS 10 and older:
- Install the Karabiner kernel extension.
After installing the appropriate driver for your OS
Download kanata_macos
.
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.
chmod +x kanata_macos # may be downloaded without executable permissions
sudo ./kanata_macos --cfg <cfg_file>`
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 assets from the linked website 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, including administrator-privileged apps.
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
sha256 checksums
Sums
71998c18425b94359b12dc3e406654aa50dc9f79bf40c4a3c082ccbfbfbe7b28 kanata
1fdfe418c41f516507df3498929a28e4b0eece97f02071701a5f318fd28fb1bc kanata.exe
0eaf5b61bf8357e238bdf80980e77e2639c0957cd66d5eaef327a6da11d27952 kanata.kbd
7d814cff7cda4692ebf3268e810c1ef668bae4bd345d90acea6fc1dac5b48cd1 kanata_cmd_allowed
5592cf8228fd9048c84b8e55c9f41756d90d5a11ed74fee403bdf44448d8a481 kanata_cmd_allowed.exe
35a99fe7aee6376252b29e5104b4fddc70e1c0ddf050c1365e8feb3b472aa089 kanata_macos_x86
348fc51b49b2aee23e6513013295a2ba5b409d821ca5435e186092d2a87218aa kanata_macos_cmd_allowed_x86
9e7fa0400fcfc7495bfd69161deb08995f68b0fcf8eda4c261e0346233d3674d kanata_scancode_experimental.exe
6a7fbab1d43be8ba1fd97b92832f5c9760bbcf0ae56b192f4246640e21f14a28 kanata_winIOv2.exe
1ffe166b019ceb7f1f74a562886016a891682be44d93320ab8f1fd111b989b60 kanata_wintercept.exe
43c7d52d31703371171ff1a19955bc22f21b394282b67f90fab8ea13f5590e7a kanata_wintercept_cmd_allowed.exe