this is not a problem on its own - but rather design decision. So - yes, one cannot receive key strokes/mouse events/touch events outside of application focus.
But you are free to use any of solutions based on:
- low level socket
- NativeProcess input/output channels
to use other process (application) written in language of your choice - which uses low level system api to log key strokes system wide and then route them to your application via socket or NativeProcess channel,