Git Product home page Git Product logo

jkeyboard's Introduction

jKeyboard

See In Action

JKeyboard

A simple jQuery on screen keyboard.

Feautures

  • Easy Setup
  • Switch layout on the Fly
  • Supports multiple input fields
  • Custom layout

1. Getting Setup

1.1. Installation

  • First, copy and paste lib/js/keyboard.js in your project, and link to it before the closing </body> element. Make sure jquery is linked before this.
  • Next, you'll need to copy and paste the plugin's css into your project. Both Scss and Css are included for flexibility and modifications.
  • Lastly, link to the keyboard css file jkeyboard.css file before the closing </head> element.

Note: This plugin requires your website or application already runs a copy of jQuery, version 1.10.1 or higher.

<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="jkeyboard.js"></script>
<link rel="stylesheet" href="jkeyboard.css">

1.2 The Basics

The first thing you will require is a keyboard holder that will hold the keyboard, and an input field on which the keyboard will operate.

<input type="text" id="search_field">
<div id="keyboard"></div>
$('#keyboard').jkeyboard({
    input: $('#search_field')
});

1.2 Configuration

To configure custom options when you initialize jKeyboard, simply pass an object in your call to jkeyboard:

1.2.1 Simple Example
$('keyboard').jkeyboard({
    input: $('#search_field),
    layout: 'english'
});
1.2.2 Options
Option type Default values Description
customLayouts object {selectable:[]} selectable, customLayoutName All the custom layouts as well as custom selectable layouts are defined in this object.
customLayouts.selectable array [] array of selectable custom layouts. If you have more than one custom layout, you can choose which layout to show in the layout switch.
customLayouts.layoutname an array of keys for keyboards [] You can add as many custom layouts as you wish in the format of customLayouts.layoutName. Ex.
russian: [
['й','ц','у','к','е','н','г','ш','щ','з', 'х' ],
['ф','ы','в','а','п','р','о','л','д','ж', 'э'],
['shift','я','ч','с','м','и','т','ь','б','ю', 'backspace'],
['numeric_switch','layout_switch', 'space','return']
]
Click to view in action
1.2.3 Methods
Method type values Description
init object layout
input
customLayouts
All the custom layouts as well as custom selectable layouts are defined in this object.
setLayout string azeri
english
russian
numeric
numbers_only
symbolic
*custom layout names*

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.