Background Processing of Joystick/Gamepad Input when not in focus

Could you please explain what steps I would need to take in order to overload the function?