Moving mouse cursor with gamepad

I am looking for a solution to move the mouse cursor with the gamepad in my menu widgets and be able to click on buttons with the cursor.

I have tried the code provided here on the forums, but the cursor keeps disappearing as soon as I start moving the thumbstick.

Why is it so hard to get this functionality working?