Rotation difference based on input direction for locomotion

Greetings,

I am trying to implement start animations to my locomotion system and i need to get the yaw difference in actor rotation against input direction (when character is facing forward and when i press S key to turn back it should give me 180/ or when character is facing right then i press W key to turn forward it should give me -90), so i can use that value to choose what locomotion start animation should play

I was using below logic but it just gives me a yaw value based on the cardinal direction. I want to get the yaw difference based on input direction

im using a forward facing locomotion (not sure about if its the correct terminology), not a strafing locomotion.

I hope im clear enough explaining my issue. Please feel free to ask for any information and thanks in advance!