rss-virtual-keyboard

1.0.7 • Public • Published

How to use it

import Keyboard from 'rss-virtual-keyboard';

Init keyboard with input element selector and container selector

const kb = new Keyboard().init('.input-field', '.keyboard-container');

Or use HTMLElements

// Need to be HTMLInputElement or HTMLTextAreaElement
const input = document.createElement('input');
input.type = 'text';
 
// Any valid HTMLElement as container
const container = document.createElement('div');
 
const kb = new Keyboard().init(input, container);

And generate layout and subscribe on events

// Then enerate layout to the dom
kb.generateLayout();
 
// Subscribe to keypress events
kb.on('Enter', () => console.log('Enter button pressed'));
kb.on('Space', () => console.log('Space button pressed'));

Features:

  • Two languages: english and russian
  • Switch language button
  • Ctrl + Alt to change language using keyboard keys

Package Sidebar

Install

npm i rss-virtual-keyboard

Weekly Downloads

1

Version

1.0.7

License

ISC

Unpacked Size

52.4 kB

Total Files

6

Last publish

Collaborators

  • xmelsky