
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
betterboard
Advanced tools
A pure JavaScript library for using virtual keyboards.
1.0.0-beta.01 *
COMING SOON!
Chrome
|| Firefox
|| Safari
|| Opera
|| Edge
|| IE 11
COMING SOON... None of these work btw
yarn add BetterBoard
npm i BetterBoard
import BetterBoard from 'BetterBoard';
Actually works!:
<script src="https://cdn.jsdelivr.net/gh/Sid220/BetterBoard@master/src/betterboard.js"></script>
<script src="dist/BetterBoard-aio-2.1.0.min.js"></script>
3 types of keyboards can be used: all
, keyboard
, and numpad
.
5 types of themes can be used. light
, dark
, flat
, material
, and oldschool
.
BetterBoard Virtual Keyboard can be used with the input
or textarea
elements.
BetterBoard must be initialized with the required options. The other ones are optional. Keyboard Type (the default value is "all") data-BetterBoard-type
, Keyboard Placement (the default value is "bottom") data-BetterBoard-placement
, and Special Characters data-BetterBoard-specialcharacters
settings are each element-based (data attributes).
All options and examples of data attribute usages are as below. Also, a custom class name can be defined as globally for all input and/or textarea elements to run BetterBoard.
<!-- An example of a textarea element: The keyboard type is "all", the placement is "top", and the availability of the special characters is "true". -->
<textarea class="js-virtual-keyboard" data-BetterBoard-type="all" data-BetterBoard-placement="top" data-BetterBoard-specialcharacters="true" placeholder="Your Address"></textarea>
<!-- An example of an input element: The keyboard type is "keyboard", the placement is "bottom", and the availability of the special characters is "false". -->
<input class="js-virtual-keyboard" data-BetterBoard-type="keyboard" data-BetterBoard-placement="bottom" data-BetterBoard-specialcharacters="false" placeholder="Your Name" />
<!-- An example of an input element: The keyboard type is "numpad", and the placement is "bottom". (Special characters are not allowed for "numpad".) -->
<input class="js-virtual-keyboard" data-BetterBoard-type="numpad" data-BetterBoard-placement="bottom" placeholder="Your Number" />
// Select the input or the textarea element(s) to run the BetterBoard
BetterBoard.run('.js-virtual-keyboard', {
// ...init options
});
// Initialize BetterBoard (default/all options)
BetterBoard.init({
/*!
* Required
* An Array of Objects has to be defined for the custom keys. Hint: Each object creates a row element (HTML) on the keyboard.
* e.g. [{"key":"value"}, {"key":"value"}] => [{"0":"A","1":"B","2":"C"}, {"0":"D","1":"E","2":"F"}]
*/
keysArrayOfObjects: null,
/*!
* Required only if "keysArrayOfObjects" is "null".
* The path of the "BetterBoard-keys-${langugage}.json" file must be set to the "keysJsonUrl" option. (XMLHttpRequest to get the keys from JSON file.)
* e.g. '/Content/Plugins/BetterBoard/dist/BetterBoard-keys-english.json'
*/
keysJsonUrl: null,
/*
* Optional: An Array of Strings can be set to override the built-in special characters.
* e.g. ["#", "€", "%", "+", "-", "*"]
*/
keysSpecialCharsArrayOfStrings: null,
/*
* Optional: An Array of Numbers can be set to override the built-in numpad keys. (From 0 to 9, in any order.)
* e.g. [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
*/
keysNumpadArrayOfNumbers: null,
// Optional: (Other Options)
// Language Code (ISO 639-1) for custom keys (for language support) => e.g. "de" || "en" || "fr" || "hu" || "tr" etc...
language: 'en',
// The theme of keyboard => "light" || "dark" || "flat" || "material" || "oldschool"
theme: 'light',
// Uppercase or lowercase to start. Uppercased when "true"
capsLockActive: true,
/*
* Allow or prevent real/physical keyboard usage. Prevented when "false"
* In addition, the "allowMobileKeyboard" option must be "true" as well, if the real/physical keyboard has wanted to be used.
*/
allowRealKeyboard: false,
// Allow or prevent mobile keyboard usage. Prevented when "false"
allowMobileKeyboard: false,
// CSS animations for opening or closing the keyboard
cssAnimations: true,
// CSS animations duration as millisecond
cssAnimationsDuration: 360,
// CSS animations style for opening or closing the keyboard => "slide" || "fade"
cssAnimationsStyle: 'slide',
// Enable or Disable Spacebar functionality on the keyboard. The Spacebar will be passive when "false"
keysAllowSpacebar: true,
// Text of the space key (Spacebar). Without text => " "
keysSpacebarText: 'Space',
// Font family of the keys
keysFontFamily: 'sans-serif',
// Font size of the keys
keysFontSize: '22px',
// Font weight of the keys
keysFontWeight: 'normal',
// Size of the icon keys
keysIconSize: '25px',
// Scrolls the document to the top or bottom(by the placement option) of the input/textarea element. Prevented when "false"
autoScroll: true,
});
// Select the input or the textarea element(s) to run the BetterBoard
BetterBoard.run('.js-virtual-keyboard');
The keysJsonUrl
option has to be set if custom keys are not defined with the keysArrayOfObjects
option. JSON format has to be: [{"key":"value", "key":"value"}, ...]
. Each object in that array creates a row element (HTML) on the keyboard. The "key" in the objects is used as an "index" for each Keyboard Keys. The "value" is each key's value and inner text.
Additionally, BetterBoard includes 9 different language packages: Arabic
, English
, French
, German
, Hungarian
, Persian
, Russian
, Spanish
, and Turkish
.
An example of a JSON file (for custom keys) in English.
[
{
"0": "Q",
"1": "W",
"2": "E",
"3": "R",
"4": "T",
"5": "Y",
"6": "U",
"7": "I",
"8": "O",
"9": "P"
},
{
"0": "A",
"1": "S",
"2": "D",
"3": "F",
"4": "G",
"5": "H",
"6": "J",
"7": "K",
"8": "L"
},
{
"0": "Z",
"1": "X",
"2": "C",
"3": "V",
"4": "B",
"5": "N",
"6": "M"
}
]
Copyright © 2022 BetterBoard - Virtual Keyboard
MIT license - https://opensource.org/licenses/MIT
FAQs
A pure JavaScript library for using virtual keyboards.
The npm package betterboard receives a total of 0 weekly downloads. As such, betterboard popularity was classified as not popular.
We found that betterboard demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.