WO2017166858A1 - Method and device for reversely controlling mobile page - Google Patents

Method and device for reversely controlling mobile page Download PDF

Info

Publication number
WO2017166858A1
WO2017166858A1 PCT/CN2016/108933 CN2016108933W WO2017166858A1 WO 2017166858 A1 WO2017166858 A1 WO 2017166858A1 CN 2016108933 W CN2016108933 W CN 2016108933W WO 2017166858 A1 WO2017166858 A1 WO 2017166858A1
Authority
WO
WIPO (PCT)
Prior art keywords
event
gesture
click
drag
touch
Prior art date
Application number
PCT/CN2016/108933
Other languages
French (fr)
Chinese (zh)
Inventor
黎河军
Original Assignee
百度在线网络技术(北京)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 百度在线网络技术(北京)有限公司 filed Critical 百度在线网络技术(北京)有限公司
Publication of WO2017166858A1 publication Critical patent/WO2017166858A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • G06F3/04883Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures for inputting data by handwriting, e.g. gesture or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Definitions

  • the present invention relates to the field of Internet technologies, and in particular, to a method and apparatus for controlling a mobile page in reverse.
  • the online solution of the projection mobile phone interface to the vehicle display is often used.
  • the operation performed by the user on the vehicle end is synchronously transmitted to the mobile terminal, and the mobile terminal receives the operation to actively trigger the relevant page.
  • the binding behavior of the element is often used.
  • HTML HyperText Markup Language
  • the event is generated by using the underlying event interface of the mobile phone system to generate an event, thereby transmitting an event to the page element at the system level, thereby triggering the binding behavior of the page element.
  • the existing mobile operating system limits the use of the interface, for example, in the iOS system requires auditing, in the android system needs to have root privileges. Therefore, the reverse control implemented by the underlying event interface of the mobile phone system is not convenient in application.
  • the present invention aims to solve at least one of the technical problems in the related art to some extent.
  • an object of the present invention is to provide a method for reversely controlling a mobile page, which can avoid the limitation of the interface used by the mobile operating system and conveniently implement reverse control of the mobile page.
  • Another object of the present invention is to provide an apparatus for back-controlling a mobile page.
  • a method for reversely controlling a mobile page includes: receiving a touch event sent by another terminal for reverse control; identifying a gesture event according to the touch event, and Determining an element to be inversely controlled; if the element is an element in an HTML page, configuring an HTML parameter for the element according to the gesture event, such that the element is processed according to the HTML parameter in response to the gesture event.
  • the method for back-controlling a mobile page proposed by the first aspect of the present invention, by configuring an HTML parameter according to a gesture event, when an element to be reversely controlled is an element in an HTML page,
  • the element can be processed according to the configured HTML parameters in response to the gesture event, thereby implementing reverse control of the elements in the HTML page, and the reverse control flow does not invoke the interface of the operating system, thereby avoiding the interface of the mobile operating system
  • the restrictions used make it easy to implement reverse control of the mobile page.
  • an apparatus for reversely controlling a mobile page includes: a communication module, configured to receive a touch event sent by another terminal for reverse control; and a gesture recognition module, configured to: Identifying a gesture event according to the touch event, and determining an element to be inversely controlled; and a conversion module, configured to configure an HTML parameter for the element according to the gesture event if the element is an element in an HTML page, The element is processed in response to the HTML parameter in response to the gesture event.
  • the device for back-controlling a mobile page proposed by the second aspect of the present invention can make an element according to a configured HTML by configuring an HTML parameter according to a gesture event when an element to be inversely controlled is an element in an HTML page.
  • the parameters are processed in response to the gesture event, thereby implementing reverse control of the elements in the HTML page, and the reverse control flow does not invoke the interface of the operating system, thereby avoiding the limitation of the interface used by the mobile operating system, and conveniently implementing Reverse control of the mobile page.
  • the embodiment of the present application further provides a terminal, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to: receive a touch event sent by another terminal for reverse control Identifying a gesture event based on the touch event and determining a to-be-controlled An element; if the element is an element in an HTML page, configuring an HTML parameter for the element according to the gesture event such that the element is processed according to the HTML parameter in response to the gesture event.
  • the embodiment of the present application further provides a non-transitory computer readable storage medium, when the instructions in the storage medium are executed by a processor of the terminal, enabling the terminal to perform a method for back-controling the mobile page.
  • the method includes: receiving a touch event sent by another terminal for reverse control; identifying a gesture event according to the touch event, and determining an element to be inversely controlled; if the element is an element in an HTML page, according to The gesture event configures an HTML parameter for the element to cause the element to process in accordance with the HTML parameter in response to the gesture event.
  • the embodiment of the present application further provides a computer program product, when an instruction in the computer program product is executed by a processor, performing a method for back-controlling a mobile page, the method comprising: receiving a sending by another terminal a touch event for reverse control; recognizing a gesture event based on the touch event, and determining an element to be inversely controlled; if the element is an element in an HTML page, configuring the element according to the gesture event An HTML parameter to cause the element to process in accordance with the HTML parameter in response to the gesture event.
  • FIG. 1 is a schematic flow chart of a method for back-controling a mobile page according to an embodiment of the present invention
  • FIG. 2 is a schematic flow chart of a method for back-controling a mobile page according to another embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a click event recognition process receiving a press event in the embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a mobile event after receiving a click event in a click event identification process according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of a click event recognition process receiving a release event in an embodiment of the present invention
  • FIG. 6 is a schematic diagram of a double-click event identification process in an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a double-click event recognition process after receiving a mobile event in an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of receiving a press event in a drag event recognition process in an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of a motion event after receiving a motion event in a drag event recognition process according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of receiving a release event in a drag event recognition process according to an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of an apparatus for back-controling a mobile terminal according to an embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of an apparatus for back-controlling a mobile terminal according to another embodiment of the present invention.
  • FIG. 1 is a schematic flow chart of a method for back-controling a mobile page according to an embodiment of the present invention. The method of this embodiment can be applied to the mobile terminal.
  • the method of this embodiment includes:
  • S11 Receive a touch event sent by another terminal for reverse control.
  • Other terminals refer to the peers that are connected to the mobile terminal.
  • the mobile terminal refers to a mobile phone
  • the other terminal refers to a car phone.
  • the car machine can send a reverse control event to the mobile phone, and the event is a native event of the application, specifically a touch event.
  • Touch events include: pressing an event, moving an event, and releasing an event.
  • Each touch event can include a corresponding parameter.
  • the representation of each touch event and the parameters included may be as follows:
  • the parameter location represents the pressed position coordinate (x, y);
  • parameter points indicate the number of touch points (single finger / double finger / multi finger);
  • Second touch event Move event: NATIVE_EVENT_TOUCH_MOVE
  • the parameter location represents the position coordinate (x, y) to which it is moved;
  • parameter points indicate the number of touch points (single finger / double finger / multi finger);
  • S12 Identify a gesture event according to the touch event, and determine an element to be reversely controlled.
  • the gesture event is an event for triggering the element response.
  • Gesture events include: click events, double click events, long press events, and drag events.
  • Each gesture event can include a corresponding parameter.
  • the representation of each gesture event and the parameters it includes can be as follows:
  • the parameter location indicates the click coordinates (x, y);
  • parameter points indicate the number of touch points (single finger / double finger / multi finger);
  • Second gesture event double click event: H5_EVENT_TYPE_DOUBLECLICK
  • the parameter location represents the double-click position coordinate (x, y);
  • Parameter points indicate the number of touch points (single finger / double finger / multi finger)
  • the third gesture event long press event: H5_EVENT_TYPE_LONGPRESS
  • the parameter location represents the long-press position coordinate (x, y);
  • parameter points indicate the number of touch points (single finger / double finger / multi finger);
  • the fourth gesture event drag event: H5_EVENT_TYPE_DRAG
  • parameter points indicate the number of touch points (single finger / double finger / multi finger);
  • the above parameters of the gesture event may be acquired according to the parameters of the corresponding touch event, for example, the position coordinates of the click event, the occurrence time are the same as the position coordinates of the pressed event, and the pressing time.
  • the element corresponding to the position coordinate may be determined as an element to be reversely controlled.
  • the HTML page can specifically refer to the HTML5 page.
  • the development language of the gesture event is consistent with the operating system of the mobile terminal. For example, if the operating system is an iOS system, the language of the gesture event is ObjectC, and if the operating system is an android system, the language of the gesture event is java.
  • the development language of the HTML page loaded by the application is not the native language. In order to make the elements in the HTML page respond to gesture events, it needs to be based on the gesture event as HTML. The elements in the page configure HTML parameters to enable reverse control of the elements in the HTML page.
  • the process of configuring HTML parameters based on click events can include:
  • the bottom-up search type is a controllable element, and after finding the element whose type is controllable, the element is Click event (click) binding in the HTML page.
  • the tag information of the element may be the type of the tag element, the type may be divided into controllable and unreliable, the controllable element can respond to the click event, and the uncontrollable element cannot respond to the click event.
  • the elements in the HTML page are DOM elements, and the DOM elements are arranged in a tree structure. From bottom to top, according to the tree structure, from the leaf element to the parent element of the leaf element and then to the root element.
  • the process of configuring HTML parameters according to the drag event may include:
  • the first condition the element is the top element, and the size of the element is larger than the view size;
  • the second condition The element is a normal element before the top element, and the size of the element is larger than the size of its parent element.
  • the scrolling parameter in the HTML page can be configured for the element according to the moving distance of the drag event.
  • Whether the element is a scrollable element can be determined according to the scrollable parameter of the element, and the scrollable parameters in the HTML page include: overflow or overflow-x and overflow-y, if overflow Not hidden, or neither overflow-x nor overflow-y are hidden, you can be sure that the element is a scrollable element.
  • the size of the element, the size of the parent element, and the view size can be determined based on the style information in the HTML page, and the like.
  • the moving distance of the drag event may be determined according to the position coordinate of the drag start event and the position coordinate of the drag end event, and the difference between the coordinates of the two positions is taken as the moving position.
  • the scrolling parameters in the HTML page set according to the moving distance may include: scrollleft and scrolltop, wherein scrollleft is used to determine the horizontal moving distance, and scrolltop is used to determine the vertical moving distance.
  • the method may further include:
  • the element to be reversely controlled may be an element in an HTML page, or may be a native control that can be interacted in the application, and the interactive native control refers to a control that can be directly controlled by a gesture event.
  • the mobile terminal operating system provides The method can determine the native control and the control description information of the location. If the control is determined to be a browser control (webview) according to the description of the control, it can be determined that the element to be reversely controlled is an element in the HTML page, otherwise it is interactive. Native controls.
  • the gesture events can be directly responded to the reverse control of the interactive native controls.
  • the recognition of the click event, the double-click event, the long-press event, and the drag event may be started simultaneously after receiving the touch event.
  • the received touch event is a press event
  • an event is pushed onto the stack for the press event
  • the received touch event is a moving event, it is determined whether the moving distance is less than a preset distance value, and if it is less, the event is pushed onto the stack;
  • the received touch event is a release event, it is determined whether the startup time is within a preset range when the recognition is started, and if it is within the preset range, the click event is recognized.
  • the above moving distance may be determined according to the position coordinates of the first event (press event) in the stack and the position coordinates of the current event (moving event), and the difference between the coordinates of the two positions is determined as the moving distance.
  • the above startup time may be determined according to the occurrence time of the first event (press event) in the stack and the occurrence time of the last event (press event or movement event), and the difference between the two times is determined as the startup time.
  • FIG. 3 is a schematic diagram of a click event recognition process receiving a press event in the embodiment of the present invention. Referring to Figure 3, the process includes:
  • the received touch event is a press event.
  • S32 It is judged whether the recognition has been started, and if so, S33 is executed, otherwise, S34 is executed.
  • the identification may be set to identify a state that is not activated, and when the identification is initiated, the identification is updated to identify the activated state.
  • the recognition is initiated and the pressed event is placed on the stack.
  • events When events are placed on the stack, they can be placed in order, so that the first and last events in the stack can be identified in subsequent processes.
  • FIG. 4 is a schematic diagram of a mobile event after receiving a click event identification process in an embodiment of the present invention. Referring to Figure 4, the process includes:
  • the received touch event is a mobile event.
  • S42 It is judged whether the recognition has been started, and if so, S43 is executed, otherwise, S45 is executed.
  • the identification may be set to identify a state that is not activated, and when the identification is initiated, the identification is updated to identify the activated state.
  • the preset distance value can be set according to experience or the like.
  • FIG. 5 is a schematic diagram of a click event recognition process receiving a release event in an embodiment of the present invention. Referring to Figure 5, the process includes:
  • S51 Receiving the touch event is a release event.
  • S52 It is judged whether the recognition has been started, and if so, S53 is executed, otherwise, S55 is executed.
  • the identification may be set to identify a state that is not activated, and when the identification is initiated, the identification is updated to identify the activated state.
  • the preset range can be set based on experience and the like.
  • double-clicking event recognition when double-clicking event recognition, it may be based on the identification of a click event, including the following process.
  • FIG. 6 is a schematic diagram of a double-click event recognition process in an embodiment of the present invention. Referring to Figure 6, the process includes:
  • the identified click event may be one or more. If it is one, the last click event refers to the one click event, and if there are multiple, the time of each click event may be determined. Clicks the most recent click event from the current time as the last click event.
  • the time of the last click event can be set to null, and subsequent updates can be made as appropriate.
  • S63 When not empty, calculate a difference between the current time and the time of the last click event, and determine whether the difference is less than a preset interval. If yes, execute S65, otherwise execute S64.
  • the received touch event is a press event
  • an event is pushed onto the stack for the press event
  • the received touch event is a moving event, it is determined whether the moving distance is less than a second preset distance value, and if it is less, determining whether the starting time is greater than a preset duration; if greater than, determining to identify a long press event;
  • the identification ends.
  • the above moving distance may be determined according to the position coordinates of the first event (press event) in the stack and the position coordinates of the current event (moving event), and the difference between the coordinates of the two positions is determined as the moving distance.
  • the above startup time may be determined according to the occurrence time of the first event (press event) in the stack and the occurrence time of the current component (moving event), and the difference between the two times is determined as the startup time.
  • FIG. 7 is a schematic diagram of a double-click event recognition process in the embodiment of the present invention after receiving a mobile event. Referring to Figure 7, the process includes:
  • the received touch event is a mobile event.
  • S72 It is judged whether the recognition has been started, and if so, S73 is executed, otherwise, S76 is executed.
  • the second preset distance value may be set according to experience or the like, and may be the same as or different from the first preset distance value described above.
  • the preset duration can be set according to experience and the like.
  • the received touch event is a press event
  • the event is pushed onto the stack, and the control corresponding to the position coordinate of the pressed event is acquired, and when the space is a draggable control, the drag start event is sent;
  • the received touch event is a moving event
  • the event is pushed onto the mobile event, and the position coordinate of the moving event is determined to be inside the draggable control, and if it is internal, the dragging event is sent;
  • the received touch event is a release event
  • an event is pushed onto the stack, and a position of the release event is determined to be inside the draggable control, and if it is internal, a drag end event is sent.
  • FIG. 8 is a schematic diagram of a drag event recognition process receiving a press event in the embodiment of the present invention. Referring to Figure 8, the process includes:
  • the received touch event is a press event.
  • the initialization identification includes, for example, determining whether the recognition has been initiated, and if it has been started, ending the identification, and if not, initiating the identification.
  • Draggable controls include, for example, UIScrollView, BTapDetectingView, and UIWebView.
  • control at the position coordinate of the pressed event is any of the above controls, it is determined that the control is a draggable control.
  • the drag start event can be recognized and a drag start event can be sent.
  • FIG. 9 is a schematic diagram of a motion event after receiving a motion event in a drag event recognition process according to an embodiment of the present invention. Referring to Figure 9, the process includes:
  • the received touch event is a mobile event.
  • S92 It is judged whether the recognition has been started, and if so, S94 is executed, otherwise, S93 is executed.
  • the dragging event can be recognized, and the drag can be sent to perform the event.
  • the drag end event can be recognized and the drag end event can be sent.
  • FIG. 10 is a schematic diagram of a drag event recognition process in a process of receiving a release event in an embodiment of the present invention. Referring to Figure 10, the process includes:
  • S101 Receiving a touch event is a release event.
  • S102 It is judged whether the recognition has been started, and if so, S103 is executed, otherwise, S106 is executed.
  • S104 Determine whether the position coordinate of the release event is inside the draggable control, and if yes, execute S105; otherwise, execute S106.
  • the drag end event can be recognized and the drag end event can be sent.
  • the corresponding gesture event may be sent to the subsequent module for event distribution at one time.
  • the event can be sent to the subsequent module for event distribution multiple times during the entire drag process.
  • the element to be reversely controlled is an element in the HTML page
  • the potential event configures the HTML parameter for the element, which can cause the element to process according to the configured HTML parameter in response to the gesture event, thereby implementing reverse control of the element in the HTML page, and the reverse control flow does not call the interface of the operating system, so Avoid the restrictions on the use of the interface by the mobile operating system, and conveniently implement reverse control of the mobile page.
  • FIG. 11 is a schematic structural diagram of an apparatus for back-controling a mobile terminal according to an embodiment of the present invention.
  • the device 110 includes a communication module 111, a gesture recognition module 112, and a conversion module 113.
  • the communication module 111 is configured to receive a touch event sent by another terminal for reverse control;
  • the communication module can receive a touch event sent by the vehicle.
  • the gesture recognition module 112 is configured to identify a gesture event according to the touch event, and determine an element to be reversely controlled;
  • the conversion module 113 is configured to configure an HTML parameter for the element according to the gesture event if the element is an element in an HTML page, so that the element is processed according to the HTML parameter in response to the gesture event.
  • the touch event includes: a press event, a move event, and a release event;
  • the gesture events include: a click event, a double click event, a long press event, and a drag event;
  • the gesture recognition module is specifically configured to:
  • the gesture recognition module 112 includes: a first unit, a second unit, a third unit, and a fourth unit;
  • the first unit is for:
  • the received touch event is a press event
  • an event is pushed onto the stack for the press event
  • the received touch event is a moving event, it is determined whether the moving distance is less than a preset distance value, and if it is less, the event is pushed onto the stack;
  • the received touch event is a release event, it is determined whether the startup time is within a preset range, and if it is within the preset range, it is determined that the click event is recognized.
  • the second unit is for:
  • the time of the last click event is updated to null and it is determined that the double-click event is recognized.
  • the third unit is used to:
  • the received touch event is a press event
  • an event is pushed onto the stack for the press event
  • the received touch event is a mobile event, determine whether the moving distance is less than a second preset distance value, and if it is less, determine whether the starting time is greater than a preset duration; if greater than, determine to identify the long By event;
  • the identification ends.
  • the fourth unit is used to:
  • the received touch event is a press event
  • the event is pushed onto the stack, and the control corresponding to the position coordinate of the pressed event is acquired, and when the space is a draggable control, the drag start event is sent;
  • the received touch event is a moving event
  • the event is pushed onto the mobile event, and the position coordinate of the moving event is determined to be inside the draggable control, and if it is internal, the dragging event is sent;
  • the received touch event is a release event
  • an event is pushed onto the stack, and a position of the release event is determined to be inside the draggable control, and if it is internal, a drag end event is sent.
  • the converting module is configured to configure an HTML parameter for the element according to the gesture event, including:
  • the gesture event is a click event
  • the bottom-up search type is a controllable element, and the type is found. After being a controllable element, bind the element to a click event in an HTML page.
  • the converting module is configured to configure an HTML parameter for the element according to the gesture event, including:
  • gesture event is a drag event, starting from an element corresponding to the position coordinate of the drag event, searching for a scrollable element from bottom to top, and after finding the scrollable element, determining whether the element is still Meet any of the following conditions:
  • the element is a top element, and the size of the element is larger than a view size; or,
  • the element is a normal element, and the size of the element is larger than the size of the parent element of the element;
  • the scrolling parameter in the HTML page is configured for the element according to the moving distance of the drag event.
  • the apparatus 110 further includes:
  • the event distribution module 114 is configured to determine whether an element to be reversely controlled is an element in an HTML page, and send the gesture event to the conversion module when the element is an element in an HTML page, When the element is an interactive native control, the gesture event is sent to the interaction module;
  • the interaction module 115 is configured to send the received gesture event to the interactive native control, so that the interactive native control responds to the gesture event.
  • the HTML parameter is configured for the element according to the gesture event, so that the element can be processed according to the configured HTML parameter to respond to the gesture event, thereby implementing the HTML page.
  • the reverse control of the element, and the reverse control process does not call the interface of the operating system, so the restriction of the interface used by the mobile operating system can be avoided, and the reverse control of the mobile page can be conveniently implemented.
  • the embodiment of the present application further provides a terminal, including: a processor; a memory of instructions, wherein the processor is configured to: receive a touch event sent by another terminal for reverse control; identify a gesture event according to the touch event, and determine an element to be reversely controlled;
  • the element is an element in an HTML page that is configured with HTML parameters in accordance with the gesture event such that the element is processed in response to the gesture event in response to the HTML parameter.
  • the embodiment of the present application further provides a non-transitory computer readable storage medium, when the instructions in the storage medium are executed by a processor of the terminal, enabling the terminal to perform a method for back-controling the mobile page.
  • the method includes: receiving a touch event sent by another terminal for reverse control; identifying a gesture event according to the touch event, and determining an element to be inversely controlled; if the element is an element in an HTML page, according to The gesture event configures an HTML parameter for the element to cause the element to process in accordance with the HTML parameter in response to the gesture event.
  • the embodiment of the present application further provides a computer program product, when an instruction in the computer program product is executed by a processor, performing a method for back-controlling a mobile page, the method comprising: receiving a sending by another terminal a touch event for reverse control; recognizing a gesture event based on the touch event, and determining an element to be inversely controlled; if the element is an element in an HTML page, configuring the element according to the gesture event An HTML parameter to cause the element to process in accordance with the HTML parameter in response to the gesture event.
  • portions of the invention may be implemented in hardware, software, firmware or a combination thereof.
  • multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
  • a suitable instruction execution system For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals. Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
  • each functional unit in each embodiment of the present invention may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated modules, if implemented in the form of software functional modules and sold or used as stand-alone products, may also be stored in a computer readable storage medium.
  • the above mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

