I'm trying to capture the character just entered into a <textarea>
, but I can only get which key is pressed via key event like keydown
or keyup
, not knowing if it's lower case or upper case.
For example, when I input A or a, the event key codes for keydown
are all 65.
I thought of using val()
to get the string in the <textare>
and get the last character of it, but that is too slow and memory consuming, since I want to record every keyboard event while the user is typing.
So is there a way I can simply get the last entered character?