Using jQuery, I would like to capture a keyboard event that is:
You could listen on keydown
event and store the value in a variable. That variable would have the value as it was before the new input, and the new input would be included in the keyup
event
UPDATE:
Ok, I misunderstood your requirements, but there isn't an event that would meet your needs. The only thing I can think of to simulate this behaviour is the following:
keydown/keypress
event
object (get event.which
, then convert it to actual value)Here is a fiddle: http://jsfiddle.net/HpXuU/13/
This is obviously not a perfect solution, as it needs some (one might argue unnecessary) work to get done right. I would advise to rethink your needs, but if this behavior is absolutely what you need, I think this is a step in the right direction.