simple-keyboard
Advanced tools
Comparing version 2.1.1 to 2.1.2
{ | ||
"name": "simple-keyboard", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "On-screen Virtual Keyboard", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -184,2 +184,26 @@ # simple-keyboard | ||
### onKeyPress | ||
> Executes the callback function on key press. Returns button layout name (i.e.: "{shift}"). | ||
```js | ||
onKeyPress: (button) => console.log(button) | ||
``` | ||
### onChange | ||
> Executes the callback function on input change. Returns the current input's string. | ||
```js | ||
onChange: (input) => console.log(input) | ||
``` | ||
### onChangeAll | ||
> Executes the callback function on input change. Returns the input object with all defined inputs. This is useful if you're handling several inputs with simple-keyboard, as specified in the "*[Using several inputs](#using-several-inputs)*" guide. | ||
```js | ||
onChangeAll: (inputs) => console.log(inputs) | ||
``` | ||
## Methods | ||
@@ -205,3 +229,8 @@ | ||
```js | ||
// For default input (i.e. if you have only one) | ||
keyboard.clearInput(); | ||
// For specific input | ||
// Must have been previously set using the "inputName" prop. | ||
keyboard.clearInput("inputName"); | ||
``` | ||
@@ -214,3 +243,8 @@ | ||
```js | ||
// For default input (i.e. if you have only one) | ||
let input = keyboard.getInput(); | ||
// For specific input | ||
// Must have been previously set using the "inputName" prop. | ||
let input = keyboard.getInput("inputName"); | ||
``` | ||
@@ -223,3 +257,8 @@ | ||
```js | ||
// For default input (i.e. if you have only one) | ||
keyboard.setInput("Hello World!"); | ||
// For specific input | ||
// Must have been previously set using the "inputName" prop. | ||
keyboard.setInput("Hello World!", "inputName"); | ||
``` | ||
@@ -267,2 +306,3 @@ | ||
``` | ||
> [See full example](https://github.com/hodgef/simple-keyboard/blob/master/src/demo/MultipleInputsDemo.js). | ||
@@ -269,0 +309,0 @@ ## Demo |
600532
323