YubiKey OTP, Dvorak input, Karabiner Elements, and Goku

Update:

Introduction

YubiKey 5 NFC
YubiKey 5 NFC on keychain

I use a YubiKey for 2FA. I also use the Dvorak keyboard layout on my desktop machines. The YubiKey OTP emulates a USB keyboard to input the OTP, which means its beholden to the system input layout. This means when you set up the key with Dvorak and try to use the YubiKey on a device whose input is set to QWERTY then the key won't work. This is an acute problem using it with NFC on a smartphone.

For macOS, which is my primary OS, there two good guides out there on remapping the relevant keys for the YubiKey device with Karabiner Elements:

Since I use GokuRakuJoudo to compile an EDN format Karabiner config for easier editing, I needed to rewrite the configuration for the right format.

Read more