All Projects → ashubham → w3c-keys

ashubham / w3c-keys

Licence: MIT License
keyboardEvent.key compatible key codes with Typescript Definitions.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to w3c-keys

hidstream
Streaming HID events in Node.js
Stars: ✭ 52 (-5.45%)
Mutual labels:  keyboard-events
X.Web.Sitemap
Simple sitemap generator for .NET
Stars: ✭ 66 (+20%)
Mutual labels:  w3c
corda-did-method
This is an implementation of the Corda DID Method which enables Create-Read-Update-Delete (CRUD) operations on the Corda Decentralized Identifier (DID)
Stars: ✭ 17 (-69.09%)
Mutual labels:  w3c
interledger-payment-app-example
An implementation of the Interledger spec through an Android's Payment App
Stars: ✭ 26 (-52.73%)
Mutual labels:  w3c
lingua
A PHP-7 language codes converter, from and to the most common formats (ISO or not)
Stars: ✭ 35 (-36.36%)
Mutual labels:  w3c
simplepie-ng
Don't use this yet.
Stars: ✭ 41 (-25.45%)
Mutual labels:  w3c
slimdom.js
Fast, tiny, standards-compliant XML DOM implementation for node and the browser
Stars: ✭ 21 (-61.82%)
Mutual labels:  w3c
xgen
XSD (XML Schema Definition) parser and Go/C/Java/Rust/TypeScript code generator
Stars: ✭ 153 (+178.18%)
Mutual labels:  w3c
WebDriver
Web Driver UDF for AutoIt
Stars: ✭ 74 (+34.55%)
Mutual labels:  w3c
MangoServer
A MongoDB implementation of the W3C Web Annotation Protocol
Stars: ✭ 16 (-70.91%)
Mutual labels:  w3c
react-keyevent
An easy-to-use keyboard event react component, Package size less than 3kb
Stars: ✭ 38 (-30.91%)
Mutual labels:  keyboard-events
re-pressed
re-pressed is a clojurescript library that handles keyboard events for re-frame applications.
Stars: ✭ 150 (+172.73%)
Mutual labels:  keyboard-events
Simplified-JNA
Multi-threaded JNA hooks and simplified library access to window/key/mouse functions.
Stars: ✭ 30 (-45.45%)
Mutual labels:  keyboard-events
multi-brand-colors
Multi Brand Colors with support for CSS/CSS-Vars/SCSS/SASS/Stylus/LESS/JSON
Stars: ✭ 26 (-52.73%)
Mutual labels:  w3c
node-w3capi
A JavaScript client for the W3C API
Stars: ✭ 21 (-61.82%)
Mutual labels:  w3c
Chordly
Chordly is a javascript library that may be used to detect and act upon key sequences entered by a user.
Stars: ✭ 14 (-74.55%)
Mutual labels:  keyboard-events
elucidate-server
A W3C and OA compliant Web Annotation server
Stars: ✭ 48 (-12.73%)
Mutual labels:  w3c
rdf-validate-shacl
Validate RDF data purely in JavaScript. An implementation of the W3C SHACL specification on top of the RDFJS stack.
Stars: ✭ 61 (+10.91%)
Mutual labels:  w3c
global-keypress
Global key press event emitter.
Stars: ✭ 25 (-54.55%)
Mutual labels:  keyboard-events
markup-validator
validator.w3.org/
Stars: ✭ 94 (+70.91%)
Mutual labels:  w3c

w3c-keys

Build Status npm version npm

w3c-keys

keyboardEvent.key compatible key codes with Typescript Definitions.

Read https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key

Compatible with IE/Edge/Safari Key idiosyncrasies.

Super Lightweight: ~900 Bytes Gzipped (Potentially smaller when combined gzipped with a bigger app)

Usage

import { Key } from 'w3c-keys';

// To dispatch Events.
let evt = new KeyboardEvent('keydown', {
    key: Key.Space
});
document.body.dispatchEvent(evt);

// To check event keys.
document.body.on('keydown', (e) => {
    if(e.key === Key.Backspace) {
        // Do some shiz...
    }
});

Why not use evt.which keyCodes ?

  • evt.which keycodes are a deprecated standard.
  • Ability to create synthetic key events is not possible with evt.which.
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].