Can I determine which key was previously pressed?
$("#divex").keypress(getKey);
function getKey(e)
{
//alert previous key pressed to e ???
alert(e.which); //gets current key ascii code
}
You can store it in a variable:
var prevKey = null;
$("#divex").keypress(getKey);
function getKey(e)
{
if (prevKey !== null) alert(prevKey);
prevKey = e.which;
alert(e.which); //gets current key ascii code
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With