Adding option for cursor speed when using gamepad

pull/541/head
Justin Ivany 6 years ago committed by Alexei Dobrohotov
parent 31b3fcc07e
commit 643f259cbf

@ -77,6 +77,7 @@ namespace MWInput
, mSneaking(false) , mSneaking(false)
, mAttemptJump(false) , mAttemptJump(false)
, mInvUiScalingFactor(1.f) , mInvUiScalingFactor(1.f)
, mGamepadCursorSpeed(Settings::Manager::getFloat("gamepad cursor speed", "Input"))
, mFakeDeviceID(1) , mFakeDeviceID(1)
{ {
mInputManager = new SDLUtil::InputWrapper(window, viewer, grab); mInputManager = new SDLUtil::InputWrapper(window, viewer, grab);
@ -558,8 +559,8 @@ namespace MWInput
// We keep track of our own mouse position, so that moving the mouse while in // We keep track of our own mouse position, so that moving the mouse while in
// game mode does not move the position of the GUI cursor // game mode does not move the position of the GUI cursor
float xmove = xAxis * dt * 1500.0f * mInvUiScalingFactor; float xmove = xAxis * dt * 1500.0f * mInvUiScalingFactor * mGamepadCursorSpeed;
float ymove = yAxis * dt * 1500.0f * mInvUiScalingFactor; float ymove = yAxis * dt * 1500.0f * mInvUiScalingFactor * mGamepadCursorSpeed;
if (xmove != 0|| ymove != 0 || zAxis != 0) if (xmove != 0|| ymove != 0 || zAxis != 0)
{ {
mGuiCursorX += xmove; mGuiCursorX += xmove;

@ -209,6 +209,7 @@ namespace MWInput
std::map<std::string, bool> mControlSwitch; std::map<std::string, bool> mControlSwitch;
float mInvUiScalingFactor; float mInvUiScalingFactor;
float mGamepadCursorSpeed;
private: private:
void convertMousePosForMyGUI(int& x, int& y); void convertMousePosForMyGUI(int& x, int& y);

@ -133,3 +133,16 @@ which are always sent if a controller is present and detected.
Disabling this setting can be useful for working around controller-related issues or for setting up split-screen gameplay configurations. Disabling this setting can be useful for working around controller-related issues or for setting up split-screen gameplay configurations.
This setting can be toggled in game with the Enable Joystick button in the Controls panel of the Options menu. This setting can be toggled in game with the Enable Joystick button in the Controls panel of the Options menu.
gamepad cursor speed
--------------------
:Type: float
:Range: >0
:Default: 1.0
This setting controls the speed of the cursor within GUI mode when using the joystick.
This setting has no effect on the camera rotation speed, which is controlled by the
camera sensitivity setting.
This setting can only be configured by editing the settings configuration file.

@ -364,6 +364,9 @@ invert y axis = false
# Enable controller support. # Enable controller support.
enable controller = true enable controller = true
# Emulated gamepad cursor sensitivity.
gamepad cursor speed = 1.0
[Saves] [Saves]
# Name of last character played, and default for loading save files. # Name of last character played, and default for loading save files.

Loading…
Cancel
Save