title: Pushing Ctrl + F to change focus to input and display search
body: <p>I have the following Javascript/jQuery code that focuses on an input field. </p>
  
  <pre><code>window.addEventListener("keydown",function (e) {
      if (e.keyCode === 114 || (e.ctrlKey &amp;&amp; e.keyCode === 70)) { 
          e.preventDefault();
          $('#search').focus();
      }
  })
  </code></pre>
  
  <p>However I want to make it that so that if the user presses Ctrl+F again after being in focus of the search field, it would open up the default browser search window.</p>
  
  <p>My idea was to change the code to:</p>
  
  <pre><code>window.addEventListener("keydown",function (e) {
      if (e.keyCode === 114 || (e.ctrlKey &amp;&amp; e.keyCode === 70)){
          if($('#search').not(":focus")) {
              e.preventDefault();
              console.log("Search is not in focus");
              $('#search').focus();
          } else {
              console.log("Default action of CtrlF")
              return true;
          }
      }
  })
  </code></pre>
  
  <p>But that did not work (it always thinks search is not in focus even though it is)</p>