TouchScreen Protocol Reference

Conforms to NSObject
Declared in TouchScreen.h

– touchWithX:y:eventType:fingerID:width:height:timestamp: required method

Trigger the touch event of the cloud touch screen.

- (void)touchWithX:(NSNumber *)x y:(NSNumber *)y eventType:(int)eventType fingerID:(int)fingerID width:(int)width height:(int)height timestamp:(long)timestamp

Parameters

x

The coordinate value x of the touch point on the streaming video coordinate system.

y

The coordinate value y of the touch point on the streaming video coordinate system.

eventType

0 for press, 1 for move, 2 for lift.

fingerID

The pointer identifier associated with a particular pointer data index in this event. The identifier tells you the actual pointer number associated with the data, accounting for individual pointers going up and down since the start of the current gesture.

width

The width of the streaming video.

height

The height of the streaming video.

timestamp

The time this event occurred, in the {@link android.os.SystemClock#uptimeMillis} time base. You may obtain this value from {@link android.view.MotionEvent#getEventTime()}.

Discussion

Trigger the touch event of the cloud touch screen.

If you have rendered streaming video on the local view and want to obtain the parameters of the touch event that triggers the cloud touch screen from the touch event of the local view, then you may need to perform some coordinate system conversion, and convert the coordinates of the touch point on the local view to a coordinate value on the streaming video. The coordinate system of the streaming video is based on the upper left corner of the streaming video as the origin, the x-axis is rightward, and the y-axis is downward. For example, the streaming video shown in the figure below is centered and rendered on the local view, and the touch point coordinates (a, b) of the local view need to be converted to coordinates (x, y) in the streaming video coordinate system.

Declared In

TouchScreen.h