title: Using keypress event in knockout JS
body: <p>I'm trying to read the contents of an html textbox and fetch data from an API to accomplish a google style auto complete. I'm using <code>twitter bootstrap typeahead</code> for the auto complete functionality. For that I need to record keys as they are pressed and make the API call with the query text.</p>
  
  <p>The html for the text box is this </p>
  
  <pre><code>&lt;input id="query" data-bind="value: query, valueUpdate: 'keypress', event: { keypress: check }"/&gt;
  </code></pre>
  
  <p>My assumption was that this will update the value in the viewmodel as soon as the key is pressed, and the <code>check</code> function will meanwhile call into the API. But the call is made to check( ) and the text box never gets populated when the user types. if the JS looks like this - </p>
  
  <pre><code>function check() {
      alert("Hello");     
      }
  </code></pre>
  
  <p>For every key I press, hello pops up but the text box in the HTML UI does not show the key that was pressed/does not record which key was pressed. How do I record the key press and send the request simultaneously? </p>