1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-30 03:32:36 +00:00

Adding option for cursor speed when using gamepad

This commit is contained in:
Justin Ivany 2019-07-02 11:19:10 +00:00 committed by Alexei Dobrohotov
parent 31b3fcc07e
commit 643f259cbf
4 changed files with 20 additions and 2 deletions

View File

@ -77,6 +77,7 @@ namespace MWInput
, mSneaking(false)
, mAttemptJump(false)
, mInvUiScalingFactor(1.f)
, mGamepadCursorSpeed(Settings::Manager::getFloat("gamepad cursor speed", "Input"))
, mFakeDeviceID(1)
{
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
// game mode does not move the position of the GUI cursor
float xmove = xAxis * dt * 1500.0f * mInvUiScalingFactor;
float ymove = yAxis * dt * 1500.0f * mInvUiScalingFactor;
float xmove = xAxis * dt * 1500.0f * mInvUiScalingFactor * mGamepadCursorSpeed;
float ymove = yAxis * dt * 1500.0f * mInvUiScalingFactor * mGamepadCursorSpeed;
if (xmove != 0|| ymove != 0 || zAxis != 0)
{
mGuiCursorX += xmove;

View File

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

View File

@ -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.
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.

View File

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