I've been using keyup to detect when content in a textarea changes, but somehow Facebook can detect a Ctrl+X event in a textbox immediately when the X is pressed down. What event would this be?
Most current browsers support cut
, copy
and paste
events. Try the following to prove this to yourself:
<textarea oncut="alert('Cut!')" rows="3" cols="40"></textarea>
I would guess they make a bind to the keydown, and set some sort of state variable when the control key is pressed, then when they receive a keyup event, they check the state variable and act accordingly.
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