GithubHelp home page GithubHelp logo

pebblejs-keyboard's Introduction

PebbleJS Keyboard

PebbleJS keyboard is a simple attempt to get a working keyboard in the watch.

The idea is to provide a simple and fast input method for quick replies, sing ups or validations (code validation e.g).

Getting started

The easiest way to use the keyboard is in CloudPebble, just copy the contents of the pebble-keyboard.js to a new asset in your project.

In your main.js or the file that needs the keyboard, do a simple:

var Keyboard = require('pebblejs-keyboard'); // Asuming the file is named pebblejs-keyboard.js

The variable Keyboard will have the module, you can create now as many keyboard instances you like, I recommend using only one to use less memory and keep it as simple as possible.

To initialize your keyboard, simply call new Keyboard(WindowObject), passing a Window Object set to fullscreen: true to the Keyboard module, this window is where the keyboard will be displayed, you can set a new window later by calling Keyboard.window(WindowObject).

var myKeyboard = new Keyboard(window);

After creating the keyboard, hook a text event to receive the user input:

myKeyboard.on('text', function(input) {
	console.log('user typed: ' + input)
});

Now you can display the keyboard to the user at any time:

myKeyboard.show();

You can also hide the keyboard by calling hide().

Using the Keyboard

usage

For the user, I tried to make the keyboard reeeeally simple using the 3 keys on the right like this:

* Switch from letters to numbers or symbols by long-pressing the down button
* Erase a character by long-pressing the up button
* Change the character with up/down
* Select a character with the select button (middle)
* Submit the input by long-pressing the select button (middle)

pebblejs-keyboard's People

Contributors

jor3l avatar leovander avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.