All Projects → hawkgs → jqKeyboard

hawkgs / jqKeyboard

Licence: MIT License
jQuery-based virtual keyboard

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to jqKeyboard

react-material-ui-keyboard
Virtual keyboard for TextField when needed
Stars: ✭ 54 (+184.21%)
Mutual labels:  keyboard, virtual-keyboard
KioskBoard
KioskBoard - A pure JavaScript library for using virtual keyboards.
Stars: ✭ 114 (+500%)
Mutual labels:  keyboard, virtual-keyboard
swipe-keyboard
Swype type keyboard module for simple-keyboard
Stars: ✭ 32 (+68.42%)
Mutual labels:  keyboard, virtual-keyboard
Keyboard
Virtual Keyboard using jQuery ~
Stars: ✭ 1,670 (+8689.47%)
Mutual labels:  keyboard, virtual-keyboard
react-touch-screen-keyboard
React touch screen virtual keyboard, opened on input focused
Stars: ✭ 45 (+136.84%)
Mutual labels:  keyboard, virtual-keyboard
SerialProxy
🖱️⌨️ Arduino Input Proxying for PC (.NET Core)
Stars: ✭ 39 (+105.26%)
Mutual labels:  keyboard
KeyHide
Easy way to hide Android keyboard on background tap without any effort.
Stars: ✭ 54 (+184.21%)
Mutual labels:  keyboard
better-keyboard
A js keyboard component for mobile.
Stars: ✭ 55 (+189.47%)
Mutual labels:  keyboard
PGNumberKeyboard
一款非常简单漂亮灵活的自定义数字键盘.
Stars: ✭ 16 (-15.79%)
Mutual labels:  keyboard
fusuma-plugin-keypress
Keypress combination plugin for Fusuma
Stars: ✭ 21 (+10.53%)
Mutual labels:  keyboard
keyboard-ktx
Kotlin extensions for hiding/showing and observe keyboard state.
Stars: ✭ 14 (-26.32%)
Mutual labels:  keyboard
Unexpected-Keyboard
A lightweight virtual keyboard for developers.
Stars: ✭ 145 (+663.16%)
Mutual labels:  keyboard
FatBottomedBoard
Ben's Custom Keyboard. Huge, large & heavy board for daily work
Stars: ✭ 18 (-5.26%)
Mutual labels:  keyboard
SHKB
A programmable (QMK/TMK supported) HHKB controller with integrated hub
Stars: ✭ 34 (+78.95%)
Mutual labels:  keyboard
Plaid-Pad
Build guide and additional hardware for the Plaid-Pad mechanical macro pad.
Stars: ✭ 39 (+105.26%)
Mutual labels:  keyboard
openinput
Open source firmware for input devices
Stars: ✭ 43 (+126.32%)
Mutual labels:  keyboard
EasyEmoji
Help developers to quickly realize the expression of the keyboard
Stars: ✭ 24 (+26.32%)
Mutual labels:  keyboard
Teleprinter
The missing Android keyboard API
Stars: ✭ 33 (+73.68%)
Mutual labels:  keyboard
barrier
Open-source KVM software
Stars: ✭ 17,366 (+91300%)
Mutual labels:  keyboard
Chess-Helper
Simple Chrome extension adding nice features to chess.com website
Stars: ✭ 23 (+21.05%)
Mutual labels:  keyboard

jqKeyboard


jQuery-based virtual keyboard.

v1.0.2

Changelog:

  • Handle dynamically-created allowed elements. (Credits: avallcanera; #3)

Demo

Try it

Installation

npm install jq-keyboard --save

Then add below your jQuery and jQuery UI imports the following HTML:

<!-- CSS theme -->
<link rel="stylesheet" href="/node_modules/jq-keyboard/jqkeyboard.css" />
<!-- Library -->
<script src="/node_modules/jq-keyboard/jqkeyboard.min.js"></script>
<!-- Keyboard layout -->
<script src="/node_modules/jq-keyboard/jqk.layout.en.js"></script>

Note that the loading order of the library and layout files doesn't matter.

Configure and run

In order to run the keyboard you have to call the .init() function which is part of the jqKeyboard object after the page loaded:

$(function () {
    "use strict";

    jqKeyboard.init();
});

The API of the library provides few options which can be passed to .init() function as an object.

  • containment - DOM element (string) - By default, the containment is set to body (i.e. whole page). You can specify your own containment by providing a DOM element. That way your keyboard could be dragged only in that element.
  • allowed - Array of DOM input elements (strings) - This option allows only listed elements to be jqKeyboard-active meaning that you won't be able to use the keyboard for the rest of the input elements. By default, jqKeyboard will work for all input elements on the page.
  • icon - "dark" or "light" (string) - Depending on your prevailing page design color (being darker or lighter), you could use this option to change the color of the icon in order to achieve better contrast. The default value is "light".

Here is a sample code with the options:

$(function () {
    "use strict";

    jqKeyboard.init({
        containment: "#field",
        allowed: ["input[type='text']", "#username-input"],
        icon: "dark"
    });
});

That's it!

Custom Layouts

If you can't find your needed language layout from the existing ones (which is very likely to be so), you can create your own one. Okay, let's start with the initial layout script file:

var jqKeyboard = jqKeyboard || {}; // trying not to override the jqKeyboard object.

jqKeyboard.layouts = [/* In this array we will put all layout objects */];

Layout Objects

After we are ready with the initial script file, we can proceed with filling the layouts array with our objects. Each layout object has two properties - lang, which must be unique and identifies the language (we suggest you keeping it short, eg. EN for English) and layout, which represents the layout itself.

layout Property

As you probably already noticed, the layout is an array of strings where each string represents a line, a new row of the keyboard. Each character is separated by space. Special keys are wrapped in <<KEY_NAME>>. Currently, these are the available ones:

<<capslock>>, <<shift>>, <<tab>>, <<enter>>, <<space>>, <<backspace>>

Shift and Caps Lock

If the character you entered supports lower/upper case, it will get automatically changed whenever you press Shift or Caps Lock. In the cases where you want to change the button sign completely whenever you press Shift you have to implicitly describe it in the character string by separating the signs with | symbol. An example - let's say we have the following string with characters:

<<shift>> a b c d +|-

In its normal state, the keyboard will render "a b c d +" (so in this case the left side of the sign combination). Whenever we press Shift, the keyboard will change to "A B C D -" (letters gets automatically uppercase where the sign changes to minus - right side). Summarized: Normal state - plus sign; Shift is active: minus sign.

Non-ASCII Characters

In order to render characters from different languages part of UTF-8 encoding, you should escape them accordingly. You can check English-Bulgarian layout for example.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].