Browse Source

Fix saving of mouse wheel control configs, add support for saving mouse motion control configs

master
C. J. Howard 2 years ago
parent
commit
6463993570
1 changed files with 29 additions and 4 deletions
  1. +29
    -4
      src/game/controls.cpp

+ 29
- 4
src/game/controls.cpp View File

@ -394,16 +394,41 @@ void save_control_profile(game::context* ctx)
switch (wheel_mapping->axis) switch (wheel_mapping->axis)
{ {
case input::mouse_wheel_axis::negative_x: case input::mouse_wheel_axis::negative_x:
mapping_element["device"] = "x-";
mapping_element["wheel"] = "x-";
break; break;
case input::mouse_wheel_axis::positive_x: case input::mouse_wheel_axis::positive_x:
mapping_element["device"] = "x+";
mapping_element["wheel"] = "x+";
break; break;
case input::mouse_wheel_axis::negative_y: case input::mouse_wheel_axis::negative_y:
mapping_element["device"] = "y-";
mapping_element["wheel"] = "y-";
break; break;
case input::mouse_wheel_axis::positive_y: case input::mouse_wheel_axis::positive_y:
mapping_element["device"] = "y+";
mapping_element["wheel"] = "y+";
break;
default:
break;
}
break;
}
case input::mapping_type::mouse_motion:
{
const input::mouse_motion_mapping* motion_mapping = static_cast<const input::mouse_motion_mapping*>(mapping);
mapping_element["device"] = "mouse";
switch (motion_mapping->axis)
{
case input::mouse_motion_axis::negative_x:
mapping_element["motion"] = "x-";
break;
case input::mouse_motion_axis::positive_x:
mapping_element["motion"] = "x+";
break;
case input::mouse_motion_axis::negative_y:
mapping_element["motion"] = "y-";
break;
case input::mouse_motion_axis::positive_y:
mapping_element["motion"] = "y+";
break; break;
default: default:
break; break;

Loading…
Cancel
Save