WO2021164460A1 - 触摸响应方法、装置、电子设备及存储介质 - Google Patents

触摸响应方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2021164460A1
WO2021164460A1 PCT/CN2021/071080 CN2021071080W WO2021164460A1 WO 2021164460 A1 WO2021164460 A1 WO 2021164460A1 CN 2021071080 W CN2021071080 W CN 2021071080W WO 2021164460 A1 WO2021164460 A1 WO 2021164460A1
Authority
WO
WIPO (PCT)
Prior art keywords
touch
touch operation
application
application program
preset
Prior art date
Application number
PCT/CN2021/071080
Other languages
English (en)
French (fr)
Inventor
吴恒刚
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2021164460A1 publication Critical patent/WO2021164460A1/zh

Links

Images

Classifications

    • 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/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
    • G06F3/0416Control or interface arrangements specially adapted for digitisers
    • G06F3/0418Control or interface arrangements specially adapted for digitisers for error correction or compensation, e.g. based on parallax, calibration or alignment
    • 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/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04842Selection of displayed objects or displayed text elements
    • 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/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04847Interaction techniques to control parameter settings, e.g. interaction with sliders or dials

Definitions

  • This application relates to the field of human-computer interaction technology, and more specifically, to a touch response method, device, electronic device, and storage medium.
  • This application proposes a touch response method, device, electronic device, and storage medium to reduce the power consumption of the electronic device.
  • the embodiments of the present application provide a touch response method to receive a touch operation acting on a touch screen; if the starting position of the touch operation is a preset position, the touch event corresponding to the touch operation is distributed to the first An application program and intercept the touch event corresponding to the touch operation distributed to the second application program, the preset position is the trigger position of the first application program, and the trigger position of the second application program includes The preset position and other positions displayed in the current window; when the touch operation satisfies the trigger condition of the first application program, the first application program responds to the touch event corresponding to the touch operation; When the touch operation does not satisfy the trigger condition of the first application, a touch event corresponding to the touch operation is distributed to the second application.
  • an embodiment of the present application provides a touch response device.
  • a receiving module is used to receive a touch operation on a touch screen; and an interception module is used to distribute if the starting position of the touch operation is a preset position.
  • the touch event corresponding to the touch operation is given to the first application program, and the touch event corresponding to the touch operation distributed to the second application program is intercepted, and the preset position is the trigger position of the first application program,
  • the trigger position of the second application includes the preset position and other positions displayed in the current window;
  • the first response module is configured to control the triggering condition of the first application when the touch operation meets the trigger condition of the first application.
  • the first application program responds to the touch event corresponding to the touch operation;
  • the second response module is configured to perform the touch operation corresponding to the touch operation when the touch operation does not meet the trigger condition of the first application program.
  • the event is distributed to the second application.
  • an embodiment of the present application provides an electronic device.
  • the server includes one or more processors, a memory, and a computer program that is stored on the memory and can run on the processor.
  • the computer program When executed by the processor, the method applied to the server as described above is realized.
  • an embodiment of the present application provides a computer-readable storage medium in which a program code is stored, wherein the above-mentioned method is executed when the program code is running.
  • Fig. 1 shows a flowchart of a touch response method provided by an embodiment of the present application.
  • FIG. 2 shows a schematic diagram of a trigger position of a first application program and a trigger position of a second application program provided by an embodiment of the present application.
  • Fig. 3 shows a flowchart of a touch response method provided by another embodiment of the present application.
  • FIG. 4 shows a flowchart of a touch response method provided by another embodiment of the present application.
  • FIG. 5 shows a flowchart of part of the steps of the touch response method provided on the basis of the embodiment provided in FIG. 4.
  • Fig. 6 shows a functional module diagram of a device for reporting points on a touch screen provided in an embodiment of the present application.
  • FIG. 7 shows a structural block diagram of an electronic device proposed by an embodiment of the present application for executing the touch response method according to the embodiment of the present application.
  • FIG. 8 shows a storage medium provided by an embodiment of the present application for storing or carrying program code for implementing the touch response method according to the embodiment of the present application.
  • a touch screen which is used to interact with the electronic device through the touch screen, for example, to manipulate applications installed in the electronic device.
  • the processor of the electronic device processes the received touch event to respond to the touch event, thereby realizing interaction with the user.
  • navigation keys can be displayed on an electronic device, and the display form of the navigation keys can be floating on any interface, draggable floating controls, or fixed virtual operation buttons at the bottom of the screen for global control.
  • the return key in the navigation key can return to the previous level, which is valid for any application and displayed content.
  • full screens With the development of full screens, the screen-to-body ratio of electronic devices has further increased, and the screens that can be manipulated have become larger and larger. If floating controls or virtual operation buttons fixed at the bottom of the screen are used, precise click operations are not easy. As a result, full-screen gestures have entered people's field of vision along with the development of full-screen. Generally, full-screen gestures mainly rely on fixed gestures or touch operations to achieve specific functions. For example, they can be swiping up from the bottom of the screen to display running tasks.
  • the drive layer of the electronic device receives touch operations and distributes the touch operations to the system through the inputdispatcher.
  • the full-screen gesture application and the view system that is, the application displayed in the current window, receive the touch operation at the same time.
  • a cancel event is sent to the view system, otherwise, the view system performs the touch operation response. Since the view system and the full-screen gesture application receive touch operations at the same time, it is easy to cause false touches in the scene.
  • the inventor proposes the touch response method, device, electronic device, and storage medium in this application to receive the touch operation acting on the touch screen; if the starting position of the touch operation is a preset position, distribute the corresponding touch operation To the first application program, and intercept the touch event corresponding to the touch operation distributed to the second application program; when the touch operation meets the trigger condition of the first application program, the first application program The program responds to the touch event corresponding to the touch operation; when the touch operation does not satisfy the trigger condition of the first application program, the touch event corresponding to the touch operation is distributed to the second application program.
  • the touch event corresponding to the touch operation distributed to the second application program is intercepted, so as to prevent the first application program and the second application program from receiving the touch event at the same time and cause a false touch.
  • the first application responds to the touch operation to implement the function of the first application, and when the touch operation does not meet the touch condition of the first application, the touch operation is intercepted
  • the corresponding trigger event is reissued to the second application program to realize the function of the second application program, and without affecting the functions of each application program, the accuracy of responding to the touch event corresponding to the touch operation is improved.
  • an embodiment of the present application provides a touch response method.
  • the execution subject of the processing procedure described in this embodiment may be an electronic device, and the specific method may include:
  • Step S110 receiving a touch operation acting on the touch screen.
  • an electronic device is equipped with a touch screen, and the user can operate the electronic device on the touch screen to define the user's operation on the touch screen as a touch operation, where the touch operation can be a click, a double tap, a slide, etc.
  • the electronic device may receive the touch operation.
  • Step S120 If the starting position of the touch operation is the preset position, distribute the touch event corresponding to the touch operation to the first application program, and perform the touch event corresponding to the touch operation distributed to the second application program Intercept.
  • the electronic device When the electronic device acquires the touch operation, it can acquire the start position of the touch operation, and if the start position of the touch operation is a preset position, then distribute the touch event corresponding to the touch operation to the first Application program, and intercept the touch event corresponding to the touch operation distributed to the second application program.
  • the electronic device When the electronic device acquires the touch operation, it may process the touch operation and generate a touch event corresponding to the touch operation.
  • the touch event may include a down event, a move event, or It is the up event and so on. Therefore, when the electronic device receives the touch operation, it can judge and process the received touch operation to generate a touch event corresponding to the touch operation, so that the touch event corresponding to the touch operation can be distributed or processed. Intercept.
  • the first application program may be an application program that can be used in any display window, for example, a full-screen gesture function. On any interface of an electronic device, a corresponding function can be realized through a full-screen gesture.
  • the second application program may be the application program in the current display window of the electronic device. For example, if the application program A is currently displayed on the electronic device, then the application program A is the second application program. If after a period of time, the user uses the application B on the electronic device, and the application B is displayed in the current window of the electronic device, then the application B is the second application.
  • the trigger position of the first application program is the preset position, and if a touch operation is detected at the preset position, it is possible to trigger the function corresponding to the first application program.
  • the preset position may be a continuous whole block area or a collection of multiple discontinuous areas.
  • the second application program is displayed in the current display window of the electronic device, the trigger position of the second application program may include the preset position, and the second application program is displayed in the current display window of the electronic device.
  • FIG. 2 shows a schematic diagram of the preset position and the trigger position of the second application program.
  • the area indicated by 11 is the preset position
  • a touch operation needs to be detected at the area indicated by 11, and the area indicated by 12
  • the area of is the trigger position of the second application, which is all the display areas of the entire touch screen, including the preset position indicated by 11.
  • performing a touch operation can realize the correspondence of the second application Function.
  • Step S130 When the touch operation satisfies the trigger condition of the first application program, the first application program responds to the touch event corresponding to the touch operation.
  • a touch operation needs to be detected at the preset position, and the touch operation needs to satisfy a trigger condition of the first application program.
  • the first application is a full-screen gesture application, and when the finger slides horizontally from the left edge of the screen to the inside of the screen, it returns to the previous level. Then its corresponding preset position is the left edge of the screen, and the trigger condition is to slide horizontally to the inside of the screen. Only when sliding horizontally from the left edge of the screen to the inside of the screen can it return to the previous level.
  • the first application program can correspond to the touch operation To respond to the touch event to implement the function of the first application.
  • Step S140 When the touch operation does not satisfy the trigger condition of the first application, a touch event corresponding to the touch operation is distributed to the second application.
  • the touch operation When the touch operation does not satisfy the trigger condition of the first application program, it indicates that the intention of the touch operation is not to execute the function of the first application program, and it may be the function of executing the second application program. Since the touch event corresponding to the touch operation distributed to the second application was intercepted previously, when the touch operation does not meet the trigger condition of the first application, the touch event corresponding to the intercepted touch operation can be redistributed to the The second application program, so that the second application program can respond to the touch event corresponding to the touch operation, so as to realize the function of the second application program.
  • the touch response method proposed in this application receives a touch operation acting on a touch screen; if the starting position of the touch operation is a preset position, the touch event corresponding to the touch operation is distributed to the first application program and distributed to Intercept the touch event corresponding to the touch operation of the second application; when the touch operation meets the trigger condition of the first application, the first application responds to the touch event corresponding to the touch operation; When the touch operation does not satisfy the trigger condition of the first application, a touch event corresponding to the touch operation is distributed to the second application.
  • the touch event corresponding to the touch operation distributed to the second application program is intercepted, so as to prevent the first application program and the second application program from receiving the touch event at the same time and causing false touches.
  • the first application When the touch operation meets the trigger condition of the first application, the first application responds to the touch operation to implement the function of the first application, and when the touch operation does not meet the touch condition of the first application, the touch operation is intercepted
  • the corresponding trigger event is reissued to the second application program to realize the function of the second application program, and without affecting the functions of each application program, the accuracy of responding to the touch event corresponding to the touch operation is improved.
  • FIG. 3 another embodiment of the present application provides a touch response method.
  • this embodiment focuses on the process of determining whether the starting position of the touch operation is a preset position.
  • Can include:
  • Step S210 receiving a touch operation acting on the touch screen.
  • step S210 reference may be made to the corresponding part of the foregoing embodiment, which will not be repeated here.
  • Step S220 Obtain the active position of the initial touch operation of the touch operation on the touch screen.
  • Touch operation can be understood as a continuous operation where a finger touches the touch screen and continues to perform on the touch screen.
  • Each touch operation corresponds to an initial touch operation
  • the initial touch operation may be an operation when a finger touches the touch screen.
  • the electronic device may obtain the active position of the initial touch operation on the touch screen.
  • the action position may be represented by the coordinates of the touch point
  • the coordinates of the touch point may be physical coordinates or logical coordinates. Therefore, the position of the initial touch operation on the touch screen can be represented by coordinates.
  • the driver of the electronic device receives the touch operation, transfers the received touch operation to the frame layer of the operating system, and the frame layer obtains the coordinates of the touch point of the touch operation and performs operations such as processing.
  • step S230 it is determined whether the acting position is in the preset position; if so, step S240 is executed; if not, step S270 is executed.
  • the preset position may be pre-stored, and the preset position may be a certain area represented by coordinates, or a plurality of different areas represented by coordinates. If the active position of the initial touch operation is represented by physical coordinates, then the coordinates of the preset position should also be represented by physical coordinates, that is, the coordinates of the preset position and the initial touch operation The coordinates of the action position should be consistent.
  • the action position when determining whether the action position is in the preset position, it may be determined by the coordinates of the action position and the coordinates of the preset position. If the action position is represented by the coordinates of four touch points, the area formed by the four touch points is the action position, and the preset position is also represented by the coordinates of the four touch points. When the area is the preset position. Then, the size relationship between the various coordinates can be compared to determine whether the action position is in the preset position. When the area formed by the four touch points at the active position is completely located at the preset position and the proportion of the area formed by the four touch points at the preset position reaches the preset value, it can be considered that the active position is at the preset position middle.
  • the central coordinates of the action position may be obtained to indicate the action position, and the preset position uses the coordinates of four touch points. Indicates that the area formed by the four touch points is the preset position, and when the center coordinates are in the preset position, it can be considered that the active position of the initial touch operation is at the preset position middle.
  • step S240 When it is determined that the active position is in the preset position, it indicates that the touch operation may trigger the function of the first application program, and step S240 may be continued; when it is determined that the active position is not in the preset position When it indicates that the touch operation will not trigger the application of the first application program, it is a touch operation on the second application program, so the touch event corresponding to the touch operation distributed to the second application program will not be intercepted, The touch event can be normally distributed to the second application, and step S270 can be executed. And, optionally, when it is determined that the action position is not in the preset position, the touch event corresponding to the touch operation distributed to the first application can be intercepted.
  • Step S240 Distribute the touch event corresponding to the touch operation to the first application program, and intercept the touch event corresponding to the touch operation distributed to the second application program.
  • Step S250 When the touch operation satisfies the trigger condition of the first application program, the first application program responds to the touch event corresponding to the touch operation.
  • Step S260 When the touch operation does not satisfy the trigger condition of the first application, a touch event corresponding to the touch operation is distributed to the second application.
  • the touch operation will be regarded as the initial touch operation of a touch operation, and the touch operation will be based on the touch operation.
  • the operation of the initial touch operation that is continuous with the initial touch operation is combined with the initial touch operation as the touch operation.
  • the operation that is continuous with the initial touch operation may be a sliding operation based on the initial touch operation, or a touch operation whose time interval with the initial touch operation is less than a preset time. For example, during a double-click operation, the first click operation is the initial touch operation, and the actual interval between the second click operation and the first click operation is less than the preset time, which is a continuous operation with the first click operation.
  • the operating system distributes the touch event corresponding to the touch operation to the first application program, and intercepts the touch event corresponding to the touch operation distributed to the second application program.
  • an event is generated based on the initial touch operation, such as a press event, and distributed to the first application; and, based on continuously receiving operations that are continuous with the initial touch operation, it continues to generate The event corresponding to the operation, and when the event is generated, the generated event is sent to the first application.
  • the first application program may form an event stream based on the continuously received events.
  • the event stream is a touch event corresponding to a touch operation, and the first application program may perform processing according to the event stream.
  • the first application continues to determine whether the touch operation meets the trigger condition of the first application based on the received event stream.
  • the event distributed to the second application is intercepted, so that the event cannot be distributed to the second application.
  • the operating system can generate a press when the touch is received
  • the event is distributed to the first application.
  • a movement event can be generated according to the user's touch operation. Since the touch operation will slide a certain distance on the touch screen, multiple movement events can be generated, and the generated movement
  • the event is sent to the first application, and when the user's finger leaves the touch screen, a lifting event can be generated, and the lifting event can continue to be sent to the first application.
  • the press event, multiple movement events, and lift events distributed to the second application are intercepted, so that the second application cannot receive the touch event corresponding to the touch operation.
  • the operating system generates a corresponding event stream based on the received initial touch operation and the operation that is continuous with the initial touch operation, and when the operation is continuous with the initial touch operation At the end, the generated event stream is a touch event corresponding to the touch operation, the touch event is distributed to the first application, and the distribution of the touch event to the second application is intercepted.
  • step S240 For part of the content in step S240 to step S260, reference may be made to the corresponding part of the foregoing embodiment, which will not be repeated here.
  • Step S270 Distribute the trigger event corresponding to the touch operation to the second application.
  • the touch operation is to control the second application program.
  • the touch event corresponding to the touch operation is distributed to the second application, so that the second application responds to the touch event, so as to realize the function of the second application.
  • the framework layer of the operating system may process the received touch operation as a corresponding touch event, transfer the generated touch event to the systemUI, and the systemUI distributes the generated touch event.
  • the touch response method proposed in the present application receives a touch operation acting on a touch screen; obtains the position of the initial touch operation of the touch operation on the touch screen; judges whether the act position is in the preset position, if so , The touch event corresponding to the touch operation is distributed to the first application program, and the touch event corresponding to the touch operation distributed to the second application program is intercepted; when the touch operation does not satisfy the triggering of the first application program When the condition is met, the touch event corresponding to the touch operation is distributed to the second application; when the touch operation does not meet the trigger condition of the first application, the touch event corresponding to the touch operation is distributed to The second application.
  • the touch event corresponding to the touch operation that will be distributed to the second application program is intercepted in time, Prevent the first application and the second application from receiving touch events corresponding to the touch operation at the same time, causing false touches.
  • FIG. 4 another embodiment of the present application provides a touch response method.
  • the process of determining whether the touch operation meets the trigger condition of the first program is mainly described.
  • the method may be include:
  • Step S310 receiving a touch operation acting on the touch screen.
  • Step S320 If the start position of the touch operation is the preset position, distribute the touch event corresponding to the touch operation to the first application program, and perform the touch event corresponding to the touch operation distributed to the second application program Intercept.
  • step S310 to step S320 reference may be made to the corresponding part of the foregoing embodiment, which will not be repeated here.
  • Step S330 Determine whether the touch operation meets the triggering condition of the first application program; if yes, execute step S340; if not, execute step S350.
  • the touch event corresponding to the touch operation When the touch event corresponding to the touch operation is distributed to the first application, and the touch event corresponding to the touch operation distributed to the second application is intercepted, it indicates that the first application can receive the touch corresponding to the touch operation Event, and the second application cannot receive the touch event corresponding to the touch operation at this time. However, after distributing the touch event corresponding to the touch operation to the first application, it cannot respond to it immediately. It is also necessary to determine whether the touch operation meets the trigger condition of the first application. In this case, the first application program responds to the touch event corresponding to the touch operation.
  • determining whether the touch operation satisfies the trigger condition of the first application program may be executed by systemUI. When it is determined that the trigger condition of the first application program is satisfied, the first application program responds to the touch event. When it is determined that the trigger condition of the first application is not satisfied, the touch event is distributed to the second application, and the second application responds to the touch event.
  • determining whether the touch operation meets the trigger condition of the first application program may be executed by the first application program, and when it is determined that the trigger condition of the first application program is satisfied, directly responding to the touch event; When it is determined that the trigger condition of the first application is not satisfied, the result of the determination is sent to the systemUI, the touch event is distributed to the second application, and the second application responds to the touch event.
  • the trigger condition of the first application program may be pre-stored.
  • the touch operation may include operations such as double-clicking, sliding, etc., and determining whether the touch operation meets the trigger condition of the first application program may be determining whether the touch operation trajectory and duration are consistent with the trigger condition.
  • the touch operation includes an initial touch operation and an operation continuous with the initial touch operation.
  • the initial touch operation may be an operation in which a finger touches the touch screen. Then, it is determined whether the touch operation satisfies
  • the trigger condition of the first application program is mainly to determine whether the operation consecutive to the initial touch operation meets the trigger condition of the first application program.
  • the trigger condition of the first application program when the trigger position of the first application program, that is, the preset position, is an area, the trigger condition of the first application program may be independent of the trigger position, and the first application program may be triggered when the trigger condition is satisfied.
  • the corresponding function of the application when the trigger position of the first application program, that is, the preset position, is an area, the trigger condition of the first application program may be independent of the trigger position, and the first application program may be triggered when the trigger condition is satisfied.
  • the first application is a full-screen gesture.
  • the task currently running by the electronic device can be displayed, and the trigger position is at the bottom of the screen.
  • the touch operation is detected
  • the initial touch operation is at the bottom of the screen, it can continue to determine whether there is a vertical sliding from the bottom of the screen to the middle of the screen by a preset distance. If so, it can be considered that the touch operation meets the trigger condition of the first application.
  • each region may correspond to a sub-trigger condition.
  • the corresponding sub-triggering condition can be searched for according to the initial touch operation of the touch operation, and it can be judged whether the operation continuous with the initial touch operation is The found sub-trigger condition is satisfied, and if it is satisfied, it can be considered that the touch operation satisfies the trigger condition of the first application.
  • the first application is a full-screen gesture, and when the trigger position is at the bottom of the screen, it satisfies a preset distance of sliding vertically from the bottom of the screen to the middle of the screen, and can display the tasks currently run by the electronic device.
  • the trigger position is the left edge of the screen, sliding the preset distance horizontally from the left edge of the screen to the middle of the screen is satisfied, and the previous level can be displayed.
  • the sub-trigger condition corresponding to the trigger position can be obtained to determine whether the touch operation slides horizontally from the left edge of the screen to the middle of the screen. If the preset distance is met, it can be considered that the touch operation meets the trigger condition of the first application.
  • step S350 may be executed.
  • Step S340 The first application program displays target content according to the touch event corresponding to the touch operation.
  • the first application program can respond to the touch event corresponding to the touch operation, To display the target content so as to realize the function of the first application.
  • Step S350 Distribute the touch event corresponding to the touch operation to the second application.
  • the touch operation does not satisfy the trigger condition of the first application, it indicates that the user's intention is not to implement the function of the first application, but may be to implement the function of the second application, because it will be distributed to the second application before
  • the touch event corresponding to the touch operation of the program is intercepted.
  • the function of the second application program needs to be implemented.
  • the touch event corresponding to the touch operation can be redistributed to the second application program, so that the second application program can be implemented. Function.
  • the touch operation When a touch operation is received, the touch operation includes an initial touch operation and an operation that is continuous with the initial touch operation.
  • the initial touch operation can be stored In the process of receiving an operation that is continuous with the initial touch operation, it can be stored while receiving, so that the received initial touch operation and operations that are continuous with the initial touch operation can be stored, A touch event corresponding to the touch operation is generated according to the initial touch operation and an operation that is continuous with the initial touch operation, so that the generated touch event can be redistributed to the second application.
  • the first application program can quickly and accurately respond to the touch operation, and target content may be preloaded. Therefore, referring to FIG. 5, before the first application program displays the target content according to the touch event corresponding to the touch operation, the following steps may be further included:
  • Step S410 When the initial touch operation is received, the target content of the first application corresponding to the initial touch operation is obtained, and the target content is used when the touch operation meets the trigger of the first application Condition is displayed.
  • the preset position where the action position of the touch operation is located can be acquired; wherein, the preset position may be a collection of multiple discontinuous regions, each of which is It can be a preset position, and for a continuous whole area, the area can also be divided, and each area can also be a preset position. Then, when the initial touch operation is received, it can be determined which area the active position of the initial touch operation is in, so as to facilitate subsequent determination of target content.
  • the preset position may be stored in advance.
  • the preset content corresponding to each preset position may be stored in advance, that is, the touch at the preset position
  • the correspondence table can refer to Table 1.
  • Preset position Preset position 1 Preset position 2 Preset position 3 Preset content Content 1 Content 2 Content 3
  • each area in the preset location can be represented by preset location 1, preset location 2, and preset location 3, etc., corresponding to preset location 1 for content 1, corresponding to preset location 2 for content 2, and corresponding to preset Position 3 is content 3.
  • the content referred to in the content 1, content 2, and content 3 can be fixed display pages or functions. If it is determined that the active position of the initial touch operation is the preset position 2, by looking up the correspondence table, it can be determined that the preset content is content 2, so that content 2 can be used as the target content.
  • the preset content corresponding to the preset location may include multiple sub-preset contents.
  • the preset content is found, if the preset content includes multiple sub-preset contents, then Use the multiple sub-preset contents as the target content.
  • the preset duration of pause can display the current tasks performed by the electronic device.
  • the corresponding preset content may include two sub-preset content, that is, display the upper level content and display the task performed by the current electronic device.
  • the found preset content corresponding to the bottom of the screen includes the above two sub-preset content, both of which are target content.
  • Step S420 Load the target content in advance.
  • the found target content can be loaded in advance.
  • the target content is preset to be loaded, in order to draw or render the content to be displayed in advance, when it is determined that the touch operation meets the trigger condition of the first application program, the corresponding target content is directly displayed.
  • the target content includes multiple sub-preset content
  • the process of loading the target content and receiving the touch operation can be carried out at the same time, that is, the target content can be loaded at the same time in the process of receiving and initiating the touch operation, so that when it is determined that the touch operation meets the trigger condition, no drawing can be performed Or render the content that needs to be displayed and display it directly, which improves the response speed to touch operations.
  • the touch operation does not satisfy the trigger condition of the first application, it indicates that the user's intention is not to realize the function of the first application, but may be to realize the function of the second application. Therefore, no If the preloaded screen needs to be displayed, after the touch event corresponding to the touch operation is distributed to the second application, the preset loaded target content is cancelled, and the second application displays the corresponding screen in response to the touch operation.
  • the touch response method proposed in this application receives a touch operation acting on a touch screen; if the starting position of the touch operation is a preset position, the touch event corresponding to the touch operation is distributed to the first application program and distributed to The touch event corresponding to the touch operation of the second application program is intercepted; it is determined whether the touch operation meets the trigger condition of the first application program, and if so, the first application program displays the target according to the touch event corresponding to the touch operation Content; if not, distribute the touch event corresponding to the touch operation to the second application. And before the first application program responds to the touch operation, the target content that needs to be displayed is preloaded, so that the accuracy of responding to the touch event corresponding to the touch operation is improved without affecting the functions of each application program.
  • FIG. 6 shows a touch response device 500 provided by an embodiment of the present application.
  • the device 500 includes a receiving module 510, an intercepting module 520, a first response module 530, and a second response module 540.
  • the receiving module 510 is configured to receive a touch operation acting on the touch screen;
  • the intercepting module 520 is configured to distribute a touch event corresponding to the touch operation to the first position if the starting position of the touch operation is a preset position
  • the first response module 530 is configured to, when the touch operation satisfies the triggering condition of the first application, let the first application respond to the The touch event corresponding to the touch operation responds;
  • the second response module 540 is configured to distribute the touch event corresponding to the touch operation to all the touch events when the touch operation does not meet the trigger condition of the first application.
  • the second application is configured to receive a touch operation acting on the touch screen;
  • the intercepting module 520 is configured to distribute a touch event corresponding to the touch operation to the first position
  • the interception module 520 is also used to obtain the initial touch operation position of the touch operation on the touch screen; determine whether the operation position is in the preset position; if so, distribute the The touch event corresponding to the touch operation is given to the first application program, and the touch event corresponding to the touch operation distributed to the second application program is intercepted.
  • the touch response device 500 further includes a judgment module for judging whether the touch operation satisfies the trigger condition of the first application program; if so, the first response module 530 according to the touch operation corresponding to the touch operation The event displays the target content; if not, the second response module 540 distributes the touch event corresponding to the touch operation to the second application.
  • the touch operation includes an initial touch operation and an operation that is continuous with the initial touch operation
  • the interception module 520 is further configured to store the received initial touch operation and the initial touch operation.
  • the operation that is continuous with the initial touch operation; the touch event corresponding to the touch operation is generated according to the initial touch operation and the operation that is continuous with the initial touch operation; the second response module 540 also uses Sending the generated touch event to the second application.
  • the first response module 530 is also configured to, when the initial touch operation is received, obtain the target content of the first application corresponding to the initial touch operation, and the target content is used for the current
  • the touch operation is displayed when the trigger condition of the first application program is met; the target content is preloaded.
  • a table of correspondences between the preset position of the initial touch operation and the preset content is pre-stored, and the first response module 530 is also used to determine the preset position of the initial touch operation. Location; search the correspondence table according to the preset location; use the preset content found in the correspondence table as the target content.
  • the second response module 540 is further configured to cancel the preloaded target content. It should be noted that those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the device and module described above can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
  • the touch response method receives a touch operation acting on a touch screen; if the starting position of the touch operation is a preset position, distribute the touch event corresponding to the touch operation to the first application , And intercept the touch event corresponding to the touch operation distributed to the second application; when the touch operation satisfies the trigger condition of the first application, the first application responds to the touch event corresponding to the touch operation Respond to a touch event; when the touch operation does not meet the trigger condition of the first application, a touch event corresponding to the touch operation is distributed to the second application.
  • the touch event corresponding to the touch operation distributed to the second application program is intercepted, so as to prevent the first application program and the second application program from receiving the touch event at the same time and cause a false touch.
  • the first application responds to the touch operation to implement the function of the first application, and when the touch operation does not meet the touch condition of the first application, the touch operation is intercepted
  • the corresponding trigger event is reissued to the second application program to realize the function of the second application program, and without affecting the functions of each application program, the accuracy of responding to the touch event corresponding to the touch operation is improved.
  • the coupling or direct coupling or communication connection between the displayed or discussed modules may be through some interfaces, and the indirect coupling or communication connection between the devices or modules may be electrical, Mechanical or other forms.
  • the functional modules in the various embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software functional modules.
  • the electronic device 600 may be an electronic device capable of running application programs, such as a smart phone, a tablet computer, or an e-book.
  • the electronic device 600 in this application may include one or more of the following components: a processor 610, a memory 620, and one or more application programs, where one or more application programs may be stored in the memory 620 and configured to be configured by One or more processors 610 execute.
  • the processor 610 may include one or more processing cores.
  • the processor 610 uses various interfaces and lines to connect various parts of the entire electronic device 600, and executes by running or executing instructions, programs, code sets, or instruction sets stored in the memory 620, and calling data stored in the memory 620.
  • the processor 610 may use at least one of digital signal processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA).
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA Programmable Logic Array
  • the processor 610 may be integrated with one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a modem, and the like.
  • the CPU mainly processes the operating system, user interface, and application programs;
  • the GPU is used for rendering and drawing of display content;
  • the modem is used for processing wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 610, but may be implemented by a communication chip alone.
  • the central processing unit 611 and the touch screen processor 612 also have the same structure and function as the processor 610, and in order to avoid repetition, they will not be repeated here.
  • the memory 620 may include random access memory (RAM) or read-only memory (ROM).
  • the memory 620 may be used to store instructions, programs, codes, code sets or instruction sets.
  • the memory 620 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing the operating system and instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.) , Instructions used to implement the following various method embodiments, etc.
  • the memory 620 may store a touch-responsive device.
  • the touch response device may be the aforementioned device 500.
  • the storage data area can also store data created by the electronic device 600 during use (such as phone book, audio and video data, chat record data), and the like.
  • FIG. 8 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable storage medium 700 stores program code, and the program code can be invoked by a processor to execute the method described in the foregoing method embodiment.
  • the computer-readable storage medium 700 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 700 includes a non-transitory computer-readable storage medium.
  • the computer-readable storage medium 700 has a storage space for the program code 710 for executing any method steps in the above-mentioned methods. These program codes can be read from or written into one or more computer program products.
  • the program code 710 may be compressed in a suitable form, for example.

