1 /* $Id: joydefs.c,v 1.6 2003-03-14 05:11:29 btb Exp $ */
20 extern int num_joysticks;
22 int joydefs_calibrate_flag = 0;
24 void joydefs_calibrate()
26 joydefs_calibrate_flag = 0;
29 nm_messagebox( NULL, 1, TXT_OK, TXT_NO_JOYSTICK );
33 //Actual calibration if necessary
37 void joydef_menuset_1(int nitems, newmenu_item * items, int *last_key, int citem )
40 int oc_type = Config_control_type;
47 if (items[i].value) Config_control_type = i;
49 if (Config_control_type == 2) Config_control_type = CONTROL_MOUSE;
51 if ( (oc_type != Config_control_type) && (Config_control_type == CONTROL_THRUSTMASTER_FCS ) ) {
52 nm_messagebox( TXT_IMPORTANT_NOTE, 1, TXT_OK, TXT_FCS );
55 if (oc_type != Config_control_type) {
56 switch (Config_control_type) {
58 case CONTROL_JOYSTICK:
59 case CONTROL_FLIGHTSTICK_PRO:
60 case CONTROL_THRUSTMASTER_FCS:
61 case CONTROL_GRAVIS_GAMEPAD:
62 // case CONTROL_MOUSE:
63 // case CONTROL_CYBERMAN:
64 joydefs_calibrate_flag = 1;
73 int i, i1 = 5, j, nitems = 10;
75 m[0].type = NM_TYPE_RADIO; m[0].text = "KEYBOARD"; m[0].value = 0; m[0].group = 0;
76 m[1].type = NM_TYPE_RADIO; m[1].text = "JOYSTICK"; m[1].value = 0; m[1].group = 0;
77 m[2].type = NM_TYPE_RADIO; m[2].text = "MOUSE"; m[2].value = 0; m[2].group = 0;
78 m[3].type = NM_TYPE_TEXT; m[3].text="";
79 m[4].type = NM_TYPE_MENU; m[4].text = TXT_CUST_ABOVE;
80 m[5].type = NM_TYPE_TEXT; m[5].text = "";
81 m[6].type = NM_TYPE_SLIDER; m[6].text = TXT_JOYS_SENSITIVITY; m[6].value = Config_joystick_sensitivity; m[6].min_value =0; m[6].max_value = 16;
82 m[7].type = NM_TYPE_TEXT; m[7].text = "";
83 m[8].type = NM_TYPE_MENU; m[8].text = TXT_CUST_KEYBOARD;
84 m[9].type = NM_TYPE_MENU; m[9].text = "CUSTOMIZE D2X KEYS";
88 i = Config_control_type;
89 if(i==CONTROL_MOUSE) i = 2;
92 i1 = newmenu_do1( NULL, TXT_CONTROLS, nitems, m, joydef_menuset_1, i1 );
94 Config_joystick_sensitivity = m[6].value;
96 for (j = 0; j <= 2; j++)
98 Config_control_type = j;
99 i = Config_control_type;
100 if (Config_control_type == 2)
101 Config_control_type = CONTROL_MOUSE;
105 kconfig (i, m[i].text);
108 kconfig(0, "KEYBOARD");
111 kconfig(4, "D2X KEYS");