A method and device for reversely controlling a mobile page. The method for reversely controlling a mobile page comprises: receiving a touch event for reverse control sent by another terminal (S11); recognizing a gesture event according to the touch event and determining an element to be reversely controlled (S12); and if the element is an element on an HTML page, configuring an HTML parameter for the element according to the gesture event, so that the element is processed according to the HTML parameter, to respond to the gesture event (S13). The method can avoid limitation by a mobile operating system to the use of interfaces, thereby conveniently implementing the reverse control of a mobile page.

Description

反向控制移动端页面的方法和装置Method and device for controlling mobile page in reverse
相关申请的交叉引用Cross-reference to related applications
本申请要求百度在线网络技术(北京)有限公司于2016年3月31日提交的、发明名称为“反向控制移动页面的方法和装置”的、中国专利申请号“201610202382.5”的优先权。The present application claims the priority of the Chinese patent application No. 201610202382.5, which is filed on March 31, 2016, which is filed on March 31, 2016 by Baidu Online Network Technology (Beijing) Co., Ltd., entitled "Method and Apparatus for Reverse Control of Mobile Pages".
技术领域Technical field
本发明涉及互联网技术领域,尤其涉及一种反向控制移动端页面的方法和装置。The present invention relates to the field of Internet technologies, and in particular, to a method and apparatus for controlling a mobile page in reverse.
背景技术Background technique
在手机与车机的互联方案中,经常采用投影手机端界面到车机显示器的联机方案,此时用户在车机端进行的操作会同步传输到手机端,手机端接收到操作主动触发相关页面元素的绑定行为。In the interconnection scheme between the mobile phone and the vehicle, the online solution of the projection mobile phone interface to the vehicle display is often used. At this time, the operation performed by the user on the vehicle end is synchronously transmitted to the mobile terminal, and the mobile terminal receives the operation to actively trigger the relevant page. The binding behavior of the element.
手机端显示的应用程序的页面是超文本标记语言(HyperText Markup Language,HTML)页面时,由于HTML页面在很多情况下都是通过网络动态加载,并且HTML5页面的上下文环境与应用程序的代码运行的上下文环境是相互独立的,所以需要有一套完善的机制来实现车机对手机端的HTML页面的 反向控制。When the page of the application displayed on the mobile phone is a HyperText Markup Language (HTML) page, since the HTML page is dynamically loaded through the network in many cases, and the context of the HTML5 page runs with the code of the application. The context is independent of each other, so there needs to be a well-established mechanism to implement the HTML page of the mobile phone to the mobile phone. Reverse control.
相关技术中,通过使用手机系统底层事件接口模拟产生相关事件,从而在系统层面将事件传递给页面元素,从而触发页面元素的绑定行为。但是,现有的手机操作系统都限制了接口的使用,比如,在iOS系统中需要审核,在android系统中需要具有root权限。因此,通过手机系统底层事件接口实现的反向控制在应用上并不方便。In the related art, the event is generated by using the underlying event interface of the mobile phone system to generate an event, thereby transmitting an event to the page element at the system level, thereby triggering the binding behavior of the page element. However, the existing mobile operating system limits the use of the interface, for example, in the iOS system requires auditing, in the android system needs to have root privileges. Therefore, the reverse control implemented by the underlying event interface of the mobile phone system is not convenient in application.
发明内容Summary of the invention
本发明旨在至少在一定程度上解决相关技术中的技术问题之一。The present invention aims to solve at least one of the technical problems in the related art to some extent.
为此,本发明的一个目的在于提出一种反向控制移动端页面的方法,该方法可以避开移动端操作系统对接口使用的限制,方便的实现对移动端页面的反向控制。Therefore, an object of the present invention is to provide a method for reversely controlling a mobile page, which can avoid the limitation of the interface used by the mobile operating system and conveniently implement reverse control of the mobile page.
本发明的另一个目的在于提出一种反向控制移动端页面的装置。Another object of the present invention is to provide an apparatus for back-controlling a mobile page.
为达到上述目的,本发明第一方面实施例提出的反向控制移动端页面的方法,包括:接收其他终端发送的用于反向控制的触摸事件;根据所述触摸事件识别出手势事件,以及确定出待反向控制的元素;如果所述元素是HTML页面中的元素,根据所述手势事件为所述元素配置HTML参数,以使所述元素根据所述HTML参数进行处理以响应所述手势事件。In order to achieve the above object, a method for reversely controlling a mobile page according to the first aspect of the present invention includes: receiving a touch event sent by another terminal for reverse control; identifying a gesture event according to the touch event, and Determining an element to be inversely controlled; if the element is an element in an HTML page, configuring an HTML parameter for the element according to the gesture event, such that the element is processed according to the HTML parameter in response to the gesture event.
本发明第一方面实施例提出的反向控制移动端页面的方法,通过在待反向控制的元素是HTML页面中的元素时,根据手势事件为元素配置HTML参数, 可以使得元素根据配置的HTML参数进行处理以响应手势事件,从而实现对HTML页面中元素的反向控制,并且该反向控制流程没有调用操作系统的接口,因此可以避开移动端操作系统对接口使用的限制,方便的实现对移动端页面的反向控制。The method for back-controlling a mobile page proposed by the first aspect of the present invention, by configuring an HTML parameter according to a gesture event, when an element to be reversely controlled is an element in an HTML page, The element can be processed according to the configured HTML parameters in response to the gesture event, thereby implementing reverse control of the elements in the HTML page, and the reverse control flow does not invoke the interface of the operating system, thereby avoiding the interface of the mobile operating system The restrictions used make it easy to implement reverse control of the mobile page.
为达到上述目的,本发明第二方面实施例提出的反向控制移动端页面的装置,包括:通信模块,用于接收其他终端发送的用于反向控制的触摸事件;手势识别模块,用于根据所述触摸事件识别出手势事件,以及确定出待反向控制的元素;转换模块,用于如果所述元素是HTML页面中的元素,根据所述手势事件为所述元素配置HTML参数,以使所述元素根据所述HTML参数进行处理以响应所述手势事件。In order to achieve the above object, an apparatus for reversely controlling a mobile page according to a second aspect of the present invention includes: a communication module, configured to receive a touch event sent by another terminal for reverse control; and a gesture recognition module, configured to: Identifying a gesture event according to the touch event, and determining an element to be inversely controlled; and a conversion module, configured to configure an HTML parameter for the element according to the gesture event if the element is an element in an HTML page, The element is processed in response to the HTML parameter in response to the gesture event.
本发明第二方面实施例提出的反向控制移动端页面的装置,通过在待反向控制的元素是HTML页面中的元素时,根据手势事件为元素配置HTML参数,可以使得元素根据配置的HTML参数进行处理以响应手势事件,从而实现对HTML页面中元素的反向控制,并且该反向控制流程没有调用操作系统的接口,因此可以避开移动端操作系统对接口使用的限制,方便的实现对移动端页面的反向控制。The device for back-controlling a mobile page proposed by the second aspect of the present invention can make an element according to a configured HTML by configuring an HTML parameter according to a gesture event when an element to be inversely controlled is an element in an HTML page. The parameters are processed in response to the gesture event, thereby implementing reverse control of the elements in the HTML page, and the reverse control flow does not invoke the interface of the operating system, thereby avoiding the limitation of the interface used by the mobile operating system, and conveniently implementing Reverse control of the mobile page.
本申请实施例还提出了一种终端,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为:接收其他终端发送的用于反向控制的触摸事件;根据所述触摸事件识别出手势事件,以及确定出待反向控制的 元素;如果所述元素是HTML页面中的元素,根据所述手势事件为所述元素配置HTML参数,以使所述元素根据所述HTML参数进行处理以响应所述手势事件。The embodiment of the present application further provides a terminal, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to: receive a touch event sent by another terminal for reverse control Identifying a gesture event based on the touch event and determining a to-be-controlled An element; if the element is an element in an HTML page, configuring an HTML parameter for the element according to the gesture event such that the element is processed according to the HTML parameter in response to the gesture event.
本申请实施例还提出了一种非临时性计算机可读存储介质,当所述存储介质中的指令由终端的处理器执行时,使得终端能够执行一种反向控制移动端页面的方法,所述方法包括:接收其他终端发送的用于反向控制的触摸事件;根据所述触摸事件识别出手势事件,以及确定出待反向控制的元素;如果所述元素是HTML页面中的元素,根据所述手势事件为所述元素配置HTML参数,以使所述元素根据所述HTML参数进行处理以响应所述手势事件。The embodiment of the present application further provides a non-transitory computer readable storage medium, when the instructions in the storage medium are executed by a processor of the terminal, enabling the terminal to perform a method for back-controling the mobile page. The method includes: receiving a touch event sent by another terminal for reverse control; identifying a gesture event according to the touch event, and determining an element to be inversely controlled; if the element is an element in an HTML page, according to The gesture event configures an HTML parameter for the element to cause the element to process in accordance with the HTML parameter in response to the gesture event.
本申请实施例还提出了一种计算机程序产品,当所述计算机程序产品中的指令被处理器执行时,执行一种反向控制移动端页面的方法,所述方法包括:接收其他终端发送的用于反向控制的触摸事件;根据所述触摸事件识别出手势事件,以及确定出待反向控制的元素;如果所述元素是HTML页面中的元素,根据所述手势事件为所述元素配置HTML参数,以使所述元素根据所述HTML参数进行处理以响应所述手势事件。The embodiment of the present application further provides a computer program product, when an instruction in the computer program product is executed by a processor, performing a method for back-controlling a mobile page, the method comprising: receiving a sending by another terminal a touch event for reverse control; recognizing a gesture event based on the touch event, and determining an element to be inversely controlled; if the element is an element in an HTML page, configuring the element according to the gesture event An HTML parameter to cause the element to process in accordance with the HTML parameter in response to the gesture event.
本发明附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。The additional aspects and advantages of the invention will be set forth in part in the description which follows.
附图说明DRAWINGS
本发明上述的和/或附加的方面和优点从下面结合附图对实施例的描述中 将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present invention are described in the following description of embodiments with reference to the accompanying drawings Will become obvious and easy to understand, where:
图1是本发明一个实施例提出的反向控制移动端页面的方法的流程示意图;1 is a schematic flow chart of a method for back-controling a mobile page according to an embodiment of the present invention;
图2是本发明另一个实施例提出的反向控制移动端页面的方法的流程示意图;2 is a schematic flow chart of a method for back-controling a mobile page according to another embodiment of the present invention;
图3是本发明实施例中单击事件识别流程中接收到按下事件后的示意图;3 is a schematic diagram of a click event recognition process receiving a press event in the embodiment of the present invention;
图4是本发明实施例中单击事件识别流程中接收到移动事件后的示意图;4 is a schematic diagram of a mobile event after receiving a click event in a click event identification process according to an embodiment of the present invention;
图5是本发明实施例中单击事件识别流程中接收到松开事件后的示意图;FIG. 5 is a schematic diagram of a click event recognition process receiving a release event in an embodiment of the present invention; FIG.
图6是本发明实施例中双击事件识别流程示意图;6 is a schematic diagram of a double-click event identification process in an embodiment of the present invention;
图7是本发明实施例中双击事件识别流程中接收到移动事件后的示意图;7 is a schematic diagram of a double-click event recognition process after receiving a mobile event in an embodiment of the present invention;
图8是本发明实施例中拖动事件识别流程中接收到按下事件后的示意图;8 is a schematic diagram of receiving a press event in a drag event recognition process in an embodiment of the present invention;
图9是本发明实施例中拖动事件识别流程中接收到移动事件后的示意图;9 is a schematic diagram of a motion event after receiving a motion event in a drag event recognition process according to an embodiment of the present invention;
图10是本发明实施例中拖动事件识别流程中接收到松开事件后的示意图;10 is a schematic diagram of receiving a release event in a drag event recognition process according to an embodiment of the present invention;
图11是本发明一个实施例提出的反向控制移动端页面的装置的结构示意图;FIG. 11 is a schematic structural diagram of an apparatus for back-controling a mobile terminal according to an embodiment of the present invention; FIG.
图12是本发明另一个实施例提出的反向控制移动端页面的装置的结构示意图。FIG. 12 is a schematic structural diagram of an apparatus for back-controlling a mobile terminal according to another embodiment of the present invention.
具体实施方式detailed description
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的模块或具有相同或类似功能的模块。 下面通过参考附图描述的实施例是示例性的,仅用于解释本发明,而不能理解为对本发明的限制。相反,本发明的实施例包括落入所附加权利要求书的精神和内涵范围内的所有变化、修改和等同物。The embodiments of the present invention are described in detail below, and the examples of the embodiments are illustrated in the accompanying drawings, in which the same or similar reference numerals indicate the same or similar modules or modules having the same or similar functions. The embodiments described below with reference to the accompanying drawings are intended to be illustrative of the invention and are not to be construed as limiting. Rather, the invention is to cover all modifications, modifications and equivalents within the spirit and scope of the appended claims.
图1是本发明一个实施例提出的反向控制移动端页面的方法的流程示意图。本实施例的方法可以应用在移动端。FIG. 1 is a schematic flow chart of a method for back-controling a mobile page according to an embodiment of the present invention. The method of this embodiment can be applied to the mobile terminal.
参见图1,本实施例的方法包括:Referring to FIG. 1, the method of this embodiment includes:
S11:接收其他终端发送的用于反向控制的触摸事件。S11: Receive a touch event sent by another terminal for reverse control.
其他终端是指与移动端进行联网的对端。例如,在手机和车机的联网方案中,移动端是指手机,其他终端是指车机。Other terminals refer to the peers that are connected to the mobile terminal. For example, in the networking solution of a mobile phone and a car, the mobile terminal refers to a mobile phone, and the other terminal refers to a car phone.
在车机端需要反向控制手机端时,车机可以向手机发送反向控制的事件,该事件是应用程序的原生事件,具体是触摸事件。When the vehicle end needs to control the mobile phone terminal in reverse, the car machine can send a reverse control event to the mobile phone, and the event is a native event of the application, specifically a touch event.
触摸事件包括:按下事件、移动事件和松开事件。Touch events include: pressing an event, moving an event, and releasing an event.
每种触摸事件可以包括相应的参数。一些具体示例中,每种触摸事件的表示及包括的参数可以如下所示:Each touch event can include a corresponding parameter. In some specific examples, the representation of each touch event and the parameters included may be as follows:
第一种触摸事件:按下事件:NATIVE_EVENT_TOUCH_DOWNFirst touch event: Press event: NATIVE_EVENT_TOUCH_DOWN
(a)参数location表示按下位置坐标(x,y);(a) The parameter location represents the pressed position coordinate (x, y);
(b)参数points表示触控点数量(单指/双指/多指);(b) parameter points indicate the number of touch points (single finger / double finger / multi finger);
(c)参数timestamp表示发生时间。(c) The parameter timestamp indicates the time of occurrence.
第二种触摸事件:移动事件:NATIVE_EVENT_TOUCH_MOVE Second touch event: Move event: NATIVE_EVENT_TOUCH_MOVE
(a)参数location表示移动到的位置坐标(x,y);(a) The parameter location represents the position coordinate (x, y) to which it is moved;
(b)参数points表示触控点数量(单指/双指/多指);(b) parameter points indicate the number of touch points (single finger / double finger / multi finger);
(c)参数timestamp表示发生时间。(c) The parameter timestamp indicates the time of occurrence.
第三种触摸事件:松开事件:NATIVE_EVENT_TOUCH_UPThird touch event: Release event: NATIVE_EVENT_TOUCH_UP
S12:根据所述触摸事件识别出手势事件,以及确定出待反向控制的元素。S12: Identify a gesture event according to the touch event, and determine an element to be reversely controlled.
其中,手势事件是用于触发元素响应的事件。Among them, the gesture event is an event for triggering the element response.
手势事件包括:单击事件、双击事件、长按事件和拖动事件。Gesture events include: click events, double click events, long press events, and drag events.
每种手势事件可以包括相应的参数。一些具体示例中,每种手势事件的表示及包括的参数可以如下所示:Each gesture event can include a corresponding parameter. In some specific examples, the representation of each gesture event and the parameters it includes can be as follows:
第一种手势事件:单击事件:H5_EVENT_TYPE_CLICKFirst gesture event: Click event: H5_EVENT_TYPE_CLICK
(a)参数location表示单击坐标(x,y);(a) The parameter location indicates the click coordinates (x, y);
(b)参数points表示触控点数量(单指/双指/多指);(b) parameter points indicate the number of touch points (single finger / double finger / multi finger);
(c)参数timestamp表示发生时间。(c) The parameter timestamp indicates the time of occurrence.
第二种手势事件:双击事件:H5_EVENT_TYPE_DOUBLECLICKSecond gesture event: double click event: H5_EVENT_TYPE_DOUBLECLICK
(a)参数location表示双击位置坐标(x,y);(a) The parameter location represents the double-click position coordinate (x, y);
(b)参数points表示触控点数量(单指/双指/多指)(b) Parameter points indicate the number of touch points (single finger / double finger / multi finger)
(c)参数timestamp表示发生时间。(c) The parameter timestamp indicates the time of occurrence.
第三种手势事件:长按事件:H5_EVENT_TYPE_LONGPRESSThe third gesture event: long press event: H5_EVENT_TYPE_LONGPRESS
(a)参数location表示长按位置坐标(x,y); (a) The parameter location represents the long-press position coordinate (x, y);
(b)参数points表示触控点数量(单指/双指/多指);(b) parameter points indicate the number of touch points (single finger / double finger / multi finger);
(c)参数timestamp表示发生时间。(c) The parameter timestamp indicates the time of occurrence.
第四种手势事件:拖动事件:H5_EVENT_TYPE_DRAGThe fourth gesture event: drag event: H5_EVENT_TYPE_DRAG
(a)参数location表示拖动到位置坐标(x,y);(a) The parameter location indicates dragging to the position coordinates (x, y);
(b)参数points表示触控点数量(单指/双指/多指);(b) parameter points indicate the number of touch points (single finger / double finger / multi finger);
(c)参数timestamp表示发生时间。(c) The parameter timestamp indicates the time of occurrence.
在手势事件识别时,手势事件的上述参数可以根据对应的触摸事件的参数获取,例如,单击事件的位置坐标、发生时间分别与按下事件的位置坐标、按下时间相同。在确定出手势事件的位置坐标后,可以将该位置坐标对应的元素确定为待反向控制的元素。In the gesture event recognition, the above parameters of the gesture event may be acquired according to the parameters of the corresponding touch event, for example, the position coordinates of the click event, the occurrence time are the same as the position coordinates of the pressed event, and the pressing time. After determining the position coordinates of the gesture event, the element corresponding to the position coordinate may be determined as an element to be reversely controlled.
根据触摸事件识别出手势事件的具体流程可以参见后续描述。The specific process of recognizing a gesture event according to a touch event can be referred to the subsequent description.
S13:如果所述元素是HTML页面中的元素,根据所述手势事件为所述元素配置HTML参数,以使所述元素根据所述HTML参数进行处理以响应所述手势事件。S13: If the element is an element in an HTML page, configure an HTML parameter for the element according to the gesture event, so that the element is processed according to the HTML parameter in response to the gesture event.
其中,HTML页面可以具体是指HTML5页面。Among them, the HTML page can specifically refer to the HTML5 page.
手势事件的开发语言与移动端的操作系统一致。例如,如果操作系统是iOS系统,则手势事件的语言是ObjectC,如果操作系统是android系统,则手势事件的语言是java。而应用程序加载的HTML页面的开发语言并不是原生语言,为了使得HTML页面中的元素可以响应手势事件,需要根据手势事件为HTML 页面中的元素配置HTML参数,从而实现对HTML页面中元素的反向控制。The development language of the gesture event is consistent with the operating system of the mobile terminal. For example, if the operating system is an iOS system, the language of the gesture event is ObjectC, and if the operating system is an android system, the language of the gesture event is java. The development language of the HTML page loaded by the application is not the native language. In order to make the elements in the HTML page respond to gesture events, it needs to be based on the gesture event as HTML. The elements in the page configure HTML parameters to enable reverse control of the elements in the HTML page.
根据单击事件配置HTML参数的流程可以包括:The process of configuring HTML parameters based on click events can include:
根据预先对HTML页面中的元素的标记信息,从单击事件的位置坐标对应的元素开始,从下至上查找类型是可控的元素,在查找到类型是可控的元素后,将该元素与HTML页面中的点击事件(click)绑定。According to the mark information of the elements in the HTML page in advance, starting from the element corresponding to the position coordinate of the click event, the bottom-up search type is a controllable element, and after finding the element whose type is controllable, the element is Click event (click) binding in the HTML page.
其中,元素的标记信息可以是标记元素的类型,类型可以分为可控和不可靠,可控的元素能够响应单击事件,不可控的元素不能响应单击事件。The tag information of the element may be the type of the tag element, the type may be divided into controllable and unreliable, the controllable element can respond to the click event, and the uncontrollable element cannot respond to the click event.
HTML页面中的元素是DOM元素,DOM元素采用树形结构排布,从下至上是指按照树形结构,从叶子元素到叶子元素的父元素再向根元素的方向进行。The elements in the HTML page are DOM elements, and the DOM elements are arranged in a tree structure. From bottom to top, according to the tree structure, from the leaf element to the parent element of the leaf element and then to the root element.
根据拖动事件配置HTML参数的流程可以包括:The process of configuring HTML parameters according to the drag event may include:
从拖动事件的位置坐标对应的元素开始,从下至上查找可滚动的元素,在查找到可滚动的元素后,判断该元素是否还满足如下条件中的任一项:Starting from the element corresponding to the position coordinate of the drag event, looking up the scrollable element from bottom to top, after finding the scrollable element, determining whether the element also satisfies any of the following conditions:
第一项条件:该元素是顶层元素(body),且该元素的尺寸大于视图尺寸;The first condition: the element is the top element, and the size of the element is larger than the view size;
第二项条件:该元素是除顶层元素之前的普通元素,且该元素的尺寸大于其父元素的尺寸。The second condition: The element is a normal element before the top element, and the size of the element is larger than the size of its parent element.
如果该元素是可滚动的元素,且还满足上述任一项条件,则可以根据所述拖动事件的移动距离为所述元素配置HTML页面中的滚动参数。If the element is a scrollable element and also satisfies any of the above conditions, the scrolling parameter in the HTML page can be configured for the element according to the moving distance of the drag event.
其中,元素是否是可滚动的元素,可以根据元素的可滚动参数确定,HTML页面中该可滚动参数包括:overflow或者overflow-x和overflow-y,如果overflow 不是hidden,或者,overflow-x和overflow-y都不是hidden,则可以确定该元素是可滚动的元素。Whether the element is a scrollable element can be determined according to the scrollable parameter of the element, and the scrollable parameters in the HTML page include: overflow or overflow-x and overflow-y, if overflow Not hidden, or neither overflow-x nor overflow-y are hidden, you can be sure that the element is a scrollable element.
元素的尺寸、父元素的尺寸及视图尺寸可以根据HTML页面中的样式信息等确定。The size of the element, the size of the parent element, and the view size can be determined based on the style information in the HTML page, and the like.
拖动事件的移动距离可以根据拖动开始事件的位置坐标与拖动结束事件的位置坐标确定,将这两个位置坐标的差值作为移动位置。The moving distance of the drag event may be determined according to the position coordinate of the drag start event and the position coordinate of the drag end event, and the difference between the coordinates of the two positions is taken as the moving position.
根据移动距离设置的HTML页面中的滚动参数可以包括:scrollleft和scrolltop,其中,scrollleft用于确定横向的移动距离,scrolltop用于确定纵向的移动距离。The scrolling parameters in the HTML page set according to the moving distance may include: scrollleft and scrolltop, wherein scrollleft is used to determine the horizontal moving distance, and scrolltop is used to determine the vertical moving distance.
由于反向控制中经常使用的手势事件是单击事件和拖动事件,上述给出了如何根据单击事件和拖动事件配置HTML参数的方法,可以理解的是,根据双击事件和长按事件配置HTML参数的方式也可以参照执行,在此不再详细说明。Since the gesture events that are often used in reverse control are click events and drag events, the above gives a way to configure HTML parameters based on click events and drag events. It can be understood that according to double click events and long press events. The way to configure HTML parameters can also be referred to for execution, and will not be described in detail here.
一些实施例中,如图2所示,该方法还可以包括:In some embodiments, as shown in FIG. 2, the method may further include:
S14:判断待反向控制的元素是否是HTML页面中的元素,若是,执行上述的S13,否则,执行S15。S14: It is judged whether the element to be reversely controlled is an element in the HTML page, and if so, the above S13 is executed, otherwise, S15 is performed.
其中,待反向控制的元素可以是HTML页面中的元素,或者,也可以是应用程序中可交互的原生控件,可交互的原生控件是指可以由手势事件直接进行控制的控件。The element to be reversely controlled may be an element in an HTML page, or may be a native control that can be interacted in the application, and the interactive native control refers to a control that can be directly controlled by a gesture event.
具体的,在手势事件识别时确定出位置坐标后,根据移动端操作系统提供 的方法可以确定该位置的原生控件及控件描述信息,如果根据控件描述信息确定该控件是浏览器控件(webview),则可以确定待反向控制的元素是HTML页面中的元素,否则是可交互的原生控件。Specifically, after the location coordinates are determined at the time of the gesture event recognition, the mobile terminal operating system provides The method can determine the native control and the control description information of the location. If the control is determined to be a browser control (webview) according to the description of the control, it can be determined that the element to be reversely controlled is an element in the HTML page, otherwise it is interactive. Native controls.
S15:如果上述的元素是可交互的原生控件,则将识别出的手势事件发送给可交互的原生控件,以使可交互的原生控件响应手势事件。S15: If the above element is an interactive native control, the recognized gesture event is sent to the interactive native control, so that the interactive native control responds to the gesture event.
由于可交互的原生控件与手势事件的语言一致,可以直接响应手势事件,从而完成对可交互的原生控件的反向控制。Since the interactive native controls are consistent with the language of the gesture event, the gesture events can be directly responded to the reverse control of the interactive native controls.
在上述流程中,涉及了根据触摸事件识别出手势事件的流程,具体的该流程可以如下所示。In the above process, a process of recognizing a gesture event according to a touch event is involved, and the specific process may be as follows.
其中,在根据触摸事件识别手势事件的流程时,可以是接收到触摸事件后,同时启动对单击事件、双击事件、长按事件和拖动事件的识别。Wherein, when the flow of the gesture event is recognized according to the touch event, the recognition of the click event, the double-click event, the long-press event, and the drag event may be started simultaneously after receiving the touch event.
一些实施例中,在单击事件识别时,可以包括如下流程:In some embodiments, when the event identification is clicked, the following processes may be included:
如果接收的触摸事件是按下事件,对按下事件进行事件入栈;If the received touch event is a press event, an event is pushed onto the stack for the press event;
如果接收的触摸事件是移动事件,判断移动距离是否小于预设距离值,如果小于,则对移动事件进行事件入栈;If the received touch event is a moving event, it is determined whether the moving distance is less than a preset distance value, and if it is less, the event is pushed onto the stack;
如果接收的触摸事件是松开事件,则在启动识别时,判断启动时间是否在预设范围内,如果在预设范围内,则识别出单击事件。If the received touch event is a release event, it is determined whether the startup time is within a preset range when the recognition is started, and if it is within the preset range, the click event is recognized.
上述的移动距离可以根据栈内的首个事件(按下事件)的位置坐标与当前事件(移动事件)的位置坐标确定,将这两个位置坐标的差值确定为移动距离。 The above moving distance may be determined according to the position coordinates of the first event (press event) in the stack and the position coordinates of the current event (moving event), and the difference between the coordinates of the two positions is determined as the moving distance.
上述的启动时间可以根据栈内的首个事件(按下事件)的发生时间与最后事件(按下事件或移动事件)的发生时间确定,将这两个时间的差值确定为启动时间。The above startup time may be determined according to the occurrence time of the first event (press event) in the stack and the occurrence time of the last event (press event or movement event), and the difference between the two times is determined as the startup time.
上述的单击事件识别过程中,接收到各触摸事件的具体处理流程可以参见如下的实施例。In the above-mentioned click event identification process, the specific processing flow of receiving each touch event can be referred to the following embodiment.
图3是本发明实施例中单击事件识别流程中接收到按下事件后的示意图。参见图3,该流程包括:FIG. 3 is a schematic diagram of a click event recognition process receiving a press event in the embodiment of the present invention. Referring to Figure 3, the process includes:
S31:接收到触摸事件是按下事件。S31: The received touch event is a press event.
S32:判断识别是否已启动,若是,执行S33,否则,执行S34。S32: It is judged whether the recognition has been started, and if so, S33 is executed, otherwise, S34 is executed.
其中,可以设置是否启动的标识,根据该标识可以判断识别是否已启动。Wherein, it is possible to set whether the identifier is activated, and according to the identifier, it can be determined whether the identification has been started.
初始时,可以设置该标识为识别未启动的状态,当启动识别后,将该标识更新为识别已启动的状态。Initially, the identification may be set to identify a state that is not activated, and when the identification is initiated, the identification is updated to identify the activated state.
S33:结束识别。S33: End recognition.
S34:启动识别,并对按下事件进行事件入栈。S34: Start recognition and perform event stacking on the pressed event.
在没有启动识别时,启动识别,并且,将按下事件放入栈内。When the recognition is not initiated, the recognition is initiated and the pressed event is placed on the stack.
在将事件放入栈内时,可以按序放入,从而在后续流程中可以识别出栈内的首次事件和最后事件。When events are placed on the stack, they can be placed in order, so that the first and last events in the stack can be identified in subsequent processes.
图4是本发明实施例中单击事件识别流程中接收到移动事件后的示意图。参见图4,该流程包括: 4 is a schematic diagram of a mobile event after receiving a click event identification process in an embodiment of the present invention. Referring to Figure 4, the process includes:
S41:接收到触摸事件是移动事件。S41: The received touch event is a mobile event.
S42:判断识别是否已启动,若是,执行S43,否则,执行S45。S42: It is judged whether the recognition has been started, and if so, S43 is executed, otherwise, S45 is executed.
其中,可以设置是否启动的标识,根据该标识可以判断识别是否已启动。Wherein, it is possible to set whether the identifier is activated, and according to the identifier, it can be determined whether the identification has been started.
初始时,可以设置该标识为识别未启动的状态,当启动识别后,将该标识更新为识别已启动的状态。Initially, the identification may be set to identify a state that is not activated, and when the identification is initiated, the identification is updated to identify the activated state.
S43:判断移动距离是否小于第一预设距离值,若是,执行S44,否则,执行S45。S43: Determine whether the moving distance is smaller than the first preset distance value, and if yes, execute S44, otherwise, execute S45.
预设距离值可以根据经验等设置。The preset distance value can be set according to experience or the like.
S44:对所述移动事件进行事件入栈。S44: Perform event stacking on the mobile event.
S45:结束识别。S45: End recognition.
图5是本发明实施例中单击事件识别流程中接收到松开事件后的示意图。参见图5,该流程包括:FIG. 5 is a schematic diagram of a click event recognition process receiving a release event in an embodiment of the present invention. Referring to Figure 5, the process includes:
S51:接收到触摸事件是松开事件。S51: Receiving the touch event is a release event.
S52:判断识别是否已启动,若是,执行S53,否则,执行S55。S52: It is judged whether the recognition has been started, and if so, S53 is executed, otherwise, S55 is executed.
其中,可以设置是否启动的标识,根据该标识可以判断识别是否已启动。Wherein, it is possible to set whether the identifier is activated, and according to the identifier, it can be determined whether the identification has been started.
初始时,可以设置该标识为识别未启动的状态,当启动识别后,将该标识更新为识别已启动的状态。Initially, the identification may be set to identify a state that is not activated, and when the identification is initiated, the identification is updated to identify the activated state.
S53:判断启动时间是否在预设范围内,若是,执行S54,否则,执行S55。S53: Determine whether the startup time is within a preset range. If yes, execute S54; otherwise, execute S55.
预设范围可以根据经验等设置。 The preset range can be set based on experience and the like.
S54:确定识别出单击事件。S54: Determine to identify the click event.
S55:结束识别。S55: End recognition.
一些实施例中,在双击事件识别时,可以基于单击事件的识别,包括如下流程。In some embodiments, when double-clicking event recognition, it may be based on the identification of a click event, including the following process.
图6是本发明实施例中双击事件识别流程示意图。参见图6,该流程包括:FIG. 6 is a schematic diagram of a double-click event recognition process in an embodiment of the present invention. Referring to Figure 6, the process includes:
S61:识别出单击事件。S61: A click event is recognized.
其中,单击事件的识别流程可以参见上述实施例,在此不再详细说明。For the identification process of the click event, refer to the foregoing embodiment, and details are not described herein again.
S62:判断上次单击事件的时间是否不为空,若是,执行S63,否则,执行S64。S62: Determine whether the time of the last click event is not empty, if yes, execute S63, otherwise, execute S64.
其中,识别出的单击事件可以是一个或多个,如果为一个时,上次单击事件是指该一个单击事件,如果为多个,则可以确定每个单击事件的发生时间,将距离当前时间最近的单击事件作为上次单击事件。The identified click event may be one or more. If it is one, the last click event refers to the one click event, and if there are multiple, the time of each click event may be determined. Clicks the most recent click event from the current time as the last click event.
初始时,上次单击事件的时间可以设置为空,后续可以根据情况更新。Initially, the time of the last click event can be set to null, and subsequent updates can be made as appropriate.
S63:在不为空时,计算当前时间与上次单击事件的时间之间的差值,并判断该差值是否小于预设间隔,若是,执行S65,否则执行S64。S63: When not empty, calculate a difference between the current time and the time of the last click event, and determine whether the difference is less than a preset interval. If yes, execute S65, otherwise execute S64.
S64:在为空或者小于预设间隔时,将上次单击事件的时间更新为当前时间。S64: Update the time of the last click event to the current time when it is empty or less than the preset interval.
S65:将上次单击事件的时间更新为空。S65: Update the time of the last click event to null.
S66:确定识别出双击事件。 S66: Determine to identify the double-click event.
一些实施例中,在长按事件识别时,可以包括如下流程:In some embodiments, when long-press event recognition, the following processes may be included:
如果接收的触摸事件是按下事件,对按下事件进行事件入栈;If the received touch event is a press event, an event is pushed onto the stack for the press event;
如果接收的触摸事件是移动事件,判断移动距离是否小于第二预设距离值,如果小于,则判断启动时间是否大于预设持续时间;如果大于,确定识别出长按事件;If the received touch event is a moving event, it is determined whether the moving distance is less than a second preset distance value, and if it is less, determining whether the starting time is greater than a preset duration; if greater than, determining to identify a long press event;
如果接收的触摸事件是松开事件,则结束识别。If the received touch event is a release event, the identification ends.
上述的移动距离可以根据栈内的首个事件(按下事件)的位置坐标与当前事件(移动事件)的位置坐标确定,将这两个位置坐标的差值确定为移动距离。The above moving distance may be determined according to the position coordinates of the first event (press event) in the stack and the position coordinates of the current event (moving event), and the difference between the coordinates of the two positions is determined as the moving distance.
上述的启动时间可以根据栈内的首个事件(按下事件)的发生时间与当前件(移动事件)的发生时间确定,将这两个时间的差值确定为启动时间。The above startup time may be determined according to the occurrence time of the first event (press event) in the stack and the occurrence time of the current component (moving event), and the difference between the two times is determined as the startup time.
图7是本发明实施例中双击事件识别流程中接收到移动事件后的示意图。参见图7,该流程包括:FIG. 7 is a schematic diagram of a double-click event recognition process in the embodiment of the present invention after receiving a mobile event. Referring to Figure 7, the process includes:
S71:接收到触摸事件是移动事件。S71: The received touch event is a mobile event.
S72:判断识别是否已启动,若是,执行S73,否则,执行S76。S72: It is judged whether the recognition has been started, and if so, S73 is executed, otherwise, S76 is executed.
S73:判断移动距离是否小于第二预设距离值,若是,执行S74,否则,执行S76。S73: Determine whether the moving distance is smaller than the second preset distance value, and if yes, execute S74; otherwise, execute S76.
第二预设距离值可以根据经验等设置,与上述的第一预设距离值可以相同或不同。The second preset distance value may be set according to experience or the like, and may be the same as or different from the first preset distance value described above.
S74:判断启动时间是否大于预设持续时间,若是,执行S75,否则,执行 S76。S74: determining whether the startup time is greater than a preset duration, if yes, executing S75, otherwise, executing S76.
预设持续时间可以根据经验等设置。The preset duration can be set according to experience and the like.
S75:确定识别出长按事件。S75: Determine to identify a long press event.
S76:结束识别。S76: End recognition.
一些实施例中,在拖动事件识别时,可以包括如下流程:In some embodiments, when the event identification is dragged, the following processes may be included:
如果接收的触摸事件是按下事件,对按下事件进行事件入栈,以及,获取按下事件的位置坐标对应的控件,在所述空间是可拖动控件时,发送拖动开始事件;If the received touch event is a press event, the event is pushed onto the stack, and the control corresponding to the position coordinate of the pressed event is acquired, and when the space is a draggable control, the drag start event is sent;
如果接收的触摸事件是移动事件,对移动事件进行事件入栈,以及判断移动事件的位置坐标是否在可拖动控件内部,如果在内部,则发送拖动进行事件;If the received touch event is a moving event, the event is pushed onto the mobile event, and the position coordinate of the moving event is determined to be inside the draggable control, and if it is internal, the dragging event is sent;
如果接收的触摸事件是松开事件,对松开事件进行事件入栈,以及,判断松开事件的位置坐标是否在可拖动控件内部,如果在内部,则发送拖动结束事件。If the received touch event is a release event, an event is pushed onto the stack, and a position of the release event is determined to be inside the draggable control, and if it is internal, a drag end event is sent.
上述的拖动事件识别过程中,接收到各触摸事件的具体处理流程可以参见如下的实施例。In the above-mentioned drag event identification process, the specific processing flow of receiving each touch event can be referred to the following embodiments.
图8是本发明实施例中拖动事件识别流程中接收到按下事件后的示意图。参见图8,该流程包括:FIG. 8 is a schematic diagram of a drag event recognition process receiving a press event in the embodiment of the present invention. Referring to Figure 8, the process includes:
S81:接收到触摸事件是按下事件。S81: The received touch event is a press event.
S82:初始化识别。 S82: Initialization identification.
初始化识别时例如包括:判断识别是否已启动,如果已启动,则结束识别,如果未启动,则启动识别。The initialization identification includes, for example, determining whether the recognition has been initiated, and if it has been started, ending the identification, and if not, initiating the identification.
S83:在启动识别后,对按下事件进行事件入栈。S83: After the recognition is started, an event is pushed onto the stack for the press event.
S84:获取按下事件的位置坐标对应的控件,并判断该控件是否是可拖动控件,若是,执行S85,否则,执行S86。S84: Acquire a control corresponding to the position coordinate of the pressed event, and determine whether the control is a draggable control, and if yes, execute S85; otherwise, execute S86.
可拖动控件例如包括:UIScrollView、BTapDetectingView、UIWebView。Draggable controls include, for example, UIScrollView, BTapDetectingView, and UIWebView.
如果按下事件的位置坐标处的控件是上述控件的任一种,则确定该控件是可拖动控件。If the control at the position coordinate of the pressed event is any of the above controls, it is determined that the control is a draggable control.
S85:发送拖动开始事件。S85: Send a drag start event.
此时可以识别出拖动开始事件,并可以发送拖动开始事件。At this point, the drag start event can be recognized and a drag start event can be sent.
S86:结束识别。S86: End recognition.
图9是本发明实施例中拖动事件识别流程中接收到移动事件后的示意图。参见图9,该流程包括:FIG. 9 is a schematic diagram of a motion event after receiving a motion event in a drag event recognition process according to an embodiment of the present invention. Referring to Figure 9, the process includes:
S91:接收到触摸事件是移动事件。S91: The received touch event is a mobile event.
S92:判断识别是否已启动,若是,执行S94,否则,执行S93。S92: It is judged whether the recognition has been started, and if so, S94 is executed, otherwise, S93 is executed.
S93:结束识别。S93: End recognition.
S94:对移动事件进行事件入栈。S94: Perform event stacking on the mobile event.
S95:判断移动事件的位置坐标是否在可拖动控件内部,若是,执行S96,否则,执行S97。 S95: Determine whether the position coordinate of the movement event is inside the draggable control, and if yes, execute S96; otherwise, execute S97.
S96:发送拖动进行事件。S96: Send a drag to perform an event.
此时可以识别出拖动进行事件,并可以发送拖动进行事件。At this point, the dragging event can be recognized, and the drag can be sent to perform the event.
S97:发送拖动结束事件。S97: Send a drag end event.
此时可以识别出拖动结束事件,并可以发送拖动结束事件。At this point, the drag end event can be recognized and the drag end event can be sent.
图10是本发明实施例中拖动事件识别流程中接收到松开事件后的示意图。参见图10,该流程包括:FIG. 10 is a schematic diagram of a drag event recognition process in a process of receiving a release event in an embodiment of the present invention. Referring to Figure 10, the process includes:
S101:接收到触摸事件是松开事件。S101: Receiving a touch event is a release event.
S102:判断识别是否已启动,若是,执行S103,否则,执行S106。S102: It is judged whether the recognition has been started, and if so, S103 is executed, otherwise, S106 is executed.
S103:对松开事件进行事件入栈。S103: Perform an event on the release event.
S104:判断松开事件的位置坐标是否在可拖动控件内部,若是,执行S105,否则,执行S106。S104: Determine whether the position coordinate of the release event is inside the draggable control, and if yes, execute S105; otherwise, execute S106.
S105:发送拖动结束事件。S105: Send a drag end event.
此时可以识别出拖动结束事件,并可以发送拖动结束事件。At this point, the drag end event can be recognized and the drag end event can be sent.
S106:结束识别。S106: End recognition.
可以理解的是,在上述手势事件识别过程中,在识别出单击事件、双击事件或长按事件后,可以一次性将相应的手势事件发送给后续的用于事件分发的模块。而在拖动事件的识别过程中,由于拖动事件是持续一段时间的事件,因此可以在整个拖动过程中多次发送事件给后续的用于事件分发的模块。It can be understood that, in the above gesture event recognition process, after the click event, the double click event, or the long press event is recognized, the corresponding gesture event may be sent to the subsequent module for event distribution at one time. In the process of recognizing the drag event, since the drag event is an event that lasts for a period of time, the event can be sent to the subsequent module for event distribution multiple times during the entire drag process.
本实施例中,通过在待反向控制的元素是HTML页面中的元素时,根据手 势事件为元素配置HTML参数,可以使得元素根据配置的HTML参数进行处理以响应手势事件,从而实现对HTML页面中元素的反向控制,并且该反向控制流程没有调用操作系统的接口,因此可以避开移动端操作系统对接口使用的限制,方便的实现对移动端页面的反向控制。In this embodiment, when the element to be reversely controlled is an element in the HTML page, according to the hand The potential event configures the HTML parameter for the element, which can cause the element to process according to the configured HTML parameter in response to the gesture event, thereby implementing reverse control of the element in the HTML page, and the reverse control flow does not call the interface of the operating system, so Avoid the restrictions on the use of the interface by the mobile operating system, and conveniently implement reverse control of the mobile page.
图11是本发明一个实施例提出的反向控制移动端页面的装置的结构示意图。参见图11,该装置110包括:通信模块111、手势识别模块112和转换模块113。FIG. 11 is a schematic structural diagram of an apparatus for back-controling a mobile terminal according to an embodiment of the present invention. Referring to FIG. 11, the device 110 includes a communication module 111, a gesture recognition module 112, and a conversion module 113.
通信模块111用于接收其他终端发送的用于反向控制的触摸事件;The communication module 111 is configured to receive a touch event sent by another terminal for reverse control;
以其他终端是车机为例,则参见图12,通信模块可以接收车机发送的触摸事件。Taking another terminal as a vehicle, for example, referring to FIG. 12, the communication module can receive a touch event sent by the vehicle.
手势识别模块112用于根据所述触摸事件识别出手势事件,以及确定出待反向控制的元素;The gesture recognition module 112 is configured to identify a gesture event according to the touch event, and determine an element to be reversely controlled;
转换模块113用于如果所述元素是HTML页面中的元素,根据所述手势事件为所述元素配置HTML参数,以使所述元素根据所述HTML参数进行处理以响应所述手势事件。The conversion module 113 is configured to configure an HTML parameter for the element according to the gesture event if the element is an element in an HTML page, so that the element is processed according to the HTML parameter in response to the gesture event.
可选的,所述触摸事件包括:按下事件、移动事件和松开事件;Optionally, the touch event includes: a press event, a move event, and a release event;
所述手势事件包括:单击事件、双击事件、长按事件和拖动事件;The gesture events include: a click event, a double click event, a long press event, and a drag event;
所述手势识别模块具体用于:The gesture recognition module is specifically configured to:
在接收到所述触摸事件时,同时启动对单击事件、双击事件、长按事件和 拖动事件的识别。When the touch event is received, a click event, a double click event, a long press event, and The identification of the drag event.
一些实施例中,参见图12,手势识别模块112包括:第一单元、第二单元、第三单元和第四单元;In some embodiments, referring to FIG. 12, the gesture recognition module 112 includes: a first unit, a second unit, a third unit, and a fourth unit;
所述第一单元用于:The first unit is for:
如果接收的触摸事件是按下事件,对按下事件进行事件入栈;If the received touch event is a press event, an event is pushed onto the stack for the press event;
如果接收的触摸事件是移动事件,判断移动距离是否小于预设距离值,如果小于,则对移动事件进行事件入栈;If the received touch event is a moving event, it is determined whether the moving distance is less than a preset distance value, and if it is less, the event is pushed onto the stack;
如果接收的触摸事件是松开事件,判断启动时间是否在预设范围内,如果在预设范围内,则确定识别出单击事件。If the received touch event is a release event, it is determined whether the startup time is within a preset range, and if it is within the preset range, it is determined that the click event is recognized.
所述第二单元用于:The second unit is for:
识别出单击事件;Identify click events;
判断上次单击事件的时间是否不为空;Determine if the last click event is not empty;
如果不为空,计算当前时间与上次单击事件的时间的差值,并判断所述差值是否小于预设时间间隔;If it is not empty, calculate a difference between the current time and the time of the last click event, and determine whether the difference is less than a preset time interval;
如果小于,将上次单击事件的时间更新为空,并确定识别出双击事件。If it is less than, the time of the last click event is updated to null and it is determined that the double-click event is recognized.
所述第三单元用于:The third unit is used to:
如果接收的触摸事件是按下事件,对按下事件进行事件入栈;If the received touch event is a press event, an event is pushed onto the stack for the press event;
如果接收的触摸事件是移动事件,判断移动距离是否小于第二预设距离值,如果小于,则判断启动时间是否大于预设持续时间;如果大于,确定识别出长 按事件;If the received touch event is a mobile event, determine whether the moving distance is less than a second preset distance value, and if it is less, determine whether the starting time is greater than a preset duration; if greater than, determine to identify the long By event;
如果接收的触摸事件是松开事件,则结束识别。If the received touch event is a release event, the identification ends.
所述第四单元用于:The fourth unit is used to:
如果接收的触摸事件是按下事件,对按下事件进行事件入栈,以及,获取按下事件的位置坐标对应的控件,在所述空间是可拖动控件时,发送拖动开始事件;If the received touch event is a press event, the event is pushed onto the stack, and the control corresponding to the position coordinate of the pressed event is acquired, and when the space is a draggable control, the drag start event is sent;
如果接收的触摸事件是移动事件,对移动事件进行事件入栈,以及判断移动事件的位置坐标是否在可拖动控件内部,如果在内部,则发送拖动进行事件;If the received touch event is a moving event, the event is pushed onto the mobile event, and the position coordinate of the moving event is determined to be inside the draggable control, and if it is internal, the dragging event is sent;
如果接收的触摸事件是松开事件,对松开事件进行事件入栈,以及,判断松开事件的位置坐标是否在可拖动控件内部,如果在内部,则发送拖动结束事件。If the received touch event is a release event, an event is pushed onto the stack, and a position of the release event is determined to be inside the draggable control, and if it is internal, a drag end event is sent.
所述转换模块用于根据所述手势事件为所述元素配置HTML参数,包括:The converting module is configured to configure an HTML parameter for the element according to the gesture event, including:
如果所述手势事件是单击事件,则根据预先对HTML页面中的元素的标记信息,从单击事件的位置坐标对应的元素开始,从下至上查找类型是可控的元素,在查找到类型是可控的元素后,将所述元素与HTML页面中的点击事件绑定。If the gesture event is a click event, according to the mark information of the element in the HTML page in advance, starting from the element corresponding to the position coordinate of the click event, the bottom-up search type is a controllable element, and the type is found. After being a controllable element, bind the element to a click event in an HTML page.
所述转换模块用于根据所述手势事件为所述元素配置HTML参数,包括:The converting module is configured to configure an HTML parameter for the element according to the gesture event, including:
如果所述手势事件是拖动事件,从拖动事件的位置坐标对应的元素开始,从下至上查找可滚动的元素,在查找到可滚动的元素后,判断所述元素是否还 满足如下条件中的任一项:If the gesture event is a drag event, starting from an element corresponding to the position coordinate of the drag event, searching for a scrollable element from bottom to top, and after finding the scrollable element, determining whether the element is still Meet any of the following conditions:
所述元素是顶层元素,且所述元素的尺寸大于视图尺寸;或者,The element is a top element, and the size of the element is larger than a view size; or,
所述元素是普通元素,且所述元素的尺寸大于所述元素的父元素的尺寸;The element is a normal element, and the size of the element is larger than the size of the parent element of the element;
如果所述元素是可滚动元素,且还满足上述条件中的任一项,根据所述拖动事件的移动距离为所述元素配置HTML页面中的滚动参数。If the element is a scrollable element and also satisfies any of the above conditions, the scrolling parameter in the HTML page is configured for the element according to the moving distance of the drag event.
一些实施例中,参见图12,该装置110还包括:In some embodiments, referring to FIG. 12, the apparatus 110 further includes:
事件分发模块114,用于判断待反向控制的元素是否是HTML页面中的元素,并在所述元素是HTML页面中的元素时,将所述手势事件发送给所述转换模块,在所述元素是可交互的原生控件时,将所述手势事件发送给交互模块;The event distribution module 114 is configured to determine whether an element to be reversely controlled is an element in an HTML page, and send the gesture event to the conversion module when the element is an element in an HTML page, When the element is an interactive native control, the gesture event is sent to the interaction module;
交互模块115,用于将接收的所述手势事件发送给可交互的原生控件,以使可交互的原生控件响应所述手势事件。The interaction module 115 is configured to send the received gesture event to the interactive native control, so that the interactive native control responds to the gesture event.
可以理解的是,本实施例与上述的方法实施例对应,具体内容可以参见方法实施例中的相关描述,在此不再详细说明。It is to be understood that the present embodiment corresponds to the foregoing method embodiments. For details, refer to related descriptions in the method embodiments, and details are not described herein.
本实施例中,通过在待反向控制的元素是HTML页面中的元素时,根据手势事件为元素配置HTML参数,可以使得元素根据配置的HTML参数进行处理以响应手势事件,从而实现对HTML页面中元素的反向控制,并且该反向控制流程没有调用操作系统的接口,因此可以避开移动端操作系统对接口使用的限制,方便的实现对移动端页面的反向控制。In this embodiment, when the element to be reversely controlled is an element in the HTML page, the HTML parameter is configured for the element according to the gesture event, so that the element can be processed according to the configured HTML parameter to respond to the gesture event, thereby implementing the HTML page. The reverse control of the element, and the reverse control process does not call the interface of the operating system, so the restriction of the interface used by the mobile operating system can be avoided, and the reverse control of the mobile page can be conveniently implemented.
本申请实施例还提出了一种终端,包括:处理器;用于存储处理器可执行 指令的存储器;其中,所述处理器被配置为:接收其他终端发送的用于反向控制的触摸事件;根据所述触摸事件识别出手势事件,以及确定出待反向控制的元素;如果所述元素是HTML页面中的元素,根据所述手势事件为所述元素配置HTML参数,以使所述元素根据所述HTML参数进行处理以响应所述手势事件。The embodiment of the present application further provides a terminal, including: a processor; a memory of instructions, wherein the processor is configured to: receive a touch event sent by another terminal for reverse control; identify a gesture event according to the touch event, and determine an element to be reversely controlled; The element is an element in an HTML page that is configured with HTML parameters in accordance with the gesture event such that the element is processed in response to the gesture event in response to the HTML parameter.
本申请实施例还提出了一种非临时性计算机可读存储介质,当所述存储介质中的指令由终端的处理器执行时,使得终端能够执行一种反向控制移动端页面的方法,所述方法包括:接收其他终端发送的用于反向控制的触摸事件;根据所述触摸事件识别出手势事件,以及确定出待反向控制的元素;如果所述元素是HTML页面中的元素,根据所述手势事件为所述元素配置HTML参数,以使所述元素根据所述HTML参数进行处理以响应所述手势事件。The embodiment of the present application further provides a non-transitory computer readable storage medium, when the instructions in the storage medium are executed by a processor of the terminal, enabling the terminal to perform a method for back-controling the mobile page. The method includes: receiving a touch event sent by another terminal for reverse control; identifying a gesture event according to the touch event, and determining an element to be inversely controlled; if the element is an element in an HTML page, according to The gesture event configures an HTML parameter for the element to cause the element to process in accordance with the HTML parameter in response to the gesture event.
本申请实施例还提出了一种计算机程序产品,当所述计算机程序产品中的指令被处理器执行时,执行一种反向控制移动端页面的方法,所述方法包括:接收其他终端发送的用于反向控制的触摸事件;根据所述触摸事件识别出手势事件,以及确定出待反向控制的元素;如果所述元素是HTML页面中的元素,根据所述手势事件为所述元素配置HTML参数,以使所述元素根据所述HTML参数进行处理以响应所述手势事件。The embodiment of the present application further provides a computer program product, when an instruction in the computer program product is executed by a processor, performing a method for back-controlling a mobile page, the method comprising: receiving a sending by another terminal a touch event for reverse control; recognizing a gesture event based on the touch event, and determining an element to be inversely controlled; if the element is an element in an HTML page, configuring the element according to the gesture event An HTML parameter to cause the element to process in accordance with the HTML parameter in response to the gesture event.
需要说明的是,在本发明的描述中,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。此外,在本发明的描述中,除非另 有说明,“多个”的含义是指至少两个。It should be noted that in the description of the present invention, the terms "first", "second" and the like are used for descriptive purposes only, and are not to be construed as indicating or implying relative importance. Moreover, in the description of the present invention, unless otherwise It has been stated that the meaning of "multiple" means at least two.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本发明的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本发明的实施例所属技术领域的技术人员所理解。Any process or method description in the flowcharts or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a particular logical function or process. And the scope of the preferred embodiments of the invention includes additional implementations, in which the functions may be performed in a substantially simultaneous manner or in an opposite order depending on the functions involved, in the order shown or discussed. It will be understood by those skilled in the art to which the embodiments of the present invention pertain.
应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that portions of the invention may be implemented in hardware, software, firmware or a combination thereof. In the above-described embodiments, multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals. Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。One of ordinary skill in the art can understand that all or part of the steps carried by the method of implementing the above embodiments can be completed by a program to instruct related hardware, and the program can be stored in a computer readable storage medium. When executed, one or a combination of the steps of the method embodiments is included.
此外,在本发明各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块 中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. in. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. The integrated modules, if implemented in the form of software functional modules and sold or used as stand-alone products, may also be stored in a computer readable storage medium.
上述提到的存储介质可以是只读存储器,磁盘或光盘等。The above mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。In the description of the present specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" and the like means a specific feature described in connection with the embodiment or example. A structure, material or feature is included in at least one embodiment or example of the invention. In the present specification, the schematic representation of the above terms does not necessarily mean the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples.
尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。 Although the embodiments of the present invention have been shown and described, it is understood that the above-described embodiments are illustrative and are not to be construed as limiting the scope of the invention. The embodiments are subject to variations, modifications, substitutions and variations.

