Skip to content

Convert keyboard layouts, when user forget to change it

License

Notifications You must be signed in to change notification settings

cyhalothrin/convert-layout

 
 

Repository files navigation

Convert Layout Build Status

Converts keyboard layouts, when user forgot to change it.

var ru = require('convert-layout/ru');

bankcardName.keyup(function () {
    bankcardName.value = ru.toEn(bankcardName.value);
});

Usage

There are 2 ways to load layout. If you need only one layout, just load file directly:

var ru = require('convert-layout/ru');

Also you can get objects with all layouts:

var layouts = require('convert-layout');
layout = layouts[name];

Every layout has fromEn and toEn methods:

ru.toEn('руддщ')    //=> "hello"
ru.fromEn('ghbdtn') //=> "привет"

Layouts

Supported keyboard layouts:

  • Belarusian
  • English QWERTY
  • German
  • Kazakh
  • Russian
  • Ukrainian

If you want to add new keyboard layout:

  1. Fork a project. Create a branch.
  2. Add CODE.js file with layout buttons map. See example in ru.js. Lower case letters will be converted to upper case automatically. But all non-letters symbol should be added in both cases.
  3. Add CODE key to index.js.
  4. Add layout to list above.
  5. Send a pull request.

About

Convert keyboard layouts, when user forget to change it

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%