Error out if the device returns a negative number of buttons

Authored by aacid on Sep 20 2017, 10:30 PM.

Description

Error out if the device returns a negative number of buttons

Summary:
btnx[1] is reporting a negative number of buttons in my machine (-87) so
ignore it instead of crashing (once we have negative buttons things quite don't work),
ignoring is not wrong since after all btnx is not a joystick

[1] https://github.com/cdobrich/btnx

Reviewers: davidedmundson

Reviewed By: davidedmundson

Subscribers: plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D7900