Giter Site home page Giter Site logo

gen-keylayout's Introduction

gen-keylayout

Generate MacOS keylayout based on JSON description.

Rationale

Constructing xml keyboard layout by hand or even with tools like Ukelele is a tedious task. So I wrote simple python script with no external dependancies, to make your life easier if found yourself in a situation where all existing keyboards do not work as you want them to.

Usage

# generating layout and saving it to my.keylayout file
python3 ./gen-keylayout.py <your-json-layout> > my.keylayout
# putting file to "~/Library/Keyboard Layouts"
mv my.keylayout ~Library/Keyboard\ Layouts
# Go to "System preferences" -> "Keyboard" -> "Input sources" -> "+" -> "Others" -> "YOUR LAYOUT NAME"

Format

Json layout file contains two required attirbutes name and keys. name is arbitrary UTF-8 string and it will be used as idendification in preference settings. keys is a mapping from key sequence to desired output, where key sequence is ANSI names of desired keys. Minimal example {"name":"example","keys":{"/t":"ั‰"}} will result in handling sequence of key presses / t outputing symbol ั‰. Complete example for russian transliteration keyboard can be found in example folder.

Known limitations

  • Works only with python of version 3 and higher.
  • Fallbacks to US keyboard with all modifiers except shift and caps it helps to use default hotkeys

Links

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.