-
Notifications
You must be signed in to change notification settings - Fork 686
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
An attempt to make native multi-point touch & on-screen keyboard toggle both available to users #1364
Open
TrueZhuangJia
wants to merge
21
commits into
moonlight-stream:master
Choose a base branch
from
TrueZhuangJia:Moonlight-TZJ-EnhancedTouch
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
An attempt to make native multi-point touch & on-screen keyboard toggle both available to users #1364
TrueZhuangJia
wants to merge
21
commits into
moonlight-stream:master
from
TrueZhuangJia:Moonlight-TZJ-EnhancedTouch
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…itter eimination.
…now keyboard toggle behaves just like trackmode
# Conflicts: # app/src/main/java/com/limelight/Game.java
谢谢你,搓屏砖家 |
感谢认可~ |
Minor changes on logic.
…ak in Honkai: Star Rail.
感谢分享,这很有用👍 |
Suggestions:
|
Thanks for the comment.
|
Merge commits from official repo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I re-enabled native touch, and try to resolve keyboard toggle by letting the user decide how many fingers to tap.
It's up to user to completely disable keyboard toggle in native-touch, or select number of fingers to tap from 3 to 10, by a seekbar.
The tap & toggle behaves exactly the same with trackpad mode, it only triggers toggling when user tap & quickly lift up their fingers. Only difference is the configurable finger number to prevent keyboard from being invoked unexpectly. For example, a 2-finger operated game like the Mihoyo ones, it's recommended to set 4 for tablet (some times your left palm touches the screen creating the 3rd pointer), and 3 for cellphone.
Further more, this finger number configuration only takes effect in native multi-point touch.
This is an option to disable view.requestUnbufferedDispatch in onTouch() callback if set true, it syncs touch event with display refresh... This one doesn't make too much sense, you feel better with it enabled in some cases.
This is an option to simulate iOS behavior. In iOS if you long press a location on the screen, it generates only 1 touch event on the moment of first contact, sunshine has to repeat it to Windows to prevent drop of touch. However it works better in cases where stability of long press is needed, like operating Scaramouche in Genshin Impact, iOS verion has a more stable view while he is flying.
User can define the size to supress long press by a seekbar, with a value of pixels. Flat region area is (pixelValue*2)^2.
This is an interesting feature to enhance native multi-point touch.
Screen will be divided to 2 areas by "Enhance touch zone divider":
the native touch zone (on the left by default), on which pointer coords are passed through to server;
the enhanced touch zone (on the right by defaut), on which pointer coords can be manipulated before sending to server.
This is particularly useful when view rotation is too sensitive by default in some game, by setting "pointer velocity factor" to less than 100%, the pointer with first contact located on the enhanced touch zone moves slower on server, and pointers initiated on the native touch zone are not affected.
To deal with this I write a NativeTouchHandler class, for handling additional pointer infos & functionality.
I'm not a programmer and this is my first Android project. I started this fork because I'm a Genshin Impact enthusiast who started the game on a tablet, and not getting used to mouse-keyboard or game controller playing. the game got a mobile UI on PC version discovered last December and I can't miss the opportunity to stream it from PC with the highest graphic quality, and play it just like on tablet.
My code could be rubbish but please consider the features I implemented, especially the first one I mentioned(enabling native touch with configurable keyboard toggle tap), it could help a lot of player as we got a big IM group chatting streaming Mihoyo game from PC.
It would be even better if the iOS version has native touch implemented officially, since it's such a pain in the S to sideload unsigned app on iOS...
By the way anybody who is interested in native-touch on iOS moonlight, check my fork:
https://github.com/TrueZhuangJia/moonlight-ios-NativeMultiTouchPassthrough
Thank you so much for your attention.