How do I make the gun and bullet follow the target image/sprite on on gamepad?

When playing on the keyboard the gun and bullet normally follow the mouse position (MouseX,MouseY) and everything on that end works fine. However I’m trying to add a gamepad function to the game. I added a target image to make things more clear for the player but the target image and the bullet move seperatly. I’d like the gun and bullet to strictly follow the target image. I would also like for the target image to follow the mouse position so the player can get the same expirience when useing either gamepad or keyboard. Any ideas on what the right event command is? Thanks.