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?