I think there's a check vector thing.
Doc Ai is right, you can check if Platform.VectorX is positive or negative.
The manual should be read <img src="{SMILIES_PATH}/icon_idea.gif" alt=":idea:" title="Idea">
https://www.scirra.com/manual/100/platform
At the bottom
And not to forget the case if VectorX = 0, not moving left or right.