Your browser doesn't support the features required by impress.js, so you are presented with a simplified version of this presentation.

For the best experience please use the latest Chrome, Safari or Firefox browser.

HumanInput is a JS lib for handling human-generated events. github.com/liftoff/HumanInput $ npm install humaninput Minified and compressed size: 8.1kb   Author:  Dan McDougall
Key Features:
Important Notes:
Competition: Mousetrap
Competition: Keypress
Competition: Keymaster
How do you use

HumanInput?

// Create an instance of HumanInput:
var HI = new HumanInput(window);
// Set a callback for a given event:
HI.on('a', aKeyPressed);
// Mix & match event types:
HI.on('a-s-click', doStuff);
// Use selector syntax for #id and .class:
HI.on('click:.someclass', clickSomeclass);
// Bind multiple events at once:
HI.on(['ctrl-a n','esc esc n'],nextWindow);
// Check state at any time:
HI.isDown('shift-a') == true;

Let's talk about Advanced Features

Aliases and Event Maps
HI.aliases.invoke = 'ctrl-a';
HI.aliases['★'] = 'ctrl-b';
HI.on('invoke n', newWindow);
HI.on('★', newBookmark);

var myMap = {'w': 'moveup'};
// Apply the eventMap at instantiation:
var HI = new HumanInput(
    window, {eventMap: myMap});
HI.on('moveup', (e) => {
    HI.log.info('moveup'); });
Filter Function
// Skip events if conditions are met
HI.filter = function(e) {
  if (e.target.tagName == 'TEXTAREA') {
    return false; // Skip event
  }
  return true; // Proceed normally
};
Record a Keystroke
It's Modern JavaScript!