Landscapes

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

Abstract

本申请公开了一种触摸响应方法、装置、电子设备及存储介质。所述方法包括:接收作用于触摸屏上的触摸操作;若所述触摸操作的起始位置为预设位置,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截;在所述触摸操作满足第一应用程序的触发条件时,由所述第一应用程序对所述触摸操作对应的触摸事件进行响应;在所述触摸操作不满足所述第一应用程序的触发条件时,将所述触摸操作对应的触摸事件分发给所述第二应用程序。通过拦截补发触摸事件,在不影响各个应用程序的功能的情况下,提高了响应触摸操作对应的触摸事件的准确性。

Description

触摸响应方法、装置、电子设备及存储介质
相关申请的交叉引用
本申请要求于2020年2月19日提交的申请号为202010102551.4的中国申请的优先权,其在此出于所有目的通过引用将其全部内容并入本文。
技术领域
本申请涉及人机交互技术领域,更具体地,涉及一种触摸响应方法、装置、电子设备及存储介质。
背景技术
随着科技的发展,手机、平板电脑等移动终端使用越来越广泛,功能也越来越多,已经成为人们日常生活的必备的电子设备。大部分电子设备都具备触摸屏,用户可以通过所述触摸屏与在电子设备中的应用程序进行交互。
发明内容
本申请提出了一种触摸响应方法、装置、电子设备及存储介质,以降低电子设备的功耗。
第一方面,本申请实施例提供了一种触摸响应方法,接收作用于触摸屏上的触摸操作;若所述触摸操作的起始位置为预设位置,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截,所述预设位置为所述第一应用程序的触发位置,所述第二应用程序的触发位置包括所述预设位置以及当前窗口所显示的其他位置;在所述触摸操作满足所述第一应用程序的触发条件时,由所述第一应用程序对所述触摸操作对应的触摸事件进行响应;在所述触摸操作不满足所述第一应用程序的触发条件时,将所述触摸操作对应的触摸事件分发给所述第二应用程序。
第二方面,本申请实施例提供了一种触摸响应装置,接收模块,用于接收作用于触摸屏上的触摸操作;拦截模块,用于若所述触摸操作的起始位置为预设位置,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截,所述预设位置为所述第一应用程序的触发位置,所述第二应用程序的触发位置包括所述预设位置以及当前窗口所显示的其他位置;第一响应模块,用于在所述触摸操作满足所述第一应用程序的触发条件时,由所述第一应用程序对所述触摸操作对应的触摸事件进行响应;第二响应模块,用于在所述触摸操作不满足所述第一应用程序的触发条件时,将所述触摸操作对应的触摸事件分发给所述第二应用程序。
第三方面,本申请实施例提供了一种电子设备,该服务器包括一个或多个处理器,存 储器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如上述应用于服务器的方法。
第四方面,本申请实施列提供一种计算机可读存储介质,所述计算机可读存储介质中存储有程序代码,其中,在所述程序代码运行时执行上述的方法。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出了本申请一个实施例提供的触摸响应方法的流程图。
图2示出了本申请一个实施例提供的第一应用程序的触发位置与第二应用程序的触发位置的示意图。
图3示出了本申请另一个实施例提供的触摸响应方法的流程图。
图4示出了本申请又一个实施例提供的触摸响应方法的流程图。
图5示出了在图4所提供的实施例的基础上提供的触摸响应方法的部分步骤的流程图。
图6示出了本申请一个实施例提供的触摸屏报点的装置的功能模块图。
图7示出了本申请实施例提出的用于执行根据本申请实施例的触摸响应方法的电子设备的结构框图。
图8示出了本申请实施例提供的用于保存或者携带实现根据本申请实施例的触摸响应方法的程序代码的存储介质。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
在电子设备中,通常都会存在触摸屏,用于可以通过触摸屏与电子设备进行交互,例如,操控安装在所述电子设备中的应用程序等。在接收到触摸事件时,由电子设备的处理器对接收到的触摸事件进行处理,以响应该触摸事件,从而实现与用户的交互。通常,电子设备上可以显示导航键,其导航键的显示形式可以是悬浮在任何界面,可拖动的悬浮控件,或是固定的屏幕底部的虚拟操作按键以进行全局控制。例如,导航键中返回键,可以返回上一级,对任何应用程序以及显示的内容都有效。
随着全面屏的发展,电子设备的屏占比进一步提升,可操控的屏幕也就越来越大,若采用悬浮控件或固定在屏幕底部虚拟操作按键,不易于精准的点击操作。由此,全面屏手势也就随着全面屏的发展,进入了人们视野中。通常,全面屏手势主要是依靠固定的手势或触控操作实现特定的功能,例如,可以是从屏幕底部向上滑动显示正在运行的任务等。
发明人在研究中发现,在使用全面屏手势时,电子设备的驱动层接收到触摸操作,通 过inputdispatcher将触摸操作分发给系统。全面屏手势应用和view系统即当前窗口所显示的应用同时接收到触摸操作,在判断出触摸操作为全面屏手势时,则发送给view系统一个取消事件,否则,就由view系统对触摸操作进行响应。由于view系统以及全面屏手势应用同时收到触摸操作,容易造成场景误触的情况。
因此,发明人提出了本申请中触摸响应方法、装置、电子设备及存储介质,接收作用于触摸屏上的触摸操作;若所述触摸操作的起始位置为预设位置,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截;在所述触摸操作满足第一应用程序的触发条件时,由所述第一应用程序对所述触摸操作对应的触摸事件进行响应;在所述触摸操作不满足所述第一应用程序的触发条件时,将所述触摸操作对应的触摸事件分发给所述第二应用程序。对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截,避免第一应用程序和第二应用程序同时接收到触摸事件造成误触。在触摸操作满足第一应用程序的触发条件时,由第一应用程序响应触摸操作实现第一应用程序的功能,在触摸操作不满足第一应用程序的触摸条件时,将拦截的所述触摸操作对应的触发事件补发给第二应用程序,实现第二应用程序的功能,在不影响各个应用程序的功能的情况下,提高了响应触摸操作对应的触摸事件的准确性。
下面将对本申请实施例进行详细的说明。
请参阅图1,本申请实施例提供了一种触摸响应方法,本实施例描述的处理流程的执行主体可以是电子设备,具体的该方法可以包括:
步骤S110,接收作用于触摸屏上触摸操作。
通常,电子设备上配置有触摸屏,用户可以通过在触摸屏对电子设备进行操作,定义用户在所述触摸屏上的操作为触摸操作,其中,所述触摸操作可以是点击,双击,滑动等操作。当用户在所述触摸屏上对电子设备进行操作时,电子设备可以接收到所述触摸操作。
步骤S120,若所述触摸操作的起始位置为预设位置,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截。
电子设备在获取到所述触摸操作时,可以获取到所述触摸操作的起始位置,若所述触摸操作的起始位置为预设位置,则分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的与所述触摸操作对应的触摸事件进行拦截。
电子设备在获取到所述触摸操作时,可以对所述触摸操作进行处理,生成对应所述触摸操作的触摸事件,所述触摸事件可以包括按下(down)事件,移动(move)事件,或是抬起(up)事件等。由此,在电子设备接收到所述触摸操作时,可以对接收到的所述触摸操作进行判断和处理以生成对应所述触摸操作的触摸事件,从而可以对触摸操作对应的触摸事件进行分发或拦截。
所述第一应用程序可以是一个在任何显示窗口都可以使用的应用程序,例如,全面屏的手势功能,在电子设备的任何界面,都可以通过全面屏手势实现对应的功能。所述第二应用程序可以是电子设备的当前显示窗口中的应用程序,例如,当前电子设备中正在显示 应用程序A,那么应用程序A则为所述第二应用程序。若在一段时间后,用户在电子设备上使用应用程序B,应用程序B显示在电子设备的当前窗口中,那么应用程序B则为所述第二应用程序。
所述第一应用程序的触发位置为所述预设位置,若在所述预设位置处检测到触摸操作,则有可能触发所述第一应用程序对应的功能。所述预设位置可以是连续的整块区域,也可以是多个不连续的区域的集合。而对于第二应用程序,所述第二应用程序显示在电子设备的当前显示窗口中,所述第二应用程序的触发位置可以是包括所述预设位置,并且电子设备的当前显示窗口中的其余位置。具体的,可参阅图2,示出了预设位置与第二应用程序的触发位置的示意图。其中,在所述电子设备10上,假设11所指示区域为所述预设位置,若要触发所述第一应用程序的功能,需要在11所指示的区域处检测到触摸操作,12所指示的区域为所述第二应用程序的触发位置,为整个触摸屏的所有显示区域,包括了11所指示的预设位置,在12所指示的区域内,执行触摸操作可以实现第二应用程序的对应功能。
步骤S130,在所述触摸操作满足所述第一应用程序的触发条件时,由所述第一应用程序对所述触摸操作对应的触摸事件进行响应。
若要执行所述第一应用程序的功能,需要在所述预设位置处检测到触摸操作,且所述触摸操作需要满足所述第一应用程序的触发条件。例如,所述第一应用程序为全面屏手势应用,当手指从屏幕的左侧边缘向屏幕内部水平滑动时,返回到上一级。那么其对应预设位置为屏幕的左侧边缘,触发条件为向屏幕内部水平滑动,只有从屏幕的左侧边缘向屏幕内部水平滑动时,才能返回到上一级。因此,在所述触摸操作满足所述第一应用程序的触发条件时,表明所述触摸操作的意图为实现第一应用程序的功能,则可以由所述第一应用程序对所述触摸操作对应的触摸事件进行响应,以实现所述第一应用程序的功能。
步骤S140,在所述触摸操作不满足所述第一应用程序的触发条件时,将所述触摸操作对应的触摸事件分发给所述第二应用程序。
在所述触摸操作不满足所述第一应用程序的触发条件时,表明所述触摸操作的意图并非是执行第一应用程序的功能,则可能是执行第二应用程序的功能。由于之前拦截分发给第二应用程序的所述触摸操作对应的触摸事件,在触摸操作不满足第一应用程序的触发条件时,可以将拦截的所述触摸操作对应的触摸事件重新分发给所述第二应用程序,以便于所述第二应用程序可以对所述触摸操作对应的触摸事件进行响应,以实现第二应用程序的功能。
本申请提出的触摸响应方法,接收作用于触摸屏上的触摸操作;若所述触摸操作的起始位置为预设位置,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截;在所述触摸操作满足第一应用程序的触发条件时,由所述第一应用程序对所述触摸操作对应的触摸事件进行响应;在所述触摸操作不满足所述第一应用程序的触发条件时,将所述触摸操作对应的触摸事件分发给所述第二应用程序。对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截,避免第 一应用程序和第二应用程序同时接收到触摸事件造成误触。在触摸操作满足第一应用程序的触发条件时,由第一应用程序响应触摸操作实现第一应用程序的功能,在触摸操作不满足第一应用程序的触摸条件时,将拦截的所述触摸操作对应的触发事件补发给第二应用程序,实现第二应用程序的功能,在不影响各个应用程序的功能的情况下,提高了响应触摸操作对应的触摸事件的准确性。。
请参阅图3,本申请另一实施例提供了一种触摸响应方法,本实施例在前述实施例的基础上,重点描述了确定触摸操作的起始位置是否为预设位置的过程,该方法可以包括:
步骤S210,接收作用于触摸屏上的触摸操作。
步骤S210可参照其前述实施例对应部分,在此不再赘述。
步骤S220,获取所述触摸操作的起始触控操作在触摸屏上的作用位置。
触摸操作可以理解为手指接触到触摸屏,并继续在触摸屏上进行的连续操作。其中每个触摸操作都会对应一个起始触控操作,所述起始触控操作可以是手指接触到所述触摸屏时的操作。在接收到所述触摸操作的起始触控操作时,电子设备可以获取到所述起始触控操作的作用在所述触摸屏上的作用位置。具体的,所述作用位置可以用触摸点的坐标的来表示,所述触摸点的坐标可以是物理坐标,也可以是逻辑坐标。从而可以通过坐标来表示所述起始触控操作在触摸屏上的作用位置。其中,可以是电子设备的驱动接收到所述触摸操作,将接收到所述触摸操作传递给操作系统的框架层,由框架层获取触摸操作的触摸点的坐标并进行处理等操作。
步骤S230,判断所述作用位置是否处于所述预设位置中;若是,执行步骤S240;若否,执行步骤S270。
在获取到所述触摸操作的起始触控操作在触摸屏上的作用位置后,可以确定该作用位置是否处于预设位置中。具体的,所述预设位置可以是预先存储的,预设位置可以是用坐标表示的某一个区域,或是用坐标表示的多个不同区域。若所述起始触控操作的作用位置是用物理坐标来表示的,那么,所述预设位置的坐标也应该用物理坐标表示,即,预设位置的坐标与所述起始触控操作的作用位置的所采用的坐标应该一致。
在一些实施方式中,在判断所述作用位置是否处于所述预设位置中时,可以是通过所述作用位置的坐标以及所述预设位置的坐标来确定。若所述作用位置用四个触摸点的坐标来表示,该四个触摸点所形成的区域则为作用位置,预设位置也用四个触摸点的坐标表示,该四个触摸点所形成的区域则为所述预设位置时。则可以比较各个坐标之间的大小关系来确定所述作用位置是否处于所述预设位置中。在所述作用位置四个触摸点所形成的区域完全位于所述预设位置的四个触摸点所形成的区域的比例达到预设值时,则可以认为所述作用位置处于所述预设位置中。
在另一些实施方式中,在判断所述作用位置是否处于所述预设位置中时,可以是获取所述作用位置的中心坐标来表示所述作用位置,预设位置用四个触摸点的坐标表示,该四个触摸点所形成的区域则为所述预设位置,在所述中心坐标处于预设位置中时,则可以认 为所述起始触控操作的作用位置处于所述预设位置中。
在判定所述作用位置处于所述预设位置中时,表明所述触摸操作可能会触发第一应用程序的功能,可以继续执行步骤S240;在判定所述作用位置不处于所述预设位置中时,表明所述触摸操作不会触发所述第一应用程序的应用,则为对第二应用程序的触摸操作,因此不会对分发给第二应用程序的触摸操作对应的触摸事件进行拦截,触摸事件则可以正常分发至所述第二应用程序,则可以执行步骤S270。并且,可选的,在判定所述作用位置不处于所述预设位置中时,可以对分发给第一应用程序的所述触摸操作对应的触摸事件进行拦截。
步骤S240,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截。
步骤S250,在所述触摸操作满足所述第一应用程序的触发条件时,由所述第一应用程序对所述触摸操作对应的触摸事件进行响应。
步骤S260,在所述触摸操作不满足所述第一应用程序的触发条件时,将所述触摸操作对应的触摸事件分发给所述第二应用程序。
若接收到作用于预设位置的触控操作,且该触控操作并不是基于其他触控操作的延续,则将该触控操作作为一个触摸操作的起始触控操作,并将基于该起始触控操作的、与该起始触控操作相连续的操作与该起始触控操作相结合作为该触摸操作。其中,与起始触控操作相连续的操作可以是在该起始触控操作的基础上进行滑动的操作,或者是与起始触控操作时间间隔小于预设时间的触控操作。例如,双击操作时,第一个点击操作为起始触控操作,第二个点击操作与第一个点击操作的实际间隔小于预设时间,为与第一个点击操作相连续的操作。
在一种实施方式中,操作系统分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截,可以是,接收到起始触控操作时,基于起始触控操作生成事件,如按下事件,并分发给第一应用程序;并且,在持续接收到与起始触控操作相连续的操作的基础上,持续生成与操作对应的事件,并在生成事件时,将生成的事件发送给第一应用程序。第一应用程序基于持续接收到的事件,可以形成事件流,该事件流为触摸操作对应的触摸事件,第一应用程序可以根据该事件流进行处理。如第一应用程序在持续接收事件流的过程中,持续基于接收到的事件流判断该触控操作是否满足第一应用程序的触发条件。另外,在生成操作对应的事件的过程中,由于会向第二应用程序分发该事件,将分发给第二应用程序的事件进行拦截,使事件无法分发到第二应用程序。
例如,在触摸屏上的触摸操作为在触摸屏上滑动一段距离,那么该触摸操作的起始触控操作为手指接触到触摸屏的操作,此时,操作系统可以在接收到触摸时,生成一个按下事件分发给第一应用程序,随着用户的触摸操作,可以根据用户触摸操作生成移动事件,由于触摸操作会在触摸屏上滑动一段距离,则可以生成多个移动事件,并将生成的所述移 动事件发送给第一应用程序,在用户的手指离开触摸屏时,可以生成抬起事件,并继续将所述抬起事件发送给第一应用程序。同时对分发给第二应用程序的所述按下事件,多个移动事件,以及抬起事件进行拦截,从而,第二应用程序接收不到该触摸操作对应的触摸事件。
在另一种实施方式中,可以是,操作系统基于接收到的起始触控操作以及与起始触控操作相连续的操作生成对应的事件流,当与起始触控操作相连续的操作结束,生成的事件流为触摸操作对应的触摸事件,将该触摸事件分发给第一应用程序,并拦截该触摸事件向第二应用程序的分发。
步骤S240至步骤S260中的部分内容可以参照前述实施例对应部分,在此不再赘述。
步骤S270,分发与所述触摸操作对应的触发事件给第二应用程序。
在判定所述作用位置不处于所述预设位置中,表明触摸操作并不会触发第一应用程序的功能,因而,该触摸操作是想要对第二应用程序进行控制,可以直接将所述触摸操作对应的触摸事件分发给所述第二应用程序,使第二应用程序对触摸事件进行响应,以实现第二应用程序的功能。具体的,操作系统的框架层可以将接收到的触摸操作处理为对应的触摸事件,将生成的触摸事件传递给systemUI,由systemUI对生成的所述触摸事件进行分发。
本申请提出的触摸响应方法,接收作用于触摸屏上的触摸操作;获取所述触摸操作的起始触控操作在触摸屏上的作用位置;判断所述作用位置是否处于所述预设位置中,若是,则分发触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截;在所述触摸操作不满足所述第一应用程序的触发条件时,将所述触摸操作对应的触摸事件分发给所述第二应用程序;在所述触摸操作不满足所述第一应用程序的触发条件时,将所述触摸操作对应的触摸事件分发给所述第二应用程序。通过获取所述触摸操作的起始触控操作的作用位置,在作用位置为所述第一应用程序的触发位置时,及时拦截将分发给第二应用程序的所述触摸操作对应的触摸事件,避免第一应用程序和第二应用程序同时接收到触摸操作对应的触摸事件,引发误触。
请参阅图4,本申请另一实施例提供了一种触摸响应方法,在前述实施例的基础上重点描述了确定所述触摸操作是否满足第一程序的触发条件的过程,具体的该方法可以包括:
步骤S310,接收作用于触摸屏上的触摸操作。
步骤S320,若所述触摸操作的起始位置为预设位置,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截。
步骤S310至步骤S320可参照前述实施例对应部分,在此不再赘述。
步骤S330,判断所述触摸操作是否满足第一应用程序的触发条件;若是,执行步骤S340;若否,执行步骤S350。
在将所述触摸操作对应的触摸事件分发给第一应用程序,并将分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截,表明第一应用程序可以接收到触摸操作对应的触摸事件,而第二应用程序在此时并不能接收到触摸操作对应的触摸事件。然而,在将所述 触摸操作对应的触摸事件分发给第一应用程序后,并不能马上对其进行响应,还需要确定所述触摸操作是否满足第一应用程序的触发条件,在满足触发条件的情况下,由第一应用程序对触摸操作对应的触摸事件进行响应。
在一些实施方式中,确定所述触摸操作是否满足第一应用程序的触发条件可以是由systemUI执行,在判定满足第一应用程序的触发条件时,由第一应用程序响应所述触摸事件,在判定不满足第一应用程序的触发条件时,分发所述触摸事件给第二应用程序,由第二应用程序对触摸事件进行响应。
在另一些实施方式中,确定所述触摸操作是否满足第一应用程序的触发条件可以是由第一应用程序执行,在判定满足第一应用程序的触发条件时,直接响应所述触摸事件;在判定不满足第一应用程序的触发条件时,将判定的结果发给systemUI,分发所述触摸事件给第二应用程序,由第二应用程序对所述触摸事件进行响应。
具体的,所述第一应用程序的触发条件可以是预先存储的。其中,所述触摸操作可以包括双击,滑动等操作,在判断所述触摸操作是否满足第一应用程序的触发条件可以为判断所述触摸操作操作轨迹和时长是否与触发条件一致。所述触摸操作包括起始触控操作以及与所述起始触控操作相连续的操作,所述起始触控操作可以是手指接触到触摸屏的操作,那么,在判断所述触摸操作是否满足第一应用程序的触发条件主要是判断与所述起始触控操作相连续的操作是否满足第一应用程序的触发条件。
在一些实施方式中,在所述第一应用程序的触发位置即预设位置为一块区域时,所述第一应用程序的触发条件可以与触发位置无关,满足所述触发条件则可以触发第一应用程序的对应的功能。
例如,所述第一应用程序为全面屏手势,在从屏幕底部向屏幕中间垂直滑动预设距离时,可以显示当前电子设备所运行的任务,触发位置为屏幕底部,在检测到所述触摸操作的起始触控操作的作用位置为屏幕底部时,可继续判断是否有从屏幕底部向屏幕中间垂直滑动预设距离,若有,则可以认为所述触摸操作满足第一应用程序的触发条件,显示当前电子设备所运行的任务。若在屏幕底部长按,可以返回到上一级,那么,在检测到所述触摸操作的起始触控操作的作用位置为屏幕底部时,可以继续判断是否在屏幕底部有长按操作,若是,则可以认为满足所述第一应用程序的触发条件,实现返回上一级的功能。
在一些实施方式中,在所述第一应用程序的触发位置及预设位置为多个不连续区域的集合时,每个区域可以对应一个子触发条件。在判断所述触摸操作是否满足第一应用程序的触发条件时,可以根据所述触摸操作的起始触控操作查找对应的子触发条件,判断与所述起始触控操作相连续的操作是否满足查找到的所述子触发条件,若满足,则可以认为所述触摸操作满足所述第一应用程序的触发条件。
例如,所述第一应用程序为全面屏手势,在触发位置为屏幕底部时,满足从屏幕底部向屏幕中间垂直滑动预设距离,可以显示当前电子设备所运行的任务。在触发位置为屏幕左侧边缘时,满足从屏幕左侧边缘向屏幕中间水平滑动预设距离,可以显示上一级。若检 测到触摸操作的起始触控操作的作用位置为屏幕左侧边缘时,可以获取到与该触发位置对应的子触发条件为判断所述触摸操作是否从屏幕左侧边缘向屏幕中间水平滑动预设距离,若满足,可以认为所述触摸操作满足所述第一应用程序的触发条件。
若所述触摸操作不满足所述第一应用程序的触发条件,表明用户的意图并非是想要实现第一应用程序的功能,从而可以执行步骤S350。
步骤S340,所述第一应用程序根据所述触摸操作对应的触摸事件显示目标内容。
若所述触摸操作满足所述第一应用程序的触发条件,表示用户的意图是想要实现第一应用程序的功能,因此,所述第一应用程序可以响应所述触摸操作对应的触摸事件,以显示目标内容从而实现第一应用程序的功能。
步骤S350,分发所述触摸操作对应的触摸事件给所述第二应用程序。
若判定所述触摸操作不满足所述第一应用程序的触发条件,表明用户的意图不是实现第一应用程序的功能,而可能是实现第二应用程序的功能,由于之前将分发给第二应用程序的所述触摸操作对应的触摸事件进行了拦截,此时需要实现第二应用程序的功能,可以重新分发所述触摸操作对应的触摸事件给第二应用程序,从而可以实现第二应用程序的功能。
在接收到触摸操作时,所述触摸操作包括起始触控操作以及与所述起始触控操作相连续的操作,在接收到起始触控操作时,可以将起始触控操作进行存储,在接收与所述起始触控操作相连续的操作的过程中,可以一边接收一边存储,从而可以对接收到的起始触控操作以及与起始触控操作相连续的操作进行存储,并根据所述起始触控操作以及与所述起始触控操作相连续的操作生成对应所述触摸操作的触摸事件,从而可以将生成的所述触摸事件重新分发给第二应用程序。
为了提高触摸操作在满足所述第一应用程序的触发条件时,所述第一应用程序可以快速准确的响应所述触摸操作,可以预先加载目标内容。因此,可参阅图5,在所述第一应用程序根据所述触摸操作对应的触摸事件显示目标内容之前,还可以包括以下步骤:
步骤S410,当接收到所述起始触控操作时,获取第一应用程序对应所述起始触控操作的目标内容,所述目标内容用于当所述触摸操作满足第一应用程序的触发条件时显示。
在接收到所述起始触控操作时,可以获取所述触控操作的作用位置所处于的预设位置;其中,所述预设位置可以是多个不连续区域的集合,每一个区域都可以是一个预设位置,对于连续的整块区域,也可以进行区域的划分,每个区域也可以是一个预设位置。那么,接收到所述起始触控操作时,可以确定所述起始触控操作的作用位置具体是在哪一个区域,以方便后续确定目标内容。
其中,所述预设位置可以是预先存储的,在所述预设位置包括多个不连续区域时,可以预先存储每个预设位置对应的预设内容,即在该预设位置处的触摸操作满足第一应用程序的触发条件时,第一应用程序所需要显示的内容。具体的,所述对应关系表可参照表1。
表1
预设位置 预设位置1 预设位置2 预设位置3
预设内容 内容1 内容2 内容3
其中,预设位置中的各个区域可以用预设位置1,预设位置2以及预设位置3等来表示,对应预设位置1为内容1,对应预设位置2为内容2,对应预设位置3为内容3。所述内容1,内容2,内容3所述指代的内容可以固定的显示页面,或是功能等。若确定所述起始触控操作的作用位置为预设位置2,通过查找所述对应关系表,可以确定预设内容为内容2,从而可以将内容2作为目标内容。
在一些实施方式中,所述预设位置对应的预设内容中可能包括多个子预设内容,在查找到所述预设内容时,若所述预设内容中包括多个子预设内容,则将所述多个子预设内容作为所述目标内容。
例如,在全面屏手势中,从屏幕底部向上滑动预设距离可以返回上一级,从屏幕底部向上滑动预设距离后,停顿预设时长可以显示当前电子设备所执行的任务。那么,在预设位置为屏幕底部时,对应的预设内容可以包括两个子预设内容,即显示上一级内容,以及显示当前电子设备所执行的任务。那么查找到的与所述屏幕底部对应的预设内容则包括上上述两个子预设内容,都为目标内容。在进行根据触摸操作对应的触摸事件显示目标内容时,选择触摸事件对于的子预设内容进行显示。
步骤S420,预先加载所述目标内容。
在查找到所述目标内容时,则可以预先加载所述查找到的目标内容。预设加载所述目标内容时,为预先将需要显示内容进行绘制或渲染,在判断出所述触摸操作满足第一应用程序的触发条件时,直接显示对应的目标内容。
在所述目标内容中包括多个子预设内容时,可以是在判断出所述触摸操作满足第一应用程序的触发条件时,确定需要显示哪一个子预设内容,显示与满足的触发条件对应的子预设内容。加载目标内容的过程与接收触控操作可以同时进行,即在接收与起始触控操作的过程中,可以同时加载目标内容,从而,在判断出触摸操作满足触发条件时,可以不再进行绘制或渲染需要显示的内容,直接显示即可,提升了对触摸操作的响应速度。
可以理解的是,若所述触摸操作不满足所述第一应用程序的触发条件,表明用户的意图并非是实现第一应用程序的功能,而可能是实现第二应用程序的功能,因此,不需要显示预先加载的画面,则在将触摸操作对应的触摸事件分发给第二应用程序之后,撤销预设加载的所述目标内容,由第二应用程序响应所述触控操作显示对应画面。
本申请提出的触摸响应方法,接收作用于触摸屏上的触摸操作;若所述触摸操作的起始位置为预设位置,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截;判断所述触摸操作是否满足第一应用程序的触发条件,若是,所述第一应用程序根据所述触摸操作对应的触摸事件显示目标内容;若否,分发所述触摸操作对应的触摸事件给所述第二应用程序。并在第一应用程序响应触摸操作之前,预先加载需要显示的目标内容,在不影响各个应用程序的功能的情况下, 提高了响应触摸操作对应的触摸事件的准确性。
请参阅图6,其示出了本申请实施例提供的一种触摸响应装置500,所述装置500包括接收模块510、拦截模块520、第一响应模块530以及第二响应模块540。
所述接收模块510,用于接收作用于触摸屏上的触摸操作;所述拦截模块520,用于若所述触摸操作的起始位置为预设位置,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截,所述预设位置为所述第一应用程序的触发位置,所述第二应用程序的触发位置包括所述预设位置以及当前窗口所显示的其他位置;所述第一响应模块530,用于在所述触摸操作满足所述第一应用程序的触发条件时,由所述第一应用程序对所述触摸操作对应的触摸事件进行响应;所述第二响应模块540,用于在所述触摸操作不满足所述第一应用程序的触发条件时,将所述触摸操作对应的触摸事件分发给所述第二应用程序。
进一步的,所述拦截模块520还用于获取所述触摸操作的起始按压触控操作在触摸屏上的作用位置;判断所述作用位置是否处于为所述预设位置中;若是,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截。
进一步的,所述触摸响应装置500还包括判断模块,用于判断所述触摸操作是否满足所述第一应用程序的触发条件;若是,所述第一响应模块530根据所述触摸操作对应的触摸事件显示目标内容;若否,所述第二响应模块540分发所述触摸操作对应的触摸事件给所述第二应用程序。
进一步的,所述触摸操作包括起始触控操作以及与所述起始触控操作相连续的操作,所述拦截模块520还用于存储接收到的所述起始触控操作以及与所述起始触控操作相连续的操作;根据所述起始触控操作以及与所述起始触控操作相连续的操作生成对应所述触摸操作的触摸事件;所述第二响应模块540还用于将生成的所述触摸事件发送给所述第二应用程序。进一步的,所述第一响应模块530还用于当接收到所述起始触控操作时,获取第一应用程序对应所述起始触控操作的目标内容,所述目标内容用于当所述触摸操作满足第一应用程序的触发条件时显示;预先加载所述目标内容。
进一步的,预先存储有起始触控操作的预设位置与预设内容的对应关系表,所述第一响应模块530还用于确定所述起始触控操作的作用位置所处于的预设位置;根据所述预设位置查找所述对应关系表;将在所述对应关系表中查找到的所述预设内容作为所述目标内容。
进一步的,将生成的所述触摸事件发送给所述第二应用程序之后,所述第二响应模块540还用于撤销预先加载的所述目标内容。需要说明的是,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
综上所述,本申请提供的触摸响应方法,接收作用于触摸屏上的触摸操作;若所述触 摸操作的起始位置为预设位置,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截;在所述触摸操作满足第一应用程序的触发条件时,由所述第一应用程序对所述触摸操作对应的触摸事件进行响应;在所述触摸操作不满足所述第一应用程序的触发条件时,将所述触摸操作对应的触摸事件分发给所述第二应用程序。对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截,避免第一应用程序和第二应用程序同时接收到触摸事件造成误触。在触摸操作满足第一应用程序的触发条件时,由第一应用程序响应触摸操作实现第一应用程序的功能,在触摸操作不满足第一应用程序的触摸条件时,将拦截的所述触摸操作对应的触发事件补发给第二应用程序,实现第二应用程序的功能,在不影响各个应用程序的功能的情况下,提高了响应触摸操作对应的触摸事件的准确性。
在本申请所提供的几个实施例中,所显示或讨论的模块相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
请参考图7,其示出了本申请实施例提供的一种电子设备的结构框图。该电子设备600可以是智能手机、平板电脑、电子书等能够运行应用程序的电子设备。本申请中的电子设备600可以包括一个或多个如下部件:处理器610、存储器620、以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器620中并被配置为由一个或多个处理器610执行。
处理器610可以包括一个或者多个处理核。处理器610利用各种接口和线路连接整个电子设备600内的各个部分,通过运行或执行存储在存储器620内的指令、程序、代码集或指令集,以及调用存储在存储器620内的数据,执行电子设备600的各种功能和处理数据。可选地,处理器610可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器610可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器610中,单独通过一块通信芯片进行实现。其中,中央处理器611和触摸屏处理器612也具有与处理器610相同的结构和功能,为避免重复,在此不再赘述。
存储器620可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory,ROM)。存储器620可用于存储指令、程序、代码、代码集 或指令集。存储器620可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。例如,存储器620中可以存储有触摸响应的装置。其中,该触摸响应的装置可以为前述的装置500。存储数据区还可以存储电子设备600在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。
请参考图8,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读存储介质700中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。
计算机可读存储介质700可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质700包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质700具有执行上述方法中的任何方法步骤的程序代710的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码710可以例如以适当形式进行压缩。
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (20)

  1. 一种触摸响应方法,其特征在于,所述方法包括:
    接收作用于触摸屏上的触摸操作;
    若所述触摸操作的起始位置为预设位置,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截,所述预设位置为所述第一应用程序的触发位置,所述第二应用程序的触发位置包括所述预设位置以及当前窗口所显示的其他位置;
    在所述触摸操作满足所述第一应用程序的触发条件时,由所述第一应用程序对所述触摸操作对应的触摸事件进行响应;
    在所述触摸操作不满足所述第一应用程序的触发条件时,将所述触摸操作对应的触摸事件分发给所述第二应用程序。
  2. 根据权利要求1所述的方法,其特征在于,所述若所述触摸操作的起始位置为预设位置,分发所述触摸操作对应的触摸事件给第一应用程序,并拦截分发给第二应用程序的所述触摸操作,包括:
    获取所述触摸操作的起始触控操作在触摸屏上的作用位置;
    判断所述作用位置是否处于所述预设位置中;
    若是,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截。
  3. 根据权利要求2所述的方法,其特征在于,所述预设位置为坐标表示的一个区域,或者是用坐标表示的多个不同区域,所述预设位置的坐标与所述起始触控操作的作用位置所采用的坐标一致。
  4. 根据权利要求3所述的方法,其特征在于,若所述作用位置用四个触摸点的坐标表示,则所述四个触摸点所形成的的区域为所述作用位置;若所述预设位置用四个触摸点的坐标表示,则所述四个触摸点所形成的区域为所述预设位置;所述若是,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截,包括:
    获取所述作用位置的四个触摸点所形成的区域;
    获取所述预设位置的四个触摸点所形成的区域;
    若所述作用位置的四个触摸点所形成的区域完全位于所述预设位置的四个触摸点所形成的区域的比例达到预设值,确定所述作用位置处于所述预设位置中,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截。
  5. 根据权利要求3所述的方法,其特征在于,若所述预设位置用四个触摸点的坐标表示,则所述四个触摸点所形成的区域为所述预设位置;所述若是,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进 行拦截,包括:
    获取所述作用位置的中心坐标;
    获取所述预设位置的四个触摸点所形成的区域;
    若所述中心坐标处于所述预设位置的四个触摸点所形成的的区域中时,确定确定所述作用位置处于所述预设位置中,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截。
  6. 根据权利要求1-5任一所述的方法,其特征在于,所述在所述触摸操作满足所述第一应用程序的触发条件时,由所述第一应用程序对所述触摸操作对应的触摸事件进行响应;所述在所述触摸操作不满足所述第一应用程序的触发条件时,将所述触摸操作对应的触摸事件分发给所述第二应用程序,包括:
    判断所述触摸操作是否满足所述第一应用程序的触发条件;
    若是,所述第一应用程序根据所述触摸操作对应的触摸事件显示目标内容;
    若否,分发所述触摸操作对应的触摸事件给所述第二应用程序。
  7. 根据权利要求6所述的方法,其特征在于,所述第一应用程序的触发位置和预设位置为多个不连续区域的集合,每个区域对应一个子触发条件,所述判断所述触摸操作是否满足所述第一应用程序的触发条件,包括:
    根据所述触摸操作的起始触控操作查找对应的子触发条件;
    判断与所述起始触控操作相连续的操作是否满足查找到的子触发条件。
  8. 根据权利要求1-7任一所述的方法,其特征在于,所述触摸操作包括起始触控操作以及与所述起始触控操作相连续的操作,所述方法还包括:
    存储接收到的所述起始触控操作以及与所述起始触控操作相连续的操作;
    根据所述起始触控操作以及与所述起始触控操作相连续的操作生成对应所述触摸操作的触摸事件;
    所述分发所述触摸操作对应的触摸事件给所述第二应用程序,包括:
    将生成的所述触摸事件发送给所述第二应用程序。
  9. 根据权利要求7或8任一所述的方法,其特征在于,所述与所述起始触控操作相连续的操作包括在所述起始触控操作的基础上进行滑动的操作,或者与所述起始触控操作时间间隔小于预设时间的触控操作。
  10. 根据权利要求8所述的方法,其特征在于,所述第一应用程序根据所述触摸操作对应的触摸事件显示目标内容之前,还包括:
    当接收到所述起始触控操作时,获取第一应用程序对应所述起始触控操作的目标内容,所述目标内容用于当所述触摸操作满足第一应用程序的触发条件时显示;
    预先加载所述目标内容。
  11. 根据权利要求10所述的方法,其特征在于,预先存储有起始触控操作的预设位置与预设内容的对应关系表,所述获取所述第一应用程序响应所述触摸操作对应的目标内容, 包括:
    确定所述起始触控操作的作用位置所处于的预设位置;
    根据所述预设位置查找所述对应关系表;
    将在所述对应关系表中查找到的所述预设内容作为所述目标内容。
  12. 根据权利要求10所述的方法,其特征在于,所述将生成的所述触摸事件发送给所述第二应用程序之后,还包括:
    撤销预先加载的所述目标内容。
  13. 根据权利要求11所述的方法,其特征在于,所述将在所述对应关系表中查找到的所述预设内容作为所述目标内容,包括:
    在所述对应关系表中查找到所述预设内容时,若所述预设内容包括多个子预设内容,将所述多个子预设内容作为所述目标内容。
  14. 根据权利要求13所述的方法,其特征在于,在所述目标内容包括多个子预设内容时,在判断出所述第一应用程序的触发条件时,确定需要显示的子预设内容,显示与满足的触发条件对应的子预设内容。
  15. 根据权利要求1所述的方法,其特征在于,所述在所述触摸操作满足所述第一应用程序的触发条件时,由所述第一应用程序对所述触摸操作对应的触摸事件进行响应,包括:
    若在所述预设位置检测到触摸操作,且所述触摸操作满足所述第一应用程序的触发条件,由所述第一应用程序对所述触摸操作对应的触摸事件进行响应。
  16. 根据权利要求1-15任一所述的方法,其特征在于,所述触摸操作包括点击操作、双击操作或滑动操作;所述触摸事件包括按下时间、移动事件或抬起事件。
  17. 根据权利要求1-15任一所述的方法,其特征在于,用触摸点的坐标表示所述作用位置,所述触摸点的坐标包括物理坐标或逻辑坐标。
  18. 一种触摸响应装置,其特征在于,所述装置包括:
    接收模块,用于接收作用于触摸屏上的触摸操作;
    拦截模块,用于若所述触摸操作的起始位置为预设位置,分发所述触摸操作对应的触摸事件给第一应用程序,并对分发给第二应用程序的所述触摸操作对应的触摸事件进行拦截,所述预设位置为所述第一应用程序的触发位置,所述第二应用程序的触发位置包括所述预设位置以及当前窗口所显示的其他位置;
    第一响应模块,用于在所述触摸操作满足所述第一应用程序的触发条件时,由所述第一应用程序对所述触摸操作对应的触摸事件进行响应;
    第二响应模块,用于在所述触摸操作不满足所述第一应用程序的触发条件时,将所述触摸操作对应的触摸事件分发给所述第二应用程序。
  19. 一种电子设备,其特征在于,所述电子设备包括:
    一个或多个处理器;
    存储器,与所述一个或多个处理器电连接;
    一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个应用程序配置用于执行如权利要求1至17任一项所述的方法。
  20. 一种计算机可读取存储介质,其特征在于,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行如权利要求1至17任一项所述的方法。
