Skip to content

Commit

Permalink
Fix InputDevice on distros without hires axes
Browse files Browse the repository at this point in the history
  • Loading branch information
PixlOne committed Aug 22, 2020
1 parent cce1275 commit b554d32
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/logid/InputDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/

#include <system_error>
#include <linux/input-event-codes.h>

#include "InputDevice.h"

Expand Down Expand Up @@ -93,10 +92,15 @@ uint InputDevice::toAxisCode(const std::string& name)
/* Returns -1 if axis_code is not hi-res */
int InputDevice::getLowResAxis(const uint axis_code)
{
/* Some systems don't have these hi-res axes */
#ifdef REL_WHEEL_HI_RES
if(axis_code == REL_WHEEL_HI_RES)
return REL_WHEEL;
#endif
#ifdef REL_HWHEEL_HI_RES
if(axis_code == REL_HWHEEL_HI_RES)
return REL_HWHEEL;
#endif

return -1;
}
Expand Down

0 comments on commit b554d32

Please sign in to comment.