Keyboard wedge scanner

Does anyone have a simple working example of a keyboard wedge type scanner which does not require clicking on an input and having the soft keyboard also pop up?

My project runs on android and the scanner emulates keypresses. I do not wish to disable the soft keyboard as some short sequences may be entered manually.