The game looks for inputs that can’t be generated with a controller. For example, an analog stick can’t be moved from its dead left position to its dead right position without moving through the center, but a mouse can easily change direction from moving left to moving right within a single frame of the game. Also, some buttons on a controller can’t be pushed at the same time – for example opposing directional keys on the d-pad.
Also, the game can distinguish a trigger press from a button press, since the trigger actually measures how much it is pressed rather than just going on and off.
Latest Answers