I am setting up a form for entering Spanish Verbs. I want to be able to use js-hotkeys plugin to create a shortcut to add accented letters.
I have this so far
$('#presentTense input').bind('keyup', 'Ctrl+a', function () {
this.value = this.value + ('á');
});
which is fine as they are typing and it adds the accented letter to the end of what they have typed. The problem is that if they want to go back and insert an accented letter into the middle of a word that has already been typed to fix an error or omission, this method adds the accented letter to the end of the word.
Can anyone tell me a method to use to insert the letter where the cursor is whether at the end or in the middle of a word in an input text field?