Ghost Keyboard
Simulate any keyboard behavior of any keyboard language. Using Ghost Keyboard you can:
- Imitates an input typing and get the output value.
- Convert the typing on a HTMLInputElement to another language even not installed on OS.
No dependency | Browser compatibility: IE10+, Chrome, Safari, Firefox
Check out the DEMO PAGE.
Languages
- English (en) 🇺🇸
- Korean (ko) 🇰🇷
Options
lang
Language abbreviation.value
(optional) Initial input value.input
(optional) HTMLInputElement that will connect with Ghost Keyboard.pattern
(optional) RegExp Allow only values that match the pattern.
Usage
$ npm install ghost-keyboard --save
; ;
Or manually download and link ghost-keyboard.min.js in your HTML, It can also be downloaded via UNPKG:
API
Ghost Keyboard also provide an API if you want to use without a real input.
let GhostKeyboard = ; let EnglishKeyboard = ;keyboardtype'KeyI' shiftKey: true; // "I"keyboardtype'Space'; // "I "keyboardtype'KeyL'; // "I l"keyboardtype'KeyU'; // "I lu"keyboardtype'KeyV'; // "I luv"keyboardtype'Space'; // "I luv "keyboardtype'CapsLock'; // "I luv "keyboardtype'KeyU'; // "I luv U" let KoreanKeyboard = ;KoreanKeyboardtype'KeyT'; //ㅅKoreanKeyboardtype'KeyK'; //사KoreanKeyboardtype'KeyF'; //살KoreanKeyboardtype'KeyK'; //사라KoreanKeyboardtype'KeyD'; //사랑console; KoreanKeyboard;console;
Development
You will need Node.js
installed on your system.
To develop, Install dependencies, Get the code:
$ git clone https://github.com/fill-lima/ghost-keyboard.git$ cd ghost-keyboard # Into the directory $ npm install # Install dependencies
To develop, run the self-reloading:
$ npm start
To develop and check tests at same time.
$ npm run dev
To build, run:
$ npm run build
To contribute, please fork GhostKeyboard, add your patch and tests for it (in the test/
folder) and submit a pull request.
To do
- Add compatibility to textarea input
- Add option of keyboard layout
- Other keyboard languages
- Convert typed text in other keyboard layout