Claims (22)

  1. 一种反向控制移动端页面的方法,其特征在于,包括:A method for inversely controlling a mobile page, which is characterized by comprising:
    接收其他终端发送的用于反向控制的触摸事件;Receiving touch events sent by other terminals for reverse control;
    根据所述触摸事件识别出手势事件,以及确定出待反向控制的元素;Identifying a gesture event according to the touch event, and determining an element to be reversely controlled;
    如果所述元素是HTML页面中的元素,根据所述手势事件为所述元素配置HTML参数,以使所述元素根据所述HTML参数进行处理以响应所述手势事件。If the element is an element in an HTML page, an HTML parameter is configured for the element in accordance with the gesture event such that the element is processed in response to the gesture event in response to the gesture parameter.
  2. 根据权利要求1所述的方法,其特征在于,The method of claim 1 wherein
    所述触摸事件包括:按下事件、移动事件和松开事件;The touch event includes: a press event, a move event, and a release event;
    所述手势事件包括:单击事件、双击事件、长按事件和拖动事件。The gesture events include: a click event, a double click event, a long press event, and a drag event.
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述触摸事件识别出手势事件,包括:The method according to claim 2, wherein the recognizing the gesture event according to the touch event comprises:
    在接收到所述触摸事件时,同时启动对单击事件、双击事件、长按事件和拖动事件的识别。Upon receiving the touch event, recognition of a click event, a double click event, a long press event, and a drag event is simultaneously initiated.
  4. 根据权利要求2-3任一项所述的方法,其特征在于,在识别单击事件时,所述根据所述触摸事件识别出手势事件,包括:The method according to any one of claims 2-3, wherein, when the click event is recognized, the recognizing the gesture event according to the touch event comprises:
    如果接收的触摸事件是按下事件,对按下事件进行事件入栈;If the received touch event is a press event, an event is pushed onto the stack for the press event;
    如果接收的触摸事件是移动事件,判断移动距离是否小于预设距离值,如果小于,则对移动事件进行事件入栈; If the received touch event is a moving event, it is determined whether the moving distance is less than a preset distance value, and if it is less, the event is pushed onto the stack;
    如果接收的触摸事件是松开事件,判断启动时间是否在预设范围内,如果在预设范围内,则确定识别出单击事件。If the received touch event is a release event, it is determined whether the startup time is within a preset range, and if it is within the preset range, it is determined that the click event is recognized.
  5. 根据权利要求2-4任一项所述的方法,其特征在于,在识别双击事件时,所述根据所述触摸事件识别出手势事件,包括:The method according to any one of claims 2 to 4, wherein, when the double-click event is recognized, the recognizing the gesture event according to the touch event comprises:
    识别出单击事件;Identify click events;
    判断上次单击事件的时间是否不为空;Determine if the last click event is not empty;
    如果不为空,计算当前时间与上次单击事件的时间的差值,并判断所述差值是否小于预设时间间隔;If it is not empty, calculate a difference between the current time and the time of the last click event, and determine whether the difference is less than a preset time interval;
    如果小于,将上次单击事件的时间更新为空,并确定识别出双击事件。If it is less than, the time of the last click event is updated to null and it is determined that the double-click event is recognized.
  6. 根据权利要求2-5任一项所述的方法,其特征在于,在识别长按事件时,所述根据所述触摸事件识别出手势事件,包括:The method according to any one of claims 2 to 5, wherein, when recognizing a long press event, the recognizing a gesture event according to the touch event comprises:
    如果接收的触摸事件是按下事件,对按下事件进行事件入栈;If the received touch event is a press event, an event is pushed onto the stack for the press event;
    如果接收的触摸事件是移动事件,判断移动距离是否小于第二预设距离值,如果小于,则判断启动时间是否大于预设持续时间;如果大于,确定识别出长按事件;If the received touch event is a moving event, it is determined whether the moving distance is less than a second preset distance value, and if it is less, determining whether the starting time is greater than a preset duration; if greater than, determining to identify a long press event;
    如果接收的触摸事件是松开事件,则结束识别。If the received touch event is a release event, the identification ends.
  7. 根据权利要求2-6任一项所述的方法,其特征在于,在识别拖动事件时,所述拖动事件包括:拖动开始事件、拖动进行事件和拖动结束事件,所述根据所述触摸事件识别出手势事件,包括: The method according to any one of claims 2-6, wherein, when the drag event is recognized, the drag event includes: a drag start event, a drag progress event, and a drag end event, the basis The touch event identifies a gesture event, including:
    如果接收的触摸事件是按下事件,对按下事件进行事件入栈,以及,获取按下事件的位置坐标对应的控件,在所述空间是可拖动控件时,发送拖动开始事件;If the received touch event is a press event, the event is pushed onto the stack, and the control corresponding to the position coordinate of the pressed event is acquired, and when the space is a draggable control, the drag start event is sent;
    如果接收的触摸事件是移动事件,对移动事件进行事件入栈,以及判断移动事件的位置坐标是否在可拖动控件内部,如果在内部,则发送拖动进行事件;If the received touch event is a moving event, the event is pushed onto the mobile event, and the position coordinate of the moving event is determined to be inside the draggable control, and if it is internal, the dragging event is sent;
    如果接收的触摸事件是松开事件,对松开事件进行事件入栈,以及,判断松开事件的位置坐标是否在可拖动控件内部,如果在内部,则发送拖动结束事件。If the received touch event is a release event, an event is pushed onto the stack, and a position of the release event is determined to be inside the draggable control, and if it is internal, a drag end event is sent.
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述根据所述手势事件为所述元素配置HTML参数,包括:The method according to any one of claims 1 to 7, wherein the configuring the HTML parameter for the element according to the gesture event comprises:
    如果所述手势事件是单击事件,则根据预先对HTML页面中的元素的标记信息,从单击事件的位置坐标对应的元素开始,从下至上查找类型是可控的元素,在查找到类型是可控的元素后,将所述元素与HTML页面中的点击事件绑定。If the gesture event is a click event, according to the mark information of the element in the HTML page in advance, starting from the element corresponding to the position coordinate of the click event, the bottom-up search type is a controllable element, and the type is found. After being a controllable element, bind the element to a click event in an HTML page.
  9. 根据权利要求1-8任一项所述的方法,其特征在于,所述根据所述手势事件为所述元素配置HTML参数,包括:The method according to any one of claims 1-8, wherein the configuring the HTML parameter for the element according to the gesture event comprises:
    如果所述手势事件是拖动事件,从拖动事件的位置坐标对应的元素开始,从下至上查找可滚动的元素,在查找到可滚动的元素后,判断所述元素是否还满足如下条件中的任一项: If the gesture event is a drag event, starting from an element corresponding to the position coordinate of the drag event, searching for a scrollable element from bottom to top, and after finding the scrollable element, determining whether the element further satisfies the following conditions: Any of the following:
    所述元素是顶层元素,且所述元素的尺寸大于视图尺寸;或者,The element is a top element, and the size of the element is larger than a view size; or,
    所述元素是普通元素,且所述元素的尺寸大于所述元素的父元素的尺寸;The element is a normal element, and the size of the element is larger than the size of the parent element of the element;
    如果所述元素是可滚动元素,且还满足上述条件中的任一项,根据所述拖动事件的移动距离为所述元素配置HTML页面中的滚动参数。If the element is a scrollable element and also satisfies any of the above conditions, the scrolling parameter in the HTML page is configured for the element according to the moving distance of the drag event.
  10. 根据权利要求1-9任一项所述的方法,其特征在于,还包括:The method of any of claims 1-9, further comprising:
    判断待反向控制的元素是否是HTML页面中的元素;Determining whether the element to be reversely controlled is an element in an HTML page;
    如果所述待反向控制的元素是可交互的原生控件,则将识别出的手势事件发送给可交互的原生控件,以使可交互的原生控件响应所述手势事件。If the element to be back-controlled is an interactive native control, the recognized gesture event is sent to the interactive native control such that the interactive native control responds to the gesture event.
  11. 一种反向控制移动端页面的装置,其特征在于,包括:A device for controlling a mobile page in reverse, comprising:
    通信模块,用于接收其他终端发送的用于反向控制的触摸事件;a communication module, configured to receive a touch event sent by another terminal for reverse control;
    手势识别模块,用于根据所述触摸事件识别出手势事件,以及确定出待反向控制的元素;a gesture recognition module, configured to identify a gesture event according to the touch event, and determine an element to be reversely controlled;
    转换模块,用于如果所述元素是HTML页面中的元素,根据所述手势事件为所述元素配置HTML参数,以使所述元素根据所述HTML参数进行处理以响应所述手势事件。And a conversion module, configured to configure an HTML parameter for the element according to the gesture event, if the element is an element in an HTML page, to cause the element to process according to the HTML parameter in response to the gesture event.
  12. 根据权利要求11所述的装置,其特征在于,所述触摸事件包括:按下事件、移动事件和松开事件;所述手势事件包括:单击事件、双击事件、长按事件和拖动事件;所述手势识别模块具体用于:The device according to claim 11, wherein the touch event comprises: a press event, a move event, and a release event; the gesture event includes: a click event, a double click event, a long press event, and a drag event The gesture recognition module is specifically configured to:
    在接收到所述触摸事件时,同时启动对单击事件、双击事件、长按事件和 拖动事件的识别。When the touch event is received, a click event, a double click event, a long press event, and The identification of the drag event.
  13. 根据权利要求11-12任一项所述的装置,其特征在于,所述手势识别模块包括用于识别单击事件的第一单元,所述第一单元用于:The device according to any one of claims 11 to 12, wherein the gesture recognition module comprises a first unit for identifying a click event, the first unit for:
    如果接收的触摸事件是按下事件,对按下事件进行事件入栈;If the received touch event is a press event, an event is pushed onto the stack for the press event;
    如果接收的触摸事件是移动事件,判断移动距离是否小于预设距离值,如果小于,则对移动事件进行事件入栈;If the received touch event is a moving event, it is determined whether the moving distance is less than a preset distance value, and if it is less, the event is pushed onto the stack;
    如果接收的触摸事件是松开事件,判断启动时间是否在预设范围内,如果在预设范围内,则确定识别出单击事件。If the received touch event is a release event, it is determined whether the startup time is within a preset range, and if it is within the preset range, it is determined that the click event is recognized.
  14. 根据权利要求11-13任一项所述的装置,其特征在于,所述手势识别模块包括用于识别双击事件的第二单元,所述第二单元用于:The device according to any one of claims 11 to 13, wherein the gesture recognition module comprises a second unit for identifying a double click event, the second unit for:
    识别出单击事件;Identify click events;
    判断上次单击事件的时间是否不为空;Determine if the last click event is not empty;
    如果不为空,计算当前时间与上次单击事件的时间的差值,并判断所述差值是否小于预设时间间隔;If it is not empty, calculate a difference between the current time and the time of the last click event, and determine whether the difference is less than a preset time interval;
    如果小于,将上次单击事件的时间更新为空,并确定识别出双击事件。If it is less than, the time of the last click event is updated to null and it is determined that the double-click event is recognized.
  15. 根据权利要求11-14任一项所述的装置,其特征在于,所述手势识别模块包括用于识别长按事件的第三单元,所述第三单元用于:The device according to any one of claims 11-14, wherein the gesture recognition module comprises a third unit for identifying a long press event, the third unit for:
    如果接收的触摸事件是按下事件,对按下事件进行事件入栈;If the received touch event is a press event, an event is pushed onto the stack for the press event;
    如果接收的触摸事件是移动事件,判断移动距离是否小于第二预设距离值, 如果小于,则判断启动时间是否大于预设持续时间;如果大于,确定识别出长按事件;If the received touch event is a moving event, determining whether the moving distance is less than a second preset distance value, If it is smaller, it is determined whether the startup time is greater than a preset duration; if it is greater, it is determined that a long press event is recognized;
    如果接收的触摸事件是松开事件,则结束识别。If the received touch event is a release event, the identification ends.
  16. 根据权利要求11-15任一项所述的装置,其特征在于,所述拖动事件包括:拖动开始事件、拖动进行事件和拖动结束事件,所述手势识别模块包括用于识别拖动事件的第四单元,所述第四单元用于:The device according to any one of claims 11-15, wherein the drag event comprises: a drag start event, a drag progress event, and a drag end event, the gesture recognition module includes The fourth unit of the event, the fourth unit is used to:
    如果接收的触摸事件是按下事件,对按下事件进行事件入栈,以及,获取按下事件的位置坐标对应的控件,在所述空间是可拖动控件时,发送拖动开始事件;If the received touch event is a press event, the event is pushed onto the stack, and the control corresponding to the position coordinate of the pressed event is acquired, and when the space is a draggable control, the drag start event is sent;
    如果接收的触摸事件是移动事件,对移动事件进行事件入栈,以及判断移动事件的位置坐标是否在可拖动控件内部,如果在内部,则发送拖动进行事件;If the received touch event is a moving event, the event is pushed onto the mobile event, and the position coordinate of the moving event is determined to be inside the draggable control, and if it is internal, the dragging event is sent;
    如果接收的触摸事件是松开事件,对松开事件进行事件入栈,以及,判断松开事件的位置坐标是否在可拖动控件内部,如果在内部,则发送拖动结束事件。If the received touch event is a release event, an event is pushed onto the stack, and a position of the release event is determined to be inside the draggable control, and if it is internal, a drag end event is sent.
  17. 根据权利要求11-16任一项所述的装置,其特征在于,所述转换模块用于根据所述手势事件为所述元素配置HTML参数,包括:The device according to any one of claims 11 to 16, wherein the conversion module is configured to configure HTML parameters for the element according to the gesture event, including:
    如果所述手势事件是单击事件,则根据预先对HTML页面中的元素的标记信息,从单击事件的位置坐标对应的元素开始,从下至上查找类型是可控的元素,在查找到类型是可控的元素后,将所述元素与HTML页面中的点击事件绑 定。If the gesture event is a click event, according to the mark information of the element in the HTML page in advance, starting from the element corresponding to the position coordinate of the click event, the bottom-up search type is a controllable element, and the type is found. After being a controllable element, tie the element to a click event in the HTML page set.
  18. 根据权利要求11-17任一项所述的装置,其特征在于,所述转换模块用于根据所述手势事件为所述元素配置HTML参数,包括:The device according to any one of claims 11-17, wherein the conversion module is configured to configure HTML parameters for the element according to the gesture event, including:
    如果所述手势事件是拖动事件,从拖动事件的位置坐标对应的元素开始,从下至上查找可滚动的元素,在查找到可滚动的元素后,判断所述元素是否还满足如下条件中的任一项:If the gesture event is a drag event, starting from an element corresponding to the position coordinate of the drag event, searching for a scrollable element from bottom to top, and after finding the scrollable element, determining whether the element further satisfies the following conditions: Any of the following:
    所述元素是顶层元素,且所述元素的尺寸大于视图尺寸;或者,The element is a top element, and the size of the element is larger than a view size; or,
    所述元素是普通元素,且所述元素的尺寸大于所述元素的父元素的尺寸;The element is a normal element, and the size of the element is larger than the size of the parent element of the element;
    如果所述元素是可滚动元素,且还满足上述条件中的任一项,根据所述拖动事件的移动距离为所述元素配置HTML页面中的滚动参数。If the element is a scrollable element and also satisfies any of the above conditions, the scrolling parameter in the HTML page is configured for the element according to the moving distance of the drag event.
  19. 根据权利要求11-18任一项所述的装置,其特征在于,还包括:The device according to any one of claims 11 to 18, further comprising:
    事件分发模块,用于判断待反向控制的元素是否是HTML页面中的元素,并在所述元素是HTML页面中的元素时,将所述手势事件发送给所述转换模块,在所述元素是可交互的原生控件时,将所述手势事件发送给交互模块;An event distribution module, configured to determine whether an element to be reversely controlled is an element in an HTML page, and when the element is an element in an HTML page, send the gesture event to the conversion module, where the element When the native control is interactive, the gesture event is sent to the interaction module;
    交互模块,用于将接收的所述手势事件发送给可交互的原生控件,以使可交互的原生控件响应所述手势事件。And an interaction module, configured to send the received gesture event to the interactive native control, so that the interactive native control responds to the gesture event.
  20. 一种终端,其特征在于,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为:A terminal, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to:
    接收其他终端发送的用于反向控制的触摸事件; Receiving touch events sent by other terminals for reverse control;
    根据所述触摸事件识别出手势事件,以及确定出待反向控制的元素;Identifying a gesture event according to the touch event, and determining an element to be reversely controlled;
    如果所述元素是HTML页面中的元素,根据所述手势事件为所述元素配置HTML参数,以使所述元素根据所述HTML参数进行处理以响应所述手势事件。If the element is an element in an HTML page, an HTML parameter is configured for the element in accordance with the gesture event such that the element is processed in response to the gesture event in response to the gesture parameter.
  21. 一种非临时性计算机可读存储介质,其特征在于,当所述存储介质中的指令由终端的处理器执行时,使得终端能够执行一种反向控制移动端页面的方法,所述方法包括:A non-transitory computer readable storage medium characterized by enabling a terminal to perform a method of back-controlling a mobile page when the instructions in the storage medium are executed by a processor of the terminal, the method comprising :
    接收其他终端发送的用于反向控制的触摸事件;Receiving touch events sent by other terminals for reverse control;
    根据所述触摸事件识别出手势事件,以及确定出待反向控制的元素;Identifying a gesture event according to the touch event, and determining an element to be reversely controlled;
    如果所述元素是HTML页面中的元素,根据所述手势事件为所述元素配置HTML参数,以使所述元素根据所述HTML参数进行处理以响应所述手势事件。If the element is an element in an HTML page, an HTML parameter is configured for the element in accordance with the gesture event such that the element is processed in response to the gesture event in response to the gesture parameter.
  22. 一种计算机程序产品,其特征在于,当所述计算机程序产品中的指令被处理器执行时,执行一种反向控制移动端页面的方法,所述方法包括:A computer program product, wherein when an instruction in the computer program product is executed by a processor, a method of back-controlling a mobile page is performed, the method comprising:
    接收其他终端发送的用于反向控制的触摸事件;Receiving touch events sent by other terminals for reverse control;
    根据所述触摸事件识别出手势事件,以及确定出待反向控制的元素;Identifying a gesture event according to the touch event, and determining an element to be reversely controlled;
    如果所述元素是HTML页面中的元素,根据所述手势事件为所述元素配置HTML参数,以使所述元素根据所述HTML参数进行处理以响应所述手势事件。 If the element is an element in an HTML page, an HTML parameter is configured for the element in accordance with the gesture event such that the element is processed in response to the gesture event in response to the gesture parameter.
