There is no API function to determine if your player is moving in a specific direction based on a movement key being held down.
The only way for you to track this would probably be to secure hook the corresponding functions and record in a variable when they are called:
- JumpOrAscendStart() -> AscendStop()
- SitStandOrDescendStart() -> DescendStop();
- MoveForwardStart() -> MoveForwardStop();
- MoveBackwardStart() -> MoveBackwardStop();
- StrafeLeftStart() -> StrafeLeftStop();
- StrafeRightStart() -> StrafeRightStop();
- TurnLeftStart() -> TurnLeftStop();
- TurnOrActionStart() -> TurnOrActionStop(); (this is a mouse movement, like click-to-move)
- TurnRightStart() -> TurnRightStop();