Code Monkey home page Code Monkey logo

karabiner-elements-config's Introduction

karabiner-elements-config

Clone this repo into ~/.config/karabiner. node build.js creates karabiner.json, the actual Karabiner config file.


Input source notes

I want to bind ⌥J and ⌥K to next/previous tab in Firefox. But, I use Tree Style Tab, and I want to enable TST's "Don't expand collapsed tree and skip collapsed descendants, while switching focus of tabs via keyboard shortcuts" option. TST has to implement this with some weird modifier key watching code due to Firefox limitations, and if I just bind ⌥J/⌥K to ⌃Tab/⌃⇧Tab then TST's modifier key watching gets confused and it can't skip collapsed descendants reliably. I can get around that by having Karabiner pass ⌥J/⌥K through to Firefox unchanged, and then binding them to TST's "Focus to Next/Previous Tab (don't expand tree)" commands through Firefox's "Manage Extension Shortcuts". But, after doing that, there's an issue where, if the current Firefox tab has a textfield selected, ⌥J/⌥K will just enter ∆/˚ characters into the textfield rather than switching tabs. I can get around that by changing MacOS's input source to "Unicode Hex Input" in keyboard settings, but that causes another issue where ⌥←/⌥→ no longer do anything in textfields. To get around this final issue, I got the Unicode Hex Input.keylayout from Ukelele v2.2.8 (the file seems removed from more recent versions), and edited it with the latest version of Ukelele to change the output of the arrow keys back to their default value while holding ⌥, producing the Griffin.keylayout file in this repo. Then I put that file in /Library/Keyboard Layouts/, select it as the input source, and now everything works including ⌥←/⌥→ to move by word in textfields. The important part of Griffin.keylayout here is the first keyMap index="3" section, which binds ⌥arrows to some ASCII control characters.

Switching the next/previous tab keybinding to ⌃J/⌃K did also make everything work without all the input source stuff, presumably because getting ⌥ out of the equation avoids confusing TST's modifier key watching, but I'm in too deep to change that keybinding now 😅.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.