#include "setup.h"
#include "globals.h"
#include "lispreader.h"
+#include "player.h"
#ifdef WIN32
const char * config_filename = "/st_config.dat";
reader.read_int ("joystick-b", &joystick_keymap.b_button);
reader.read_int ("joystick-start", &joystick_keymap.start_button);
reader.read_int ("joystick-deadzone", &joystick_keymap.dead_zone);
+
+ reader.read_int ("keyboard-jump", &keymap.jump);
+ reader.read_int ("keyboard-duck", &keymap.duck);
+ reader.read_int ("keyboard-left", &keymap.left);
+ reader.read_int ("keyboard-right", &keymap.right);
+ reader.read_int ("keyboard-fire", &keymap.fire);
}
void saveconfig (void)
fprintf(config, "\t(joystick-start %d)\n", joystick_keymap.start_button);
fprintf(config, "\t(joystick-deadzone %d)\n", joystick_keymap.dead_zone);
+ fprintf(config, "\t(keyboard-jump %d)\n", keymap.jump);
+ fprintf(config, "\t(keyboard-duck %d)\n", keymap.duck);
+ fprintf(config, "\t(keyboard-left %d)\n", keymap.left);
+ fprintf(config, "\t(keyboard-right %d)\n", keymap.right);
+ fprintf(config, "\t(keyboard-fire %d)\n", keymap.fire);
+
fprintf(config, ")\n");
}
}
}
case MN_TEXTFIELD:
case MN_NUMFIELD:
+ case MN_CONTROLFIELD:
{
int input_pos = input_width/2;
int text_pos = (text_width + font_width)/2;
A_HMIDDLE, A_VMIDDLE, shadow_size);
break;
}
- case MN_CONTROLFIELD:
- {
+// case MN_CONTROLFIELD:
+// {
/* display key */ // FIXME: the key number is not that obvious to the user :P
- char str[12];
+/* char str[12];
sprintf(str, "%i", *pitem.int_p);
input_width = strlen(str) * font_width;
x_pos - (input_width + font_width)/2, y_pos,
A_HMIDDLE, A_VMIDDLE, shadow_size);
break;
- }
+ }*/
case MN_STRINGSELECT:
{
int list_pos_2 = list_width + font_width;
if(item[active_item].kind == MN_CONTROLFIELD)
{
*item[active_item].int_p = event.key.keysym.unicode;
+ if(ch[0] != '\0')
+ strcpy(item[active_item].input, ch);
+ else
+ switch(key)
+ {
+ case SDLK_UP:
+ strcpy(item[active_item].input, "Up cursor");
+ break;
+ case SDLK_DOWN:
+ strcpy(item[active_item].input, "Down cursor");
+ break;
+ case SDLK_LEFT:
+ strcpy(item[active_item].input, "Left cursor");
+ break;
+ case SDLK_RIGHT:
+ strcpy(item[active_item].input, "Right cursor");
+ break;
+ case SDLK_RETURN:
+ strcpy(item[active_item].input, "Return");
+ break;
+ case SDLK_SPACE:
+ strcpy(item[active_item].input, "Space");
+ break;
+ case SDLK_RSHIFT:
+ strcpy(item[active_item].input, "Right Shift");
+ break;
+ case SDLK_LSHIFT:
+ strcpy(item[active_item].input, "Left Shift");
+ break;
+ case SDLK_RCTRL:
+ strcpy(item[active_item].input, "Right Control");
+ break;
+ case SDLK_LCTRL:
+ strcpy(item[active_item].input, "Left Control");
+ break;
+ case SDLK_RALT:
+ strcpy(item[active_item].input, "Right Alt");
+ break;
+ case SDLK_LALT:
+ strcpy(item[active_item].input, "Left Alt");
+ break;
+ default:
+ strcpy(item[active_item].input, "?");
+ break;
+ }
+
menuaction = MENU_ACTION_DOWN;
return;
}