How are games such as Fortnite and Call of Duty: Modern Warfare able to detect mouse and keyboard usage on console?

615 views

How are games such as Fortnite and Call of Duty: Modern Warfare able to detect mouse and keyboard usage on console?

In: Technology

3 Answers

Anonymous 0 Comments

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.

Anonymous 0 Comments

The game’s code uses different functions to read from mouse and keyboard than it does for controllers. So it can easily tell which it is receiving input from, and it can report that to the servers so you can see what input devices other players are using.

They wouldn’t be able to tell the difference if you were using some device that you plug a mouse and keyboard into and it pretends they are a controller. But the game would still be interpreting that input as a controller so you wouldn’t necessarily get the full benefit of mouse and keyboard.

Anonymous 0 Comments

Major simplification here, but it’s due to how a controller and a mouse and keyboard send signals to the console. The signals are different and get interpreted by different drivers. You can just “listen” for which driver is being used and voila you can tell if a player is using a controller or mouse and keyboard.