Merge pull request #8553 from dolphin-emu/document-evdev-heuristic

Document the evdev "interesting" heuristic
This commit is contained in:
Scott Mansell 2020-01-07 22:54:54 +13:00 committed by GitHub
commit 54fd83dc4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -410,8 +410,39 @@ evdevDevice::evdevDevice(const std::string& devnode) : m_devfile(devnode)
// TODO: Add leds as output devices
// Was there some reasoning behind these numbers?
// Filter out interesting devices (see description below)
m_interesting = num_motion_axis != 0 || num_axis >= 2 || num_buttons >= 8;
// On modern linux systems, there are a lot of event devices that aren't controllers.
// For example, the PC Speaker is an event device. Webcams sometimes show up as
// event devices. The power button is an event device.
//
// We don't want these showing up in the list of controllers, so we use this
// heuristic to filter out anything that doesn't smell like a controller:
//
// More than two analog axis:
// Most controllers have at least one stick. This rule will catch all such
// controllers, while ignoring anything with a single axis (like the mouse
// scroll-wheel)
//
// --- OR ---
//
// More than 8 buttons:
// The user might be using a digital only pad such as a NES controller.
// This rule caches such controllers, while eliminating any device with
// only a few buttons, like the power button. Sometimes laptops have devices
// with 5 or 6 special buttons, which is why the threshold is set to 8 to
// match a NES controller.
//
// --- OR ---
//
// Any Motion Axis:
// This rule is to catch any theoretical motion controllers with only a few
// buttons that the user might want to use as a controller.
//
// This heuristic is quite loose. The user may still see weird devices showing up
// as controllers, but it hopefully shouldn't filter out anything they actually
// want to use.
}
evdevDevice::~evdevDevice()