Edit 2:
Keypress events working, on this jsbin: http://jsbin.com/foyile/1/. The problem is, I need to focus the tab on the element, with these two pieces line of code
ready: function() {
this.tabIndex = 0;
this.focus();
}
The problem is this causes to draw a blue border around the element, and it gets ugly when I do this on my moving element, Is there a way to capture the key event globally on the page without focusing on the element, (or a parent element that will make the border invisible and focusing more natural)?
Original Question
Is there a polymer component that handles user input, mainly key presses and swipe gestures. I want to create a game, and I need to control the player via up, down button or swipe gestures.
Is there a polymer way to handle input, or I need to use native dom and javascript?
Edit:
According to this answer Polymer keypress event handler not being called:
this.tabIndex = 0
must be set, this to work.
Here's a jsbin: http://jsbin.com/foyile/1/.