Peak & Lean Left or Right Blueprint for FPP/TPP?

I’m making an FPS game, I want the character to be able to peak and lean left or right using the Q and E keys. I have the 3rd person animations available for the 3rd person model. I need it to be able to work in 3rd Person and have the character camera move left or right when leaning. How can I set up a character blueprint for 3rd Person to play the animations while holding down the Q or E key and then when you let go, you go back to the idle state, how can I set this up in the blueprint for my character and make it play the animations? I also need it to work for 1st person view.