Is there a built-in variable which gives the last inserted character of a buffer (inserted by self-insert-command)?
Note that the cursor is not necessarily at the place of the last insertion.

If there is not such a variable, any other solution for defining a variable which determines this character would be helpful.