Android Question gesturedetector CreateMotionEvent

shb777

Active Member
Licensed User
Longtime User
Does anyone know how to use gesture detector library's CreateMotionEvent, preferably with a code example that works.
 

Informatix

Expert
Licensed User
Longtime User
From the Gesture Detector contextual help:
Creates a MotionEvent to be used with PassTouchEventTo.
downTime: The time (in ms) when the user originally pressed down to start a stream of position events.
eventTime: The time (in ms) when this specific event was generated.
Action: The kind of action being performed. One of the ACTION constants.
X: The X coordinate of this event.
Y: The Y coordinate of this event.
-> GD.CreateMotionEvent(0, DateTime.Now, GD.ACTION_... or Activity.ACTION_..., x, y)
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User
Hi Informatix. I want to use your PassTouchEventTo method to click on the DJICameraCaptureWidget in my DJI app, so I can automatically start video recording, when the drone is powered up. I'm able to click on a panel with the code below.


B4X:
MEv= GD.CreateMotionEvent(200,DateTime.Now, Activity.ACTION_UP, 10dip, 10dip)
    GD.PassTouchEventTo(MEv,pnlCamera)

I placed the DJICameraCaptureWidget on a panel, but then the DJICameraCaptureWidget isn't even visible, and I can't click on it. Is it possible
to click on a widget with your gesturedetector library? steve
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
Hi Informatix. I want to use your PassTouchEventTo method to click on the DJICameraCaptureWidget in my DJI app, so I can automatically start video recording, when the drone is powered up. I'm able to click on a panel with the code below.


B4X:
MEv= GD.CreateMotionEvent(200,DateTime.Now, Activity.ACTION_UP, 10dip, 10dip)
    GD.PassTouchEventTo(MEv,pnlCamera)

I placed the DJICameraCaptureWidget on a panel, but then the DJICameraCaptureWidget isn't even visible, and I can't click on it. Is it possible
to click on a widget with your gesturedetector library? steve
I don't know the library that you use so I have no idea of what DJICameraCaptureWidget can be. If it's a widget on the home screen, then you cannot send events outside of the app so it won't work.
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User
I don't know the library that you use so I have no idea of what DJICameraCaptureWidget can be. If it's a widget on the home screen, then you cannot send events outside of the app so it won't work.
It's a widget on my app but I guess all widgets are outside my process so I guess it won't work
 
Upvote 0
Top