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

Live gestures? #69

Open
Blueforcer opened this issue Mar 18, 2022 · 9 comments
Open

Live gestures? #69

Blueforcer opened this issue Mar 18, 2022 · 9 comments
Labels
feature-request New feature or request help wanted Extra attention is needed

Comments

@Blueforcer
Copy link

Blueforcer commented Mar 18, 2022

Hi,

it seems that any gesture will applied after the gesture was finished on the client.
This means, while scrolling i dont see where i am, only if i release the mouse.
Also if i draw something, the drawing is applied at the same speed, but afterwards.
Looks like playing a recording of the gesture on the client.
Is there any way to have "live" gestures like with teamviewer or Anydesk?

@Blueforcer Blueforcer added the bug Something isn't working label Mar 18, 2022
@bk138 bk138 added feature-request New feature or request and removed bug Something isn't working labels Mar 19, 2022
@bk138
Copy link
Owner

bk138 commented Mar 19, 2022

As your request is understandable, I have to write that this is not possible since Android APIs are the way they are: as of now, you always have to record a gesture first before being able to commit it to the OS, there's no live gestures. See https://github.com/bk138/droidVNC-NG/blob/master/app/src/main/java/net/christianbeier/droidvnc_ng/InputService.java#L248-L264

@bk138 bk138 closed this as completed Mar 19, 2022
@bk138
Copy link
Owner

bk138 commented Mar 19, 2022

If there's another way I don't know of, feel free to post here!

@Blueforcer
Copy link
Author

Blueforcer commented Mar 19, 2022

As your request is understandable, I have to write that this is not possible since Android APIs are the way they are: as of now, you always have to record a gesture first before being able to commit it to the OS, there's no live gestures. See https://github.com/bk138/droidVNC-NG/blob/master/app/src/main/java/net/christianbeier/droidvnc_ng/InputService.java#L248-L264

I'm pretty sure it is possible since it's working on TeamViewer/Anydesk/ Microsofts MyPhone on Android phones. They also do it via accessibility service.
But I'm not a Software Developer so I don't know how these apps archived it.

@Blueforcer
Copy link
Author

Blueforcer commented Mar 19, 2022

@bk138 i decompiled the anydesk plugin and the "Ihr Smartphone Begleiter" and think i found the classes wich do the trick.
Maybe it helps

AnyDesk
AnyDeskGesture.zip

Ihr Smartphone Begleiter
InputInjector.zip

@bk138
Copy link
Owner

bk138 commented Mar 20, 2022

@Blueforcer I've had a look and AnyDesk seems to use the same API, maybe in a different way. If you can come up with an alternative implementation of https://github.com/bk138/droidVNC-NG/blob/master/app/src/main/java/net/christianbeier/droidvnc_ng/InputService.java, I'll happily merge a PR.

@bk138 bk138 reopened this Mar 20, 2022
@bk138 bk138 added the help wanted Extra attention is needed label Mar 20, 2022
@Blueforcer
Copy link
Author

Blueforcer commented Mar 20, 2022

Believe me, if I had a clue about native Android programming I would do it 😂

@Blueforcer
Copy link
Author

Blueforcer commented Mar 21, 2022

Could this work? Splitting every continuegesture in new small gestures

	private void startGesture(int x, int y) {
		mPath = new Path();
		mPath.moveTo( x, y );
		mLastGestureStartTime = System.currentTimeMillis();
	}

	private void continueGesture(int x, int y) {
               endGesture(x, y);
	       startGesture(x, y);
	}

	private void endGesture(int x, int y) {
		mPath.lineTo( x, y );
		GeGestureDescription.StrokeDescription stroke = new GestureDescription.StrokeDescription( mPath, 0, 
                System.currentTimeMillis() - mLastGestureStartTime);
		GestureDescription.Builder builder = new GestureDescription.Builder();
		builder.addStroke(stroke);
		dispatchGesture(builder.build(), null, null);
	}

@bk138
Copy link
Owner

bk138 commented Mar 21, 2022

You might want to try it out! :-) I can't really test/explore things at the moment as I'm busy with $$$-work.

@Blueforcer
Copy link
Author

Nope, doesnt work :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants