include "target.tmh"
int main()
{
Configure(&HCougar, MODE_EXCLUDED);
Configure(&T16000, MODE_EXCLUDED);
Configure(&LMFD, MODE_EXCLUDED);
Configure(&RMFD, MODE_EXCLUDED);
if(Init(&EventHandle)) return 1;
SetKBRate(32, 50);
SetKBLayout(KB_GER);
SetShiftButton(0, 0, 0, 0, 0, 0);
// Physische Achsen auf die Virtuellen Achsen mappen
MapAxis(&Joystick, JOYX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&Joystick, JOYY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&Throttle, SCX, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&Throttle, SCY, DX_YROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&Throttle, THR_RIGHT, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&Throttle, THR_LEFT, DX_ZROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&Throttle, THR_FC, DX_SLIDER_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
// Deadzones fuer die Achsen festlegen
// Die Werte 1 und 3 legen die Deadzones um den Nullpunkt fest
// 15 sind die Werte fuer die aeusseren Deadzones (link/rechts/vorne/hinten) und bewirken bei ~75%
// Joystick-Weg einen Vollausschlag des Ruders ingame
SetSCurve(&Joystick, JOYX, 15, 1, 15, 0, 0);
SetSCurve(&Joystick, JOYY, 15, 3, 15, 0, 0);
SetSCurve(&Throttle, SCX, 0, 0, 0, 0, 0);
SetSCurve(&Throttle, SCY, 0, 0, 0, 0, 0);
SetSCurve(&Throttle, THR_RIGHT, 0, 0, 0, 0, 0);
SetSCurve(&Throttle, THR_LEFT, 0, 0, 0, 0, 0);
SetSCurve(&Throttle, THR_FC, 0, 0, 0, 0, 0);
// Tasten Mappings
MapKey(&Throttle, CHF, L_ALT + 'h'); // Hyperjump
MapKey(&Throttle, CHB, L_ALT + 's'); // Supercruise
MapKey(&Throttle, EACON, CHAIN(PULSE + L_ALT + 'g', LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1))); // Fahrwerk + Status LED
MapKey(&Throttle, EACOFF, CHAIN(PULSE + L_ALT + 'g', LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1)));
MapKey(&Throttle, RDRNRM, CHAIN(PULSE + L_ALT + 'c', LED(&Throttle, LED_ONOFF, LED_CURRENT+LED2))); // Frachtgreifer + Status LED
MapKey(&Throttle, RDRDIS, CHAIN(PULSE + L_ALT + 'c', LED(&Throttle, LED_ONOFF, LED_CURRENT-LED2)));
}
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
}