| <!-- |
| @license |
| Copyright (c) 2014 The Polymer Project Authors. All rights reserved. |
| This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt |
| The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt |
| Code distributed by Google as part of the polymer project is also |
| subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt |
| --> |
| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="UTF-8"> |
| <title>Core A11y Keys demo</title> |
| <script src="../webcomponentsjs/webcomponents.js"></script> |
| <link rel="import" href="core-a11y-keys.html"> |
| <style> |
| div { |
| height: 100px; |
| width: 100px; |
| background: gray; |
| } |
| </style> |
| </head> |
| <body> |
| <template is="auto-binding"> |
| <span>Press any of these keys: {{keys}}</span> |
| <core-a11y-keys id="a11y" keys="{{keys}}" on-keys-pressed="{{print}}"></core-a11y-keys> |
| <pre id="output"></pre> |
| </template> |
| <script> |
| addEventListener('template-bound', function(ev) { |
| ev.target.keys = "* pageup pagedown left right down up shift+a alt+a home end space enter" |
| ev.target.print = function(ev) { |
| console.log(ev.detail); |
| this.$.output.textContent += ev.detail.key + ' pressed!\n'; |
| } |
| }); |
| </script> |
| </body> |
| </html> |