Please stop using sudo for accessing all files. Using sudo in this way can be very dangerous.
Files in your home-directory shouldn’t require root rights to be accessible. If there’s a file that does require it, something is terribly wrong.
If you have to use sudo to access a file, it normally means that you can break your system (or atleast a part of your) if you’re doing something wrong. So always be sure about your changes if your system asks you for a root password.
About the gamepads:
Does your RPi register that there’s a gamepad connected via USB? You can check all USB-devices with lsusb.
Replug your gamepad while your RPi is running. After that check if dmesg has any useful information for you.