Skip to content

v1.6.0-prerelease-4

Pre-release
Pre-release
Compare
Choose a tag to compare
@jtroo jtroo released this 15 Apr 05:27
· 177 commits to main since this release
7539fa6

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
4a96a0160a1f1af401521fd48d60c001306759fe4acb92dc1db7ed5c3e3a28bf  kanata_cmd_allowed.exe
74aa51cd279613753c47ecb10cd41a2322692d3cfb990b074c86f6eeec11f06e  kanata_macos_arm64
3da9bbfeb42bf38620a13ba4fee9fab9bea4f4684ff8858305c06015653d93d2  kanata_macos_cmd_allowed_arm64
01d538daa0ab9d707af8be3447ca4cdd56390b92337a263db0395fff418cab6d  kanata_macos_cmd_allowed_x86_64
cd096660f581ea36806bcd3fa0e1c873469e84460eaff0f429f54cf62b6b6668  kanata_macos_x86_64
cd103a1eab3db574223bf83b2cf7492c589053a5ee69b7e3afe34f8e7329b026  kanata_scancode_experimental.exe
6fee039fef4a34aff489b14d8c9bdc7e51d8767d969ceea87db67add5030789b  kanata_winIOv2.exe
8cf0289212e61fa871323721fa4524997c95b113b59c334e71f33f0cff218dac  kanata_wintercept.exe
b2710b845289119fafa52da95851f2e33d1e8094d99ae432974309ab888da5b4  kanata_wintercept_cmd_allowed.exe