title: How to detect first character of input on keypress()
body: <p>I'm using jquery's function <a href="http://api.jquery.com/keypress/" rel="nofollow noreferrer">keypress</a> for my input field</p>
  
  <p>Now, let's say that I want to know when the user types a letter, if this is the first character in the field. I now use something like:</p>
  
  <pre><code>element.keypress(function(e){
      //...
      if(elementValue.length()==0){
          //Do something
      }
  }
  </code></pre>
  
  <p>The problem is when the user selects the text that typed and then presses a key (lets say for the character 'A') that <strong>replaces</strong> it. Then this code returns the length of the old-(soon to be replaced) text.</p>
  
  <p>I know that I could use <strong>keyup</strong> instead, but I think I need to stay with keypress because I have to do some checks for the pressed physical keys. (<a href="https://stackoverflow.com/a/3978257/2667686">this answer</a> really shows the difference between keyup and keypress in this case)</p>
  
  <p>Any suggestions?</p>