title: Detecting keypress in Ember.js v2+
body: <p>I've problem with detecting keypress in ember v2.3.0. I'm beginer with ember and I try write simple component that display pressed key. But I got problem with run action and take parameters. 
  Basicly I could use <code>this.$().on("keypress",function(){ ... });</code> in didRender to get keyCode but I think it's not a good practice in Ember. Could someone help me with this? Please. :)</p>
  
  <p>Here is my code:
  <a href="http://emberjs.jsbin.com/vucenomibo/edit?html,js,output" rel="nofollow">http://emberjs.jsbin.com/vucenomibo/edit?html,js,output</a></p>
  
  <p>HTML:</p>
  
  <pre><code>  &lt;script type="text/x-handlebars" data-template-name="application"&gt;
       &lt;h2&gt;Welcome to Ember.js&lt;/h2&gt;
       {{outlet}}
    &lt;/script&gt;
  
    &lt;script type="text/x-handlebars" data-template-name="index"&gt;
       {{my-component item=this setAction="smth"}}
    &lt;/script&gt;
  
    &lt;script type="text/x-handlebars" data-template-name="components/my-component"&gt;
       &lt;div class="app-body" {{action "smth"}} &gt;
         Pressed: {{pressedKeyCode}}
       &lt;/div&gt; 
    &lt;/script&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>App = Em.Application.create();
  
  App.IndexController = Em.Controller.extend({
    actions : {
  
    }
  });
  
  App.MyComponentComponent = Em.Component.extend({
    didRender: function() {
      console.log(this.get('context'));
      console.log(this.get('item'));
      return this.$().attr({ tabindex: 1 }), this.$().focus();
    },
    pressedKeyCode: null,
    actions:{
      smth: function(e) {
        console.log('aaa');
        this.send('displayKey', String.fromCharCode(e.keyCode));
      },
      displayKey: function(keyCode) {    
          this.get('item').set('pressedKeyCode', keyCode); 
      }
  
    }
  });
  </code></pre>
  
  <p><strong>EDIT</strong><br>
  I made it like that:
  <a href="http://emberjs.jsbin.com/qipeponiqu/1/edit?html,js,output" rel="nofollow">http://emberjs.jsbin.com/qipeponiqu/1/edit?html,js,output</a></p>
  
  <p>Can someone review it, please? I want learn best practices. :)</p>