Skip to content

Releases: jtroo/kanata

v1.7.0-prerelease-1

13 Jul 08:24
Compare
Choose a tag to compare
v1.7.0-prerelease-1 Pre-release
Pre-release

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:

To activate it:

/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate

For macOS 10 and older:

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...
Read more

v1.6.1

04 May 05:26
Compare
Choose a tag to compare

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:

To activate it:

/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate

For macOS 10 and older:

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

26 Apr 07:05
Compare
Choose a tag to compare
v1.6.1-prerelease-1 Pre-release
Pre-release

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:

To activate it:

/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate

For macOS 10 and older:

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

24 Apr 07:34
Compare
Choose a tag to compare

Configuration guide

Link to the appropriate configuration guide version: guide link.

Known issues

  • Some major issues with defchordsv2-experimental usability
    • Fixed in main and in v1.6.1-prerelease-1
  • Key repeat stopped working for transparent/unmapped-but-processed keys in Windows and Linux TTY (macOS unknown if affected)
    • Fixed in main and in v1.6.1-prerelease-1

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, and switch
  • 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:

To activate it:

/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate

For macOS 10 and older:

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...
Read more

v1.6.0-prerelease-4

15 Apr 05:27
7539fa6
Compare
Choose a tag to compare
v1.6.0-prerelease-4 Pre-release
Pre-release

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:

To activate it:

/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate

For macOS 10 and older:

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...
Read more

Windows key code tester v0.3.0

30 Mar 06:37
10c424a
Compare
Choose a tag to compare
Pre-release

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

29 Mar 16:43
Compare
Choose a tag to compare
v1.6.0-prerelease-3 Pre-release
Pre-release

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:

To activate it:

/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate

For macOS 10 and older:

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

25 Mar 22:59
Compare
Choose a tag to compare
v1.6.0-prerelease-2 Pre-release
Pre-release

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 for deflocalkeys-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:

To activate it:

/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate

For macOS 10 and older:

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

v1.6.0-prerelease-1

11 Feb 08:50
Compare
Choose a tag to compare
v1.6.0-prerelease-1 Pre-release
Pre-release

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.

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 (Windows Interception): windows-interception-keyboard-hwids to specify specific keyboards to intercept
  • Added (macOS): kext support for macOS version 10
  • Fixed (Linux): exit on SIGTSTP to prevent locking out users from using the keyboard

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_scancode_experimental.exe file contains a change for this issue where kanata does not operate correctly in 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. Testing would be helpful!

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:

To activate it:

/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate

For macOS 10 and older:

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
8d67e60b7a56dd1c2b67db1b7c100b01cdf3b0fd176be279809687d546ceeaac  kanata
e608f1930df2b6c7824b15bdb34fb0a9c14ebff964d179ca3fa5393b2a41f5b6  kanata.exe
6db41e5c10a7bda8956ea91662ce954612a0e980db88f51d778c476ef54d355c  kanata.kbd
0b04ee496b179a3799d348976c301a8d5682695ad5f5baeb235c2803285a6de7  kanata_cmd_allowed
ffdbaf8634378494b5a2a51de4477578fee2bdfd7c66713a622916089ed21718  kanata_cmd_allowed.exe
3f13241b5a5e13f7888085c8a1c1adccb1ef8c0009b3c4f794ceeedb53e93bf1  kanata_macos
8131d583e48dd2af0328a2e65a018c56848a289e40f078d97bbdcf10b2689de5  kanata_macos_cmd_allowed
a77ba4cc9d48b0fe0b670a01ad82d089cad7a97509001c25fb4d3cda858b1be7  kanata_scancode_experimental.exe
85a03298b21c588192d95458be1f2e098405618425788510f94f53caceb5032c  kanata_wintercept.exe
b188c600ff238559354d1245fc0eb682a9337b5a43eb3cc877013bb8c3b9ccb5  kanata_wintercept_cmd_allowed.exe

v1.5.0

22 Dec 06:33
Compare
Choose a tag to compare

Configuration guide

Link to the appropriate configuration guide version: guide link.

Changelog (since v1.4.0)

BREAKING FIX: change unicode yen key mapping to mean KEY_YEN instead of backslash.

BREAKING FIX: clear non-oneshot output chord (e.g. C-a) on next action.

BREAKING FIX: forcefully release all keys for a valid visible-backspaced sequence because modifiers can change the behaviour of backspace.

BREAKING FIX: add default (128) and configurable limit on dynamic macro recorded keys to protect users from forgetting to end and recording too many keys.

Change log
  • Added: on-idle-fakekey action
  • Added: toggle option for fake key actions
  • Added: error message improvement when list action isnot ina list
  • Added: movemouse-inherit-accel-state
  • Added: movemouse-smooth-diagonals
  • Added: mouse wheel events in defsrc for Linux and Interception
  • Added: unmod and unshift actions
  • Added: key-history in switch
  • Added: tap-hold-except-keys
  • Added (macOS): limited support
  • Added (Linux): allow list syntax to define devices
  • Fixed: avoid crash in an error case of macro parsing
  • Fixed: change unicode yen key mapping to mean KEY_YEN instead of backslash
  • Fixed: rpt-any works in more cases
  • Fixed: allow unmodded list in macro
  • Fixed (Windows-Interception): mbck/mfwd up/down were switched, making Windows behave strangely
  • Fixed (Windows-Interception): send/release Esc for OsCode with unknown mapping instead of crashing
  • Fixed (Linux): maybe-fixed an issue around high CPU and memory consumption due to the rustix dependency
  • Fixed (Linux): fixed issue related to touchpad disable

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>

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

First, install the Karabiner VirtualHiDDevice Driver.

To activate it:

/Applications/.Karabiner-VirtualHIDDevice-Manager.app/Contents/MacOS/Karabiner-VirtualHIDDevice-Manager activate

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
864cd50f07dbb183070f7b5186539732ba2b713630adad05f06499a5bfcd3e62  kanata
74b7a0c751507a9d0e2774337053ac7961cdd8a52aeb1be01a3698fddaf8b423  kanata.exe
aae72ccffc983b379615ce82d4fee0ada5a50acfe4a2660ffbee0a5b1a21fc62  kanata.kbd
405010049a11ce7ab1c030688c7b13ad982014c7e3c29c4de7ba9355e44da6ab  kanata_cmd_allowed
972703233fcd9a24180ae738dbcf1d5f27d571f45337eafae832fde8585e6bb0  kanata_cmd_allowed.exe
6ac269ef08748a12f8ad4726d18cc362164d2d427958bc0a2c24b4a8ac8d225b  kanata_macos_x86
eb722e05c464fabf3fd31c46efbe41d218e7b88764e861e19db84f31b1405b28  kanata_macos_cmd_allowed_x86
f32f73fefc4627d86361a6134dff7f1ea009606cfb99a6dc426260880d4b8261  kanata_wintercept.exe
f589c04a4e2bc7b0fe1176d57ad5b70b79991bbe1ce256cbbfd7a9c5682ab6db  kanata_wintercept_cmd_allowed.exe