Created
March 15, 2013 03:02
-
-
Save jeffgriffin/5167200 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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