
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
ghost-keyboard
Advanced tools
Simulate any keyboard behavior of any keyboard language. Using Ghost Keyboard you can:
No dependency | Browser compatibility: IE10+, Chrome, Safari, Firefox
Check out the DEMO PAGE.
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.$ npm install ghost-keyboard --save
import GhostKeyboard from 'ghost-keyboard';
GhostKeyboard({
lang: 'en',
value: '',
input: document.getElementById('input_id'),
pattern: /[a-zA-Z0-9.@]/g
});
Or manually download and link ghost-keyboard.min.js in your HTML, It can also be downloaded via UNPKG:
Ghost Keyboard also provide an API if you want to use without a real input.
let GhostKeyboard = require('ghost-require');
let EnglishKeyboard = GhostKeyboard({lang: 'en'});
keyboard.type('KeyI', {shiftKey: true}); // "I"
keyboard.type('Space'); // "I "
keyboard.type('KeyL'); // "I l"
keyboard.type('KeyU'); // "I lu"
keyboard.type('KeyV'); // "I luv"
keyboard.type('Space'); // "I luv "
keyboard.type('CapsLock'); // "I luv "
keyboard.type('KeyU'); // "I luv U"
let KoreanKeyboard = GhostKeyboard({lang: 'ko'});
KoreanKeyboard.type('KeyT'); //ㅅ
KoreanKeyboard.type('KeyK'); //사
KoreanKeyboard.type('KeyF'); //살
KoreanKeyboard.type('KeyK'); //사라
KoreanKeyboard.type('KeyD'); //사랑
console.log(KoreanKeyboard.value);
KoreanKeyboard.changeLang('en');
console.log('tkfkd');
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.
FAQs
Simulate any keyboard behaviour even not installed
The npm package ghost-keyboard receives a total of 5 weekly downloads. As such, ghost-keyboard popularity was classified as not popular.
We found that ghost-keyboard demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.