C++ Rolling cube controls

Basically I want to have controls similar to:

And have no idea where to start. I have a pawn with a cube mesh spawned in the world, but nothing beyond that. I want to know how to make the cube flip over onto another face based on which direction the user chooses.

Thanks in advance.