| 1624 | } |
| 1625 | |
| 1626 | void read_inputdevice_config (struct uae_prefs *pr, const TCHAR *option, TCHAR *value) |
| 1627 | { |
| 1628 | struct uae_input_device *id = NULL; |
| 1629 | const struct inputevent *ie; |
| 1630 | int devnum, num, button, joystick, subnum, idnum, keynum, devtype; |
| 1631 | const TCHAR *p; |
| 1632 | TCHAR *p2, *custom; |
| 1633 | struct temp_uids *tid = &temp_uid; |
| 1634 | struct inputdevice_functions *idf = NULL; |
| 1635 | bool directmode = option[5] == '_'; |
| 1636 | |
| 1637 | option += 6; /* "input." */ |
| 1638 | p = getstring (&option); |
| 1639 | if (!_tcsicmp (p, _T("config"))) { |
| 1640 | pr->input_selected_setting = _tstol (value) - 1; |
| 1641 | if (pr->input_selected_setting == -1) |
| 1642 | pr->input_selected_setting = GAMEPORT_INPUT_SETTINGS; |
| 1643 | if (pr->input_selected_setting < 0 || pr->input_selected_setting > MAX_INPUT_SETTINGS) |
| 1644 | pr->input_selected_setting = 0; |
| 1645 | } |
| 1646 | if (!_tcsicmp(p, _T("joymouse_speed_analog"))) |
| 1647 | pr->input_joymouse_multiplier = _tstol(value); |
| 1648 | if (!_tcsicmp(p, _T("joymouse_speed_digital"))) |
| 1649 | pr->input_joymouse_speed = _tstol(value); |
| 1650 | if (!_tcsicmp(p, _T("joystick_deadzone"))) |
| 1651 | pr->input_joystick_deadzone = _tstol(value); |
| 1652 | if (!_tcsicmp(p, _T("joymouse_deadzone"))) |
| 1653 | pr->input_joymouse_deadzone = _tstol(value); |
| 1654 | if (!_tcsicmp(p, _T("mouse_speed"))) |
| 1655 | pr->input_mouse_speed = _tstol(value); |
| 1656 | if (!_tcsicmp(p, _T("autofire"))) |
| 1657 | pr->input_autofire_linecnt = _tstol(value) * 312; |
| 1658 | if (!_tcsicmp(p, _T("autofire_speed"))) |
| 1659 | pr->input_autofire_linecnt = _tstol (value); |
| 1660 | if (!_tcsicmp(p, _T("analog_joystick_multiplier"))) |
| 1661 | pr->input_analog_joystick_mult = _tstol(value); |
| 1662 | if (!_tcsicmp(p, _T("analog_joystick_offset"))) |
| 1663 | pr->input_analog_joystick_offset = _tstol(value); |
| 1664 | if (!_tcsicmp(p, _T("autoswitch"))) |
| 1665 | pr->input_autoswitch = !_tcsicmp(value, _T("true")) || _tstol(value) != 0; |
| 1666 | if (!_tcsicmp(p, _T("autoswitchleftright"))) |
| 1667 | pr->input_autoswitchleftright = !_tcsicmp(value, _T("true")) || _tstol(value) != 0; |
| 1668 | if (!_tcsicmp(p, _T("advancedmultiinput"))) |
| 1669 | pr->input_advancedmultiinput = !_tcsicmp(value, _T("true")) || _tstol(value) != 0; |
| 1670 | if (!_tcsicmp(p, _T("multi_mouse"))) |
| 1671 | pr->input_multi_mouse = !_tcsicmp(value, _T("true")) || _tstol(value) != 0; |
| 1672 | if (!_tcsicmp(p, _T("default_osk"))) |
| 1673 | pr->input_default_onscreen_keyboard = !_tcsicmp(value, _T("true")) || _tstol(value) != 0; |
| 1674 | if (!_tcsicmp(p, _T("joystick_up_button"))) |
| 1675 | pr->input_joystick_up_button = !_tcsicmp(value, _T("true")) || _tstol(value) != 0; |
| 1676 | if (!_tcsicmp(p, _T("keyboard_type"))) { |
| 1677 | cfgfile_strval(p, value, p, &pr->input_keyboard_type, kbtypes, 0); |
| 1678 | keyboard_default = keyboard_default_table[pr->input_keyboard_type]; |
| 1679 | inputdevice_default_kb_all(pr); |
| 1680 | } |
| 1681 | if (!strcasecmp(p, _T("devicematchflags"))) { |
| 1682 | pr->input_device_match_mask = _tstol(value); |
| 1683 | write_log(_T("input_device_match_mask = %d\n"), pr->input_device_match_mask); |
no test coverage detected