I want to rotate a cube using WASD

But I found it quite compliated because I have to deal with four directions for each side. I am wondering whether there is any classical way to deal with this problem.

add inputs, and this blueprint code.