3
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
Code distributed by Google as part of the polymer project is also
8
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
11
<link rel="import" href="../../polymer/polymer.html">
12
<link rel="import" href="../../paper-styles/color.html">
13
<link rel="import" href="../iron-a11y-keys.html">
15
<dom-module id="x-key-aware">
23
color: var(--google-blue-700);
32
background-color: var(--google-grey-100);
33
border: 1px solid var(--google-grey-300);
39
<h4>Press any of these keys</h4>
41
<template is="dom-repeat" items="[[boundKeys]]">
47
keys="* pageup pagedown left right down up shift+a alt+a home end space enter"
49
on-keys-pressed="_updatePressed">
51
<pre id="output">[[pressed]]</pre>
79
this.boundKeys = this.$.keys.keys.split(' ');
82
_updatePressed: function(event) {
83
console.log(event.detail);
86
this.pressed + event.detail.combo + ' pressed!\n'