Emulate the datawedge but for NFC

I am trying to emulate some of the datawedge functionality for the NFC scanner on a TC70.

The main issue I have is that I am unable to simulate key presses in another app.

I want the user to press a hardware button that will trigger the NFC read (I have the code to do this) and then type the result into the active window.

So far I have found that a service cannot listen for a key press so my next thought was to have an app start on the button press and start the service. This app would then close leaving the original app active which the service could then type into.

I can get a service to type into my app window but when my app is closed the service does not type into the active window.


Any help would be greatly appreciated.


Thank you