Giter Club home page Giter Club logo

karabiner-elements-disable-internal-when-external-connected's Introduction

How to Disable Internal Keyboard when placing External Keyboard on top in Karabiner-Elements and MacOS Serria

Why do we need this?

Previously, Karabiner has the feature to automatically disable the internal keyboard when your external keyboard connected so you can easily put it on the top of your internal keyboard without worrying about the key conflicting. But now Karabiner is no longer working with MacOS Serria so the author Tekezo is remaking it as Karabiner-Elements, this developing Karabiner-Elements have not included the mentioned feature above yet, but it allows you to modify it karabiner.json configuration in order to map keys of any keyboards. So I did a hack to make this happen again so I can keep placing my favourite Filco Minila Air on the Apple Internal Keyboard again.

How to do this?

Step 1. You need following details:

  • Your Internal keyboard identifiers.
  • Your External keyboard identifiers.

Notes: You can easily find these when connected both keyboards, set some settings in Karabiner-Elements then they will show up in ~/.karabiner.d/configuration/karabiner.json through profiles.devices.

Step 2. Replacing my karabiner.json in this project with yours

  • Use my karabiner.json in this project, it contains all the rules to Disable all Keyboard buttons.
  • Replace the devices section by your current devices you got above in Step 1.
  • Make sure all devices are set with ignore: true so it this configuration is not activated by default.

Step 3. Setup Node.js script to automatically disable internal keyboard when external keyboard connected and vice versa

  • Install node js >= 4.x (directly or nvm or whatever).
  • Copy my script disable-internal-when-external-connected.js to some place you like.
  • Remembering in Step 1, You got the product_ids of your internal keyboard and external keyboard. In my case, my internal keyboard product_id is 628 and my external keyboard product_id is 34050.
  • Now run command:
EXTERNAL_KEYBOARD_ID=[product_id of external] INTERNAL_KEYBOARD_ID=[product_id of internal] node disable-internal-when-external-connected.js
  • E.g. in my case it will be :
EXTERNAL_KEYBOARD_ID=34050 INTERNAL_KEYBOARD_ID=628 node disable-internal-when-external-connected.js

That's it, now it will automaically disable your internal keyboard when your external keyboard is connected and it will re-enable your internal keyboard when your external keyboard is disconnceted. Woo hooo!

Any feedback is welcome!

Happy Hacking!

karabiner-elements-disable-internal-when-external-connected's People

Contributors

nmqanh avatar

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.