View gist:4b84bb61ad11206d1daeec1baedeacee
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
using Sandbox.Game.EntityComponents; | |
using Sandbox.ModAPI.Ingame; | |
using Sandbox.ModAPI.Interfaces; | |
using SpaceEngineers.Game.ModAPI.Ingame; | |
using System.Collections.Generic; | |
using System.Collections; | |
using System.Linq; | |
using System.Text; | |
using System; | |
using VRage.Collections; |
View gist:5167698
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 = 0; i < 2; i++) { | |
input_set_abs_params(input_dev, ABS_X+i, 32, 223, 0, 10); //In theory, all axes operate from 0 to 255. In practice, the plastic enclosure and other mechanical realities limit extremes and there is a great variance in achievable extremes and centers. Values below are based on worst-case scenarios for extremes among a set of controllers. -Jeff Griffin | |
input_set_abs_params(input_dev, ABS_RX+i, 50, 205, 0, 10); | |
input_set_abs_params(input_dev, ABS_GAS+i, -149, 222, 0, 10); // False bottom prevents negative gas/brake. In practice, min/center~35, max~222 | |
input_set_abs_params(input_dev, ABS_HAT0X+i, -1, 1, 0, 0); | |
} |
View gist:5167319
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
+diff -Naur a/xbmc/input/linux/LinuxInputDevices.cpp b/xbmc/input/linux/LinuxInputDevices.cpp | |
+--- a/xbmc/input/linux/LinuxInputDevices.cpp 2013-02-26 06:14:43.000000000 -0500 | |
++++ b/xbmc/input/linux/LinuxInputDevices.cpp 2013-03-04 14:12:57.987335260 -0500 | |
+@@ -1066,6 +1066,13 @@ | |
+ /* fill device info structure */ | |
+ GetInfo(fd); | |
+ | |
++ if (m_deviceType==LI_DEVICE_NONE) | |
++ { | |
++ CLog::Log(LOGERROR, "CLinuxInputDevice %s: Unknown device type.", m_deviceName); |
View gist:5167210
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
if [ "$DISPLAYSERVER" = "xorg-server" ]; then | |
SDL_SUPPORT="yes" | |
else | |
SDL_SUPPORT="no" | |
fi | |
#..some other things happen... | |
if [ "$SDL_SUPPORT" = no ]; then | |
JOYSTICK_SUPPORT="no" |
View gist:5167200
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; |
View gist:5166816
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
typedef enum | |
{ | |
LI_DEVICE_NONE = 0, | |
LI_DEVICE_MOUSE = 1, | |
LI_DEVICE_JOYSTICK = 2, | |
LI_DEVICE_KEYBOARD = 4, | |
LI_DEVICE_REMOTE = 8 | |
} LinuxInputDeviceType; |