Karabiner-Elements uses massive JSON config files to accomplish its complex mappings. To implement Extend, it takes 1200+ lines! That makes customizing or even seeing what its doing a tricky endeavor. We're all keyboard layout nerds, right? Customizing should be possible. Especially since some of the Extend choices are... questionable on a Mac (menu and insert, I'm looking at you... some of the mouse movement and the additional modifiers too).
Anyway, I wanted a way to generate my Extend config so that I could easily customize it. So, I have published a Python script that does just that. It lets you easily customize and generate a Karabiner-Elements Extend JSON file. The project is hosted here: https://github.com/mattmc3/colemak-tool … /Karabiner. The script attempts to stick closely to the default Extend as DreymaR defined it originally so that you can make your own customizations instead of taking mine.
The well commented Python script weighs in at about 250 lines of fairly readable code. Here is a sample from the QWFP row definition:
### top row ###
extend.add_key_mapping("q", "esc")
extend.add_mouse_scroll_mapping("w", "y", Direction.UP) # mouse scroll up
extend.add_key_mapping("f", "[", "left_command") # browser back in safari is CMD-[
extend.add_key_mapping("p", "]", "left_command") # browser forward in safari is CMD-]
extend.add_mouse_move_mapping("g", "y", Direction.UP) # mouse move up
extend.add_key_mapping("j", "page_up")
extend.add_key_mapping("l", "home")
extend.add_key_mapping("u", "up_arrow")
extend.add_key_mapping("y", "end")
extend.add_key_mapping(";", "delete_forward")
extend.add_key_mapping("[", "esc")
extend.add_key_mapping("]", "insert")
If Python or coding is not your thing, the generated JSON file is available for download here. Or, follow the directions on the site README to download and install the config. Let me know if you find any bugs, and if you are a fellow Python dev, feel free to contribute with a PR.
Works on Sierra, High Sierra, and Mojave. Haven't tested anything below that.
Last edited by mattmc3 (09-Oct-2018 23:20:45)