PCT/CN2021/071080 2020-02-19 2021-01-11 触摸响应方法、装置、电子设备及存储介质 WO2021164460A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010102551.4A CN111338506B (zh) 2020-02-19 2020-02-19 触摸响应方法、装置、电子设备及存储介质
CN202010102551.4 2020-02-19

Publications (1)

Publication Number Publication Date
WO2021164460A1 true WO2021164460A1 (zh) 2021-08-26

Family

ID=71181656

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/071080 WO2021164460A1 (zh) 2020-02-19 2021-01-11 触摸响应方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN111338506B (zh)
WO (1) WO2021164460A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113835610A (zh) * 2021-09-30 2021-12-24 广州品唯软件有限公司 一种终端应用的页面展示方法及装置
CN115718706A (zh) * 2023-01-09 2023-02-28 深圳曦华科技有限公司 针对触摸屏tp算法的调试方法和相关装置

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111338506B (zh) * 2020-02-19 2022-01-07 Oppo广东移动通信有限公司 触摸响应方法、装置、电子设备及存储介质
CN113971092A (zh) * 2020-07-21 2022-01-25 Oppo广东移动通信有限公司 应用程序的响应方法、装置、电子设备和可读存储介质
CN117101117A (zh) * 2023-07-12 2023-11-24 荣耀终端有限公司 触控方法及相关设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07319698A (ja) * 1994-05-24 1995-12-08 Fuji Xerox Co Ltd プログラム実行装置
CN105740008A (zh) * 2016-01-25 2016-07-06 努比亚技术有限公司 禁止应用程序链式启动的装置和方法
CN107105088A (zh) * 2017-03-30 2017-08-29 努比亚技术有限公司 一种操作响应方法和终端
CN107861655A (zh) * 2017-11-01 2018-03-30 平安科技(深圳)有限公司 控件匹配方法、装置、计算机设备和存储介质
CN111338506A (zh) * 2020-02-19 2020-06-26 Oppo广东移动通信有限公司 触摸响应方法、装置、电子设备及存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104731507B (zh) * 2015-03-31 2016-11-23 努比亚技术有限公司 移动终端的应用切换方法及移动终端
CN105511675B (zh) * 2015-11-20 2020-07-24 重庆桔子科技发展有限公司 触摸控制方法、用户设备、输入处理方法、移动终端及智能终端
CN108958626A (zh) * 2018-06-29 2018-12-07 奇酷互联网络科技(深圳)有限公司 手势识别方法、装置、可读存储介质及移动终端
CN112334870A (zh) * 2018-07-27 2021-02-05 三星电子株式会社 用于配置触摸屏键盘的方法和电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07319698A (ja) * 1994-05-24 1995-12-08 Fuji Xerox Co Ltd プログラム実行装置
CN105740008A (zh) * 2016-01-25 2016-07-06 努比亚技术有限公司 禁止应用程序链式启动的装置和方法
CN107105088A (zh) * 2017-03-30 2017-08-29 努比亚技术有限公司 一种操作响应方法和终端
CN107861655A (zh) * 2017-11-01 2018-03-30 平安科技(深圳)有限公司 控件匹配方法、装置、计算机设备和存储介质
CN111338506A (zh) * 2020-02-19 2020-06-26 Oppo广东移动通信有限公司 触摸响应方法、装置、电子设备及存储介质

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113835610A (zh) * 2021-09-30 2021-12-24 广州品唯软件有限公司 一种终端应用的页面展示方法及装置
CN113835610B (zh) * 2021-09-30 2024-01-23 广州品唯软件有限公司 一种终端应用的页面展示方法及装置
CN115718706A (zh) * 2023-01-09 2023-02-28 深圳曦华科技有限公司 针对触摸屏tp算法的调试方法和相关装置
CN115718706B (zh) * 2023-01-09 2023-04-18 深圳曦华科技有限公司 针对触摸屏tp算法的调试方法和相关装置

