Added onKey and onText methods to publicapi for the purpose of injecting keypresses from a softkeyboard