Problems with Xbox 360 controller switching back and forth from keyboard

Hello! Well, what happend is I am having problems on Forza Motorsport 7 on pc, I dont have a console as well btw, anyways so what happend is I am using my controller but whenever I play it switches to the keyboard all the time and it’s very annoying. So I was wondering, how do I fix this because whenever I steer on the game, it goes back to the keyboard so it stops the steering all the time so how can I fix this?