Also Published As

Publication number Publication date
CN111338506B (zh) 2022-01-07
CN111338506A (zh) 2020-06-26

Similar Documents

Publication Publication Date Title
WO2021164460A1 (zh) 触摸响应方法、装置、电子设备及存储介质
US11467715B2 (en) User interface display method, terminal and non-transitory computer-readable storage medium for splitting a display using a multi-finger swipe
US11709560B2 (en) Device, method, and graphical user interface for navigating through a user interface using a dynamic object selection indicator
WO2021035884A1 (zh) 投屏方法、装置、终端及存储介质
US8806369B2 (en) Device, method, and graphical user interface for managing and interacting with concurrently open software applications
US8826178B1 (en) Element repositioning-based input assistance for presence-sensitive input devices
US11507261B2 (en) Suspend button display method and terminal device
US20220155922A1 (en) Side-toolbar-display method, terminal, and storage medium
CN112000269B (zh) 屏幕开启方法、装置及电子设备
US20120032891A1 (en) Device, Method, and Graphical User Interface with Enhanced Touch Targeting
US20120212438A1 (en) Methods and apparatuses for facilitating interaction with touch screen apparatuses
WO2022121528A1 (zh) 互动信息处理方法、装置、终端、存储介质及程序产品
EP3133481B1 (en) Terminal device display method and terminal device
US20140035853A1 (en) Method and apparatus for providing user interaction based on multi touch finger gesture
CN111782332A (zh) 应用界面切换方法、装置、终端及存储介质
CN110737374A (zh) 操作方法及电子设备
CN110928614B (zh) 界面显示方法、装置、设备及存储介质
WO2020168786A1 (zh) 触摸操作响应方法、装置、存储介质及终端
US20130044061A1 (en) Method and apparatus for providing a no-tap zone for touch screen displays
CN107608550A (zh) 触摸操作响应方法及装置
WO2020248547A1 (zh) 一种窗口最小化方法、装置、存储介质及交互智能平板
WO2023030114A1 (zh) 界面显示方法和装置
WO2022252748A1 (zh) 虚拟物品的处理方法、装置、设备及存储介质
CN110658976B (zh) 一种触控轨迹显示方法及电子设备
US20210075851A1 (en) Application partition processing method, device, and computer-readable storage medium

Legal Events

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

Ref document number: 21756546

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21756546

Country of ref document: EP

Kind code of ref document: A1