1.1.6 • Published 6 years ago

hodgef-react-virtual-keyboard v1.1.6

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

React Virtual Keyboard

Notice

Use react-simple-keyboard instead, as I will no longer update this fork. simple-keyboard is entirely coded in React and has no jQuery or Mottie Keyboard dependency.



A on-screen keyboard (OSK) Component that works in the browser for reactJS. Useful for Kiosk Touchscreens.

Based on the Virtual Keyboard using jQuery: https://mottie.github.io/Keyboard/

Usage

Installation

npm i -S virtual-keyboard hodgef-react-virtual-keyboard

Import Keyboard

import Keyboard from 'hodgef-react-virtual-keyboard';

Use Keyboard Element

<Keyboard
  value={this.state.input}
  name='keyboard'
  options={{
    type:"input",
    layout: "qwerty",
    alwaysOpen: true,
    usePreview: false,
    useWheel: false,
    stickyShift: false,
    appendLocally: true,
    color: "light",
    updateOnChange: true,
    initialFocus: true,
    display: {
      "accept" : "Submit"
    }
  }}
  onChange={this.onInputChanged}
  onAccepted={this.onInputSubmitted}
  ref={k => this.keyboard = k}
/>

Return updated values

onInputChanged = (data) => {
  this.setState({ input: data });
}

onInputSubmitted = (data) => {
  console.log("Input submitted:", data);
}

Listen for button presses

this.keyboard.interface.keyaction.enter = (base) => {
  // Enter button pressed
  // Accepting content, as an example:
  return this.keyboard.interface.keyaction.accept(base);
};

For more information, check out the API documentation: https://github.com/Mottie/Keyboard/wiki/Options

Dependencies

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.10

6 years ago

1.0.9

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago