Calculate 8 different directional input based on arrow keys combinations Considering I have four variables event binded to each arrow key, that can be 0 or 1 My current approach to this issue is simply 8 nested ifs checking each combination or keys Is there a more math y clever way to solve this issue?