PCT/CN2016/108933 2016-03-31 2016-12-07 Method and device for reversely controlling mobile page WO2017166858A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610202382.5A CN105912319B (en) 2016-03-31 2016-03-31 The method and apparatus of the Reverse Turning Control mobile terminal page
CN201610202382.5 2016-03-31

Publications (1)

Publication Number Publication Date
WO2017166858A1 true WO2017166858A1 (en) 2017-10-05

Family

ID=56745274

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/108933 WO2017166858A1 (en) 2016-03-31 2016-12-07 Method and device for reversely controlling mobile page

Country Status (2)

Country Link
CN (1) CN105912319B (en)
WO (1) WO2017166858A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112637539A (en) * 2020-12-15 2021-04-09 浪潮云信息技术股份公司 Method for drawing video playback time axis based on Canvas

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105912319B (en) * 2016-03-31 2019-03-12 百度在线网络技术(北京)有限公司 The method and apparatus of the Reverse Turning Control mobile terminal page
CN108268205A (en) * 2016-12-30 2018-07-10 乐视汽车(北京)有限公司 Vehicle device is to the touch screen countercharge method and system of mobile terminal
CN110794999B (en) * 2019-10-28 2021-01-15 珠海格力电器股份有限公司 Automatic control method and device based on interface segmentation and terminal

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101840299A (en) * 2010-03-18 2010-09-22 华为终端有限公司 Touch operation method, device and mobile terminal
CN103076919A (en) * 2012-12-29 2013-05-01 广东志成冠军集团有限公司 Wireless touch remote control method and system
US20140223490A1 (en) * 2013-02-07 2014-08-07 Shanghai Powermo Information Tech. Co. Ltd. Apparatus and method for intuitive user interaction between multiple devices
CN104571981A (en) * 2013-10-14 2015-04-29 苏州峰通光电有限公司 Display control terminal and automotive electronic device
CN105912319A (en) * 2016-03-31 2016-08-31 百度在线网络技术(北京)有限公司 Method and device for reverse control over pages of mobile terminals

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8174502B2 (en) * 2008-03-04 2012-05-08 Apple Inc. Touch event processing for web pages
US8416196B2 (en) * 2008-03-04 2013-04-09 Apple Inc. Touch event model programming interface
KR101384603B1 (en) * 2013-02-20 2014-04-11 주식회사 알엔웨어 System for the transmission-reception and the reverse control of wireless video signal
CN104035714B (en) * 2014-06-24 2017-05-03 中科创达软件股份有限公司 Event processing method, device and equipment based on Android system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101840299A (en) * 2010-03-18 2010-09-22 华为终端有限公司 Touch operation method, device and mobile terminal
CN103076919A (en) * 2012-12-29 2013-05-01 广东志成冠军集团有限公司 Wireless touch remote control method and system
US20140223490A1 (en) * 2013-02-07 2014-08-07 Shanghai Powermo Information Tech. Co. Ltd. Apparatus and method for intuitive user interaction between multiple devices
CN104571981A (en) * 2013-10-14 2015-04-29 苏州峰通光电有限公司 Display control terminal and automotive electronic device
CN105912319A (en) * 2016-03-31 2016-08-31 百度在线网络技术(北京)有限公司 Method and device for reverse control over pages of mobile terminals

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112637539A (en) * 2020-12-15 2021-04-09 浪潮云信息技术股份公司 Method for drawing video playback time axis based on Canvas

