slamdata/purescript-dom-keyboard

Name: purescript-dom-keyboard

Owner: SlamData, Inc.

Description: A package which provides ways to capture and manipulate keyboard interactions.

Created: 2015-12-04 16:30:12.0

Updated: 2018-03-09 18:33:46.0

Pushed: 2017-03-20 15:47:11.0

Homepage: null

Size: 118

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

purescript-dom-keyboard

A library for binding actions to and presenting DOM keyboard shortcuts.

Shortcuts

The shortcuts available are strongly typed to help ensure that your shortcuts are triggered and prevent applications being hidden or closed across various platforms and locales.

If you find an available shortcut hides or closes an application or that a shortcut isn't triggered on some platform or locale please open an issue. Pull requests are very welcome.

Installation
r install purescript-dom-keyboard
Compatability

This library relies on DOM Level 3 KeyboardEvent.key and DOM Level 3 KeyboardEvent.code values. If your target browser does not support these then please consider using a polyfill such as the one provided by js-polyfills.

Example

A simple example is available here.

It can be run by using pulp server from the example directory and navigating to http://localhost:1337 in a web browser.

Documentation

Module documentation is published on Pursuit: http://pursuit.purescript.org/packages/purescript-dom-keyboard

Development

To add or remove keyboard shortcuts please use the provided program generator.

After altering the key or code shortcut sources use pulp run --include ../src in the generator directory to update src/Data/Shortcut.purs.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.