simple-keyboard
Advanced tools
Comparing version 2.0.2 to 2.0.3
{ | ||
"name": "simple-keyboard", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "On-screen Virtual Keyboard", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -17,6 +17,14 @@ # simple-keyboard | ||
### npm | ||
`npm install simple-keyboard --save` | ||
## Usage | ||
### zip file (self-hosted) | ||
[Click here to download the latest release (zip format).](https://github.com/hodgef/simple-keyboard/zipball/master) | ||
> Want to use a CDN instead of self-host? Scroll down to the "Usage from CDN" instructions below. | ||
## Usage with npm | ||
### js | ||
@@ -28,6 +36,24 @@ | ||
var keyboard = new Keyboard({ | ||
onChange: input => this.onChange(input), | ||
onKeyPress: button => this.onKeyPress(button) | ||
}); | ||
class App { | ||
constructor(){ | ||
document.addEventListener('DOMContentLoaded', this.onDOMLoaded); | ||
} | ||
onDOMLoaded = () => { | ||
this.keyboard = new Keyboard({ | ||
onChange: input => this.onChange(input), | ||
onKeyPress: button => this.onKeyPress(button) | ||
}); | ||
} | ||
onChange = input => { | ||
console.log("Input changed", input); | ||
} | ||
onKeyPress = button => { | ||
console.log("Button pressed", button); | ||
} | ||
} | ||
export default App; | ||
```` | ||
@@ -43,2 +69,19 @@ | ||
## Usage from CDN | ||
### html | ||
````html | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<link rel="stylesheet" href="https://cdn.rawgit.com/hodgef/simple-keyboard/d477c35c/build/css/index.css"> | ||
</head> | ||
<body> | ||
<div class="simple-keyboard"></div> | ||
<script src="https://cdn.rawgit.com/hodgef/simple-keyboard/d477c35c/build/index.js"></script> | ||
</body> | ||
</html> | ||
```` | ||
## Options | ||
@@ -124,3 +167,3 @@ | ||
simple-keybord has a few methods you can use to further control it's behavior. | ||
simple-keyboard has a few methods you can use to further control it's behavior. | ||
To access these functions, you need the instance the simple-keyboard component, like so: | ||
@@ -127,0 +170,0 @@ |
595876
220