Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 900 Bytes

README.md

File metadata and controls

47 lines (33 loc) · 900 Bytes

Luna Keyboard

Virtual keyboard.

Demo

https://luna.liriliri.io/?path=/story/keyboard

Install

Add the following script and style to your page.

<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-keyboard/luna-keyboard.css" />
<script src="//cdn.jsdelivr.net/npm/luna-keyboard/luna-keyboard.js"></script>

You can also get it on npm.

npm install luna-keyboard --save
import 'luna-keyboard/luna-keyboard.css'
import LunaKeyboard from 'luna-keyboard'

Usage

const textarea = document.getElementById('textarea')
const container = document.getElementById('container')
const keyboard = new LunaKeyboard(container)
keyboard.on('change', (input) => {
  textarea.value = input
})
textarea.addEventListener('input', (event) => {
  keyboard.setInput(event.target.value)
})

Api

setInput(input: string): void

Set input.