Also Published As

Publication number Publication date
CN105912319A (en) 2016-08-31
CN105912319B (en) 2019-03-12

Similar Documents

Publication Publication Date Title
US10990268B2 (en) Operation method and terminal device
AU2022203278B2 (en) Recording and broadcasting application visual output
WO2017166858A1 (en) Method and device for reversely controlling mobile page
EP2811400B1 (en) Method for executing program and electronic device thereof
WO2019206158A1 (en) Interface displaying method, apparatus, and device
CN105320417B (en) Page switching method and client
WO2015031546A1 (en) Gesture-based content sharing between devices
KR20140091439A (en) System and method for detecting three dimensional gestures to initiate and complete the transfer of application data between networked devices
CN103150109A (en) Touch event model for web pages
US20190258691A1 (en) Method and system for controlling presentation of web resources in a browser window
US20130162519A1 (en) Cross-platform human input customization
WO2017215671A1 (en) Method, apparatus and system for controlling access device
TWI605379B (en) Form processing method and terminal
WO2013182141A1 (en) Man-machine interaction method and device and electronic apparatus thereof
CN106528163B (en) A kind of page switching method and device
CN104090752A (en) Method for promoting customization of shortcut icon on desktop of android system
US20160192117A1 (en) Data transmission method and first electronic device
CN104598133A (en) Instruction book generating method and device for object
US11334240B2 (en) Method, device, electronic device, and storage medium for sending and receiving message
KR101961907B1 (en) Method of providing contents of a mobile terminal based on a duration of a user's touch
WO2017096797A1 (en) Operating assembly control method and system based on motion sensing
US9773409B1 (en) Automatically configuring a remote control for a device
KR101491056B1 (en) Touch screen terminal apparatus and method for supporting mouse user interface in server based computing system of terminal environment
US10445488B2 (en) Intuitive touch gesture-based data transfer between devices
KR101506006B1 (en) Touch screen terminal apparatus and method for supporting dynamically displayed mouse user interface in server based computing system of terminal environment

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16896626

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16896626

Country of ref document: EP

Kind code of ref document: A1