Get a udev property value for a joystick as an unsigned int
| 304 | |
| 305 | // Get a udev property value for a joystick as an unsigned int |
| 306 | unsigned int getUdevAttributeUint(udev_device* udevDevice, const std::string& attributeName) |
| 307 | { |
| 308 | if (!udevDevice) |
| 309 | return 0; |
| 310 | |
| 311 | if (const char* attribute = getUdevAttribute(udevDevice, attributeName)) |
| 312 | return static_cast<unsigned int>(std::strtoul(attribute, nullptr, 16)); |
| 313 | |
| 314 | return 0; |
| 315 | } |
| 316 | |
| 317 | // Get the joystick vendor id |
| 318 | unsigned int getJoystickVendorId(unsigned int index) |
no test coverage detected