title: Key event filtering for numbers, letters or other groups
body: <p>Angular4 docs shows ( <a href="https://angular.io/guide/user-input" rel="nofollow noreferrer">Key event filtering (with key.enter)</a> ) how to catch keyboard keystrokes events easier - <code>(keyup.enter)="foo()"</code> or <code>keyup.w</code> or <code>keyup.space</code> etc. </p>
  
  <p>What I need is to fire event only if letters being pressed.  </p>
  
  <p>One way I can think of is:</p>
  
  <p><code>&lt;input id="textFilter" (keyup)=“foo($event)”&gt;</code></p>
  
  <pre><code>  foo(e){
      var allowedKeys = [‘KeyQ’, ‘KeyW’, ‘KeyE’, and the rest of the alphabet...]
      if (allowedKeys.indexOf(e.code) != -1 ) {
        return true;
      }
    }
  </code></pre>
  
  <p>But I would expect such <code>pseudo-events</code> already build-in in Angular. For ex. for letters, like - <code>(keyup.letters)="foo()"</code> and for numbers, like -<code>(keyup.numbers)="foo()"</code>. Are there any? And is that solution above is preferable for filtering keyboard keystrokes by groups?</p>
  
  <p><a href="https://github.com/angular/angular/commit/8fa1539bacd454635d1f78ab056e2017929d0634" rel="nofollow noreferrer">docs</a></p>
  
  <p>I appreciate any help.</p>