Made uimodekey default to "auto" and let OSD decide about default key. (no credit)

This commit is contained in:
Miodrag Milanovic 2010-02-14 14:15:55 +00:00
parent 9621c5bcbc
commit a347804fe3
2 changed files with 12 additions and 6 deletions

View File

@ -130,11 +130,7 @@ const options_entry mame_core_options[] =
{ "joystick_deadzone;joy_deadzone;jdz", "0.3", 0, "center deadzone range for joystick where change is ignored (0.0 center, 1.0 end)" },
{ "joystick_saturation;joy_saturation;jsat", "0.85", 0, "end of axis saturation range for joystick where change is ignored (0.0 center, 1.0 end)" },
{ "natural;nat", "0", OPTION_BOOLEAN, "specifies whether to use a natural keyboard or not" },
#if defined(__APPLE__) && defined(__MACH__)
{ "uimodekey;umk", "ITEM_ID_INSERT", 0, "specifies the key used to toggle between full and partial UI mode" },
#else
{ "uimodekey;umk", "ITEM_ID_SCRLOCK", 0, "specifies the key used to toggle between full and partial UI mode" },
#endif
{ "uimodekey;umk", "auto", 0, "specifies the key used to toggle between full and partial UI mode" },
/* input autoenable options */

View File

@ -1584,6 +1584,7 @@ void osd_customize_input_type_list(input_type_desc *typelist)
{
int mameid_code ,ui_code;
input_type_desc *typedesc;
const char* uimode;
// loop over the defaults
for (typedesc = typelist; typedesc != NULL; typedesc = typedesc->next)
@ -1592,7 +1593,16 @@ void osd_customize_input_type_list(input_type_desc *typelist)
{
// configurable UI mode switch
case IPT_UI_TOGGLE_UI:
mameid_code = lookup_mame_code((const char *)options_get_string(mame_options(), SDLOPTION_UIMODEKEY));
uimode = (const char *)options_get_string(mame_options(), SDLOPTION_UIMODEKEY);
if(!strcmp(uimode,"auto")) {
#if defined(__APPLE__) && defined(__MACH__)
mameid_code = lookup_mame_code("ITEM_ID_INSERT");
#else
mameid_code = lookup_mame_code("ITEM_ID_SCRLOCK");
#endif
} else {
mameid_code = lookup_mame_code(uimode);
}
ui_code = INPUT_CODE(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, mameid_code);
input_seq_set_1(&typedesc->seq[SEQ_TYPE_STANDARD], ui_code);
break;