Is it possible with jQuery to automatically simulate a press on a keyboard, f.ex. inside an html input field?
As explanation: If I press the a inside an input field, an “a” will appear there. I would like to do this not from inside the keyboard, but by pressing a button. I know I could use val("a") on the input but this is not what I want to achieve.
I think trigger() doesn´t help because it only calls the event handler of a keypress event. I do not want to call the handler, but to actively press the keyboard without doing it acually!
I don’t think there is a javascript API for interacting directly with the keyboard. I would suggest combining a change in the field’s value with an event handler firing that would normally correspond to the keyboard press, as you mentioned, so that behavior on the field is triggered as normal.