title: How to check if command key is pressed while clicking on <a> tag
body: <p>I have overridden the <code>onClick</code> function of anchor() tag in ReactJs to show loading.</p>
  
  <pre><code>const child: ReactElement = Children.only(children);
  
  const childProps = {};
  
  childProps['onClick'] = (event) =&gt; {
  
      if (childProps.href &amp;&amp; child.props.target !== '_blank') {
          props.showSpinner(true);
      }
  
      let onClick = child.props.onClick;
      onClick &amp;&amp; onClick();
  };
  
  return React.cloneElement(child, childProps);
  </code></pre>
  
  <p>But the problem is that if the user clicks on <code>anchor(&lt;a&gt;)</code> with <code>shift</code> and <code>command</code> keypress, then the user switches to the new tab but loading started showing.</p>
  
  <p>So I added the following condition to show loading.</p>
  
  <pre><code>if (!event.shiftKey &amp;&amp; childProps.href &amp;&amp; child.props.target !== '_blank') {
     props.showSpinner(true);
  }
  </code></pre>
  
  <p>This code handled the Shift key press but I have to handle <code>command</code> keypress also.
  I searched through many posts, they showing solution for <code>alt, shift, and ctl</code> keypress but not command keypress.</p>