Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: add two QoL settings to IR pointer #10371

Merged
merged 2 commits into from Jan 24, 2022

Conversation

lynxnb
Copy link
Member

@lynxnb lynxnb commented Jan 16, 2022

This PR adds the following settings:

  • IR Mode: IR pointer can now follow the user's finger or be dragged around (see commit description for more info)
  • IR Always recenter: recenter IR after every pointer interaction

These settings come from the MMJ fork, and were cleaned up and ported to the MMJR fork by me. Some users are still using those forks only because of these settings, so I figured I'd port them here too so we can finally get rid of them :)

@JosJuice
Copy link
Member

JosJuice commented Jan 16, 2022

We are trying to move away from using SharedPreferences. Could you add the setting to the new config system instead?

You'll need to add it here:

MAIN_JOYSTICK_REL_CENTER(Settings.FILE_DOLPHIN, Settings.SECTION_INI_ANDROID,

And also here:

static constexpr std::array<const char*, 8> android_setting_saveable = {

This will make it so the setting is saved to an INI file, letting the user carry it with them when they switch phones or switch between Play Store builds and dolphin-emu.org builds.

@BhaaLseN
Copy link
Member

IR Mode sounds a bit like Relative Input on the Desktop version, i wonder if those could (or should?) use the same setting?

Theres also Recenter as hotkey, but nothing that does it automatically (at least i think thats the only place that has it.)

@JosJuice
Copy link
Member

IR Mode sounds a bit like Relative Input on the Desktop version, i wonder if those could (or should?) use the same setting?

While it does sound similar, it's not actually the same. Let's say you're using relative input with a stick on a gamepad. If you hold the stick halfway to the right, a 0.5 input will be sent to InputCommon, and InputCommon will treat this as you wanting to gradually move the pointer to the right for as long as you keep the stick at 0.5. With this new setting on the other hand, we only want the cursor to move when you're dragging the finger across the screen (e.g. when the input is changing from 0.5 to 0.6). Holding the finger steady at 0.5 should result in a steady pointer.

@lynxnb Ignore the mvk-osx-m1 rendering diffs. It's an existing problem, not one caused by your change.

@lynxnb
Copy link
Member Author

lynxnb commented Jan 16, 2022

Sure, I'll move away from SharedPref. Also I'm up for any naming change, current names worked best in my mind but if you think they're confusing, I'll happily change them.

@JosJuice
Copy link
Member

I think they're fine. I don't have any better suggestions personally, at least.

@lynxnb lynxnb force-pushed the android-ir branch 3 times, most recently from 5b97f68 to 2f6bb0f Compare January 16, 2022 21:51
Copy link
Member

@JosJuice JosJuice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM other than one comment.

* Disabled: disables the overlay pointer
* Follow: default behaviour, IR pointer follows touch position
* Drag: IR pointer moves relative to the initial touch event position
@JosJuice JosJuice merged commit b237c74 into dolphin-emu:master Jan 24, 2022
10 checks passed
@lynxnb lynxnb deleted the android-ir branch January 25, 2022 20:42
@chrisleigh-stack

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants