Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
for (i = BTN_MOUSE; i < BTN_JOYSTICK; i++)
if (test_bit( i, keybit ))
num_buttons++;
//...then some other stuff
//then this...
/* Mouse, Touchscreen or Smartpad ? */
if ((test_bit( EV_KEY, evbit ) && (test_bit( BTN_TOUCH, keybit )
|| test_bit( BTN_TOOL_FINGER, keybit ))) || ((num_rels >= 2
&& num_buttons) || (num_abs == 2 && (num_buttons == 1))))
m_deviceType |= LI_DEVICE_MOUSE;
else if (num_abs && num_buttons) /* Or a Joystick? */
m_deviceType |= LI_DEVICE_JOYSTICK;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment