Giter Club home page Giter Club logo

kbd-layout-fix's Introduction

Auto-correct text entered with the wrong keyboard layout

To enter text in some languages you press a special key combination (e.g. Alt-Shift) to toggle the keyboard layout. The keyboard layout context is typically kept separately for each window. This is generally good, but forces you to remember (or check) the current layout every time you switch to another window. If you forget to do that, the text you type will come out as gibberish. The AutoHotKey script provided here will automatically fix such text.

For example, if you have written Ιτ ςασ α δαρκ ανδ στορμυ νιγητ it will replace it with It was a dark and stormy night. If you have written Mia for;a ki ;enan kair;o it will replace it with Μια φορά κι έναν καιρό.

Use

To use a script #include the .ahk file in your AutoHotKey definitions. For example, add a line #include greek-latin-fix.ahk. Remember to reload the AutoHotKey definitions. To fix some incorrectly typed text, select it, and press the corresponding shortcut (for Greek-Latin mappings Ctrl-Alt-G).

Operation

Code in this repository addresses the problem by programming AutoHotKey with a script that fixes the selected text. The script

  • copies the selected text to the clipboard,
  • obtains a copy of the clipboard (to minimize system calls),
  • detects the direction of the desired mapping (Greek to Latin or Latin to Greek),
  • converts sequences that include a stress dead key combination,
  • converts all other characters,
  • sets the clipboard to the mapped text, and
  • pastes the text to the current selection.

Contributing

The AHK script's creation is automated with a corresponding Python script. This process can also be useful for text that is entered through other switched keyboard layouts, such as Cyrillic or Hebrew. Contributions through pull requests are welcomed!

kbd-layout-fix's People

Contributors

dspinellis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

konfou

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.