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

An attempt to make native multi-point touch & on-screen keyboard toggle both available to users #1364

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

TrueZhuangJia
Copy link

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


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


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


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

@zhoumother
Copy link

谢谢你,搓屏砖家

@TrueZhuangJia
Copy link
Author

谢谢你,搓屏砖家

感谢认可~

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

Successfully merging this pull request may close these issues.

None yet

2 participants