How to move a character forward during a slide?

How can I move a character forward without holding down the W key in one direction? I’ve made a slide mechanic but I want when I start a roll, all keys are locked and the character keeps moving forward for a while, the camera rotation option should remain, but it should not affect the direction of the slide.

So, while rolling, I need to
Lock all keys except camera rotation, so that the character can rotate his head while moving forward.

Here’s how I implemented the slide (my first-person project)