This Keyboard Tool is BETTER Than Karabiner (Here's Why)

BBetter Stack
컴퓨터/소프트웨어게임/e스포츠가전제품/카메라

Transcript

00:00:00This is Kanata, an open-source tool that maximises your keyboard's potential
00:00:03by doing things like registering a different key when it's tapped versus when it's held,
00:00:08using one key to trigger multiple key presses,
00:00:10or having different layers for different custom key mappings.
00:00:12Which is great for someone like me who tries their best to mainly use the keyboard.
00:00:16But what's with the weird configuration syntax?
00:00:19And why would I use this instead of carabiner or another tool that begins with K?
00:00:24Hit subscribe and let's get into it.
00:00:27Kanata is the indigenous Iroquois name for village,
00:00:30which has nothing to do with keyboards at all.
00:00:33But if you're into mechanical keyboards like me, you may have heard of QMK,
00:00:37a popular open-source keyboard firmware,
00:00:39which allows you to remap keys on the keyboard before it's sent to your machine.
00:00:42Kanata is like QMK but works on the software level,
00:00:46so it supports all keyboards, even the one for your laptop.
00:00:49And because it's written in rough, this means it's fast
00:00:52and there isn't really much of a delay when typing on your keyboard.
00:00:55But it's not that straightforward to set up,
00:00:57because after installing Kanata with carabiner for Mac,
00:01:00I'll talk more about that later,
00:01:02you need to write a configuration file using this S expression syntax inspired by Lisp,
00:01:07which is the weirdest configuration syntax I have ever seen.
00:01:11Because instead of writing a function name outside of the parentheses as you'd expect,
00:01:16for this configuration file, you write it inside the parentheses right next to the arguments.
00:01:21But things get even weirder when you start nesting functions,
00:01:24which is quite common in the configuration,
00:01:26because instead of having these function names outside of parentheses,
00:01:30everything is inside, making it look a bit difficult to understand at first.
00:01:35But you get used to it after a while.
00:01:36So as a simple keymap example, let's say I wanted the A key to map to X.
00:01:41I can do this with a def source function to specify source keys with an argument of A,
00:01:46and at least one def layer function to specify the output keys,
00:01:50I'll give this a name of base and an argument of X.
00:01:53Any key that isn't listed in the configuration file behaves as normal.
00:01:57So adding more keys like B and C and mapping them to X and Z looks like this.
00:02:02Luckily, white spaces and tabs are insignificant,
00:02:04so you can space out the keys to make them as readable as you want.
00:02:08A few more cool things you can do with this configuration file.
00:02:10I could configure tap hold, so tapping onto it does one action and holding does another,
00:02:15with a tap hold timeout and then add the keys I want it to map to.
00:02:19So in this case, tapping A will register X and holding onto it will register left shift.
00:02:24To make things easier, I could add a def var function to register some variables
00:02:28I use multiple times in the configuration and reference them with a dollar sign,
00:02:32which is perfect for home row mods matching the home keys to the four common modifiers.
00:02:36To be honest, this seems really weird at first,
00:02:39but I've really got used to it and I can't imagine using a keyboard any other way.
00:02:42I could also create a new def layer with a new name like editor
00:02:46and use it specifically for editing videos so I can give it a whole new set of key maps
00:02:51and switch to this layer by having a layer switch key.
00:02:54And if you want to do something really cool when it comes to switching layers or anything else,
00:02:58you could enable KONATA's TCP server so that other applications can listen to it.
00:03:03So in my case, I have SketchyBar listening to KONATA
00:03:06so that when I change layers, it displays at the top of my desktop.
00:03:10Yes, it did take writing a lot of configuration to get to this stage,
00:03:13but it's nothing AI can't help with.
00:03:16Anyway, as cool as this is, why would somebody use KONATA over Karabiner elements?
00:03:21Considering it can do everything KONATA can do and much more,
00:03:24like using application and keyboard specific key mappings,
00:03:28testing keys with a very intuitive event viewer,
00:03:30and it has a nice graphical interface for those who don't like running commands in the terminal.
00:03:35But for me, Karabiner's tap hold feature, so for home row mods, was severely lacking.
00:03:40It took a lot of research and a lot of configuration to get to the stage where I got it working.
00:03:45And even when I did get it working, it wasn't as intuitive as KONATA.
00:03:49It regularly registers holds as taps.
00:03:51KONATA, however, handled this feature perfectly out of the box without any tweaking,
00:03:56and I haven't felt the need to go back to Karabiner elements.
00:03:59So if you really want home row mods, I'd suggest using KONATA.
00:04:03But that doesn't mean it's perfect.
00:04:05You'll need multiple configuration files for different keyboards if you have different key maps,
00:04:09which is a bit annoying if you unplug a keyboard
00:04:12because you have to run a command to switch to that key mapping.
00:04:15I couldn't find a way to remap the play/pause button to F8 on my keyboard,
00:04:20which is something I was able to do with Karabiner.
00:04:22And it took a few tweaks to get KONATA working with the MX Master Mouse.
00:04:26Luckily, I've been able to vibe code solutions to most of these issues,
00:04:30which I may open source in the future.
00:04:31But I really wish KONATA had a bigger community,
00:04:34which this video could help do if more people share it with their friends and colleagues, right?

Key Takeaway

Kanata is a high-performance, software-level keyboard remapper that surpasses Karabiner Elements for power users who require reliable home row mods and deep layer customization via code.

Highlights

Kanata is an open-source

Timeline

Introduction to Kanata and Software-Level Customization

The speaker introduces Kanata as an open-source tool designed to maximize keyboard potential through features like tap-hold actions and custom layers. Unlike QMK firmware which is limited to specific mechanical keyboards, Kanata operates at the software level and supports any keyboard hardware. Because the tool is written in the Rust programming language, it offers high speed and minimal input latency for a seamless typing experience. This section establishes the value proposition for keyboard enthusiasts who want advanced functionality without needing specialized hardware. The speaker emphasizes that this tool is particularly useful for those who prefer to keep their hands on the keyboard as much as possible.

Understanding the S-Expression Configuration Syntax

This segment delves into the technical setup of Kanata, specifically focusing on its unique Lisp-inspired S-expression configuration syntax. The speaker describes this as the "weirdest configuration syntax" they have encountered because function names are placed inside parentheses alongside their arguments. This structure leads to deeply nested functions that can be difficult for beginners to read or understand at first glance. However, the speaker notes that while it looks intimidating, users generally become accustomed to the logic after a short period of use. This explanation provides necessary context for the learning curve associated with moving away from GUI-based tools.

Practical Mapping Examples and Advanced Features

The speaker demonstrates how to create a basic keymap using the 'def source' and 'def layer' functions to remap keys like A to X. Advanced features are showcased, including variables for home row mods and the creation of specialized layers for tasks like video editing. A significant technical highlight is the mention of Kanata's TCP server, which allows external applications to communicate with the keyboard state. The speaker uses this to trigger visual updates on their macOS SketchyBar whenever a layer changes, showing the tool's extensibility. Despite the complexity, the speaker suggests that modern AI tools can significantly assist in writing these detailed configuration files.

Kanata vs. Karabiner Elements: Pros and Cons

The final section compares Kanata directly to Karabiner Elements, acknowledging that Karabiner offers a more intuitive interface and better device-specific mapping. However, the speaker argues that Kanata is superior for 'home row mods' because Karabiner often misinterprets holds as taps, whereas Kanata works perfectly out of the box. Some drawbacks of Kanata are mentioned, such as the need for manual commands to switch profiles when swapping keyboards and issues remapping certain media keys. The speaker also notes minor compatibility hurdles with hardware like the MX Master Mouse that required custom coding solutions. Ultimately, the video concludes with a call to grow the Kanata community to help improve the ecosystem and support for the tool.

Community Posts

No posts yet. Be the first to write about this video!

Write about this video