diff options
author | cpasjuste <cpasjuste@gmail.com> | 2020-04-22 18:19:18 +0200 |
---|---|---|
committer | cpasjuste <cpasjuste@gmail.com> | 2020-04-22 18:19:18 +0200 |
commit | eeb40fb079971ece6288e5210e42a9cc3fc95790 (patch) | |
tree | 0c9a1e45861dbdec7a344b6280831527f71f5ca2 /src/input | |
parent | f43e3aa48aeb561f5c7e85f1b7121aab6a61decd (diff) | |
download | manaverse-eeb40fb079971ece6288e5210e42a9cc3fc95790.tar.gz manaverse-eeb40fb079971ece6288e5210e42a9cc3fc95790.tar.bz2 manaverse-eeb40fb079971ece6288e5210e42a9cc3fc95790.tar.xz manaverse-eeb40fb079971ece6288e5210e42a9cc3fc95790.zip |
switch: enable joystick and mouse
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/inputmanager.cpp | 3 | ||||
-rw-r--r-- | src/input/joystick.cpp | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp index b470b66ac..f6e24f904 100644 --- a/src/input/inputmanager.cpp +++ b/src/input/inputmanager.cpp @@ -88,6 +88,9 @@ InputManager::InputManager() : void InputManager::init() restrict2 { +#ifdef __SWITCH__ + SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "1"); +#endif for (size_t i = 0; i < CAST_SIZE(InputAction::TOTAL); i ++) diff --git a/src/input/joystick.cpp b/src/input/joystick.cpp index 1492ba09b..34f2619b9 100644 --- a/src/input/joystick.cpp +++ b/src/input/joystick.cpp @@ -177,8 +177,17 @@ bool Joystick::open() if (mButtonsNumber > MAX_BUTTONS) mButtonsNumber = MAX_BUTTONS; +#ifdef __SWITCH__ + config.setValue("joystick" + toString(mNumber) + "calibrated", true); + config.setValue("leftTolerance" + toString(mNumber), 100); + config.setValue("rightTolerance" + toString(mNumber), 100); + config.setValue("upTolerance" + toString(mNumber), 100); + config.setValue("downTolerance" + toString(mNumber), 100); + config.setValue("useInactiveJoystick", true); +#endif mCalibrated = config.getValueBool("joystick" + toString(mNumber) + "calibrated", false); + mUpTolerance = config.getIntValue("upTolerance" + toString(mNumber)); mDownTolerance = config.getIntValue("downTolerance" + toString(mNumber)); mLeftTolerance = config.getIntValue("leftTolerance" + toString(mNumber)); |