<x-trap>

A X-Tag element for handling gestures & keyboard shortcuts, backed by Hammer.js and Mousetrap.

Gestures


    <x-trap gestures="panleft press" action="highlight(this);"/>

Keyboard Shortcuts

Single Keys


<x-trap keys="x" action="highlight(this);"/>


<x-trap keys="4" action="highlight(this);"/>

Combinations


<x-trap keys="command+shift+k" action="highlight(this);"/>

Gmail Style Sequences


<x-trap keys="g i" action="highlight(this);"/>


<x-trap keys="* a" action="highlight(this);"/>

Konami Code


<x-trap keys="up up down down left right left right b a enter" action="highlight(this);"/>

Combinations

Miscellaneous


<x-trap keys="c" gestures="pandown" action="highlight(this);"/>
lefty righty
Swipe controlled area *
Swipe controlled area *
Swipe controlled area *
Swipe abcdefgfff