intercept keyboard event under photon

hello everybody,
I have a photon application run on the front of system and i don’t have this application source code. now, i need intercept keyboard event when this application is running, what i can do for this?
My main question is :
how to set the background application can intercept keyboard event? in normal way, keyevent is send from root region to front application, can i set my application between root and front application to intercept user keyeven and keep front application run in normal way? can you give me a example?

thanks for you attention.