Skip to content

ally.js

JavaScript library to help modern web applications with accessibility concerns by making accessibility simpler

# ally.map.keycode

Map human readable names for event.keyCodes.

# Description

// example structure
var map = {
  // Element Focus
  tab: 9,

  // Navigation
  left: 37,
  up: 38,
  // ...
  home: 36,

  // Action
  enter: 13,
  escape: 27,
  space: 32,

  // Function keys
  f1: 112,
  // ...

  // Numeric keys
  0: 48,
  1: 49,
  // ...
  'num-0': 96,
  'num-1': 97,
  // ...

  // Latin characters
  a: 65,
  // ...
  z: 90,
};

The map knows the following keys:

# Usage

console.log('keycode of enter', ally.map.keycode.enter);

# Changes

# Notes

The key meta is known by different keyCodes: 91, 92, 93, 224 - which ally.map.keycodes.alias.91 helps to resolve. The same is true for numeric keys (0-9) and their counterparts on the numblock.

# Contributing