title: How to check if button has focus?
body: <p>I have a form that I am wanting to use the <strong>ENTER</strong> key to tab across the fields, but I am also wanting to submit the form when using the <strong>ENTER</strong> key when I have highlighted (by tabbing/entering to) a <strong>send</strong> button.</p>
  
  <p>Is there any way in which I can tell if the enter button has been focussed?</p>
  
  <p>I am thinking of something like:</p>
  
  <pre><code>&lt;form (keydown.enter)="isSendFocussed($event)"&gt;
      &lt;input #input1&gt; &lt;!-- input 1 --&gt;
      &lt;input #input2&gt; &lt;!-- input 2 --&gt;
      &lt;input #input3&gt; &lt;!-- input 3 --&gt;
      &lt;button #myButton (click)="sendForm()"&gt;Send&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I would then do something for the <code>isSendFocussed(event)</code> function such as:</p>
  
  <pre><code>@ViewChild('myButton') btn: ElementRef&lt;HTMLInputElement&gt;
  
  isSendFocussed(event) {
      // if (!button is focussed) {
      //     block default functionality and tab across
      // } else {
      //     send form
      // }
  }
  </code></pre>