analytics: Collect less data about controllers.

The name field can contain personal information, particularly in the
case of bluetooth devices on OSX which get configured with the user's
full name.
This commit is contained in:
Scott Mansell 2016-06-22 01:33:53 +12:00
parent ce4e6804a5
commit 2ec3a24e4e
3 changed files with 18 additions and 5 deletions

View file

@ -117,3 +117,17 @@ bool InputConfig::ControllersNeedToBeCreated() const
{
return m_controllers.empty();
}
bool InputConfig::IsControllerControlledByGamepadDevice(int index) const
{
if (static_cast<size_t>(index) >= m_controllers.size())
return false;
const auto& controller = m_controllers.at(index).get()->default_device;
// Filter out anything which obviously not a gamepad
return !((controller.source == "Keyboard") // OSX Keyboard/Mouse
|| (controller.source == "XInput2") // Linux and BSD Keyboard/Mouse
|| (controller.source == "Android" && controller.name == "Touchscreen") // Android Touchscreen
|| (controller.source == "DInput" && controller.name == "Keyboard Mouse")); // Windows Keyboard/Mouse
}