Equipment control method and device, terminal equipment and computer readable storage medium
By acquiring and analyzing the length of the historical motion trajectory of the touch device, it automatically switches the mode of the terminal device, solving the problem of complex operations in the existing technology, realizing convenient canvas control, and improving the user experience.
Patent Information
- Application Number
- CN202410687077.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-09-17
AI Technical Summary
During the writing or drawing process of existing electronic whiteboard terminal devices, the operation of controlling the panning or zooming of the canvas is complicated, and users need to frequently switch modes, resulting in a poor experience.
By obtaining the current operating mode and touch points of the touch device, the length of the historical movement trajectory is used to decide whether to maintain the writing and drawing mode or switch to the screen control mode, achieving convenient mode switching and operation.
Users do not need to use different operating methods to control different modes, which improves the convenience of control and smooth operation, and simplifies the operation process of writing, drawing, zooming and panning.
Smart Images

Figure CN118656014A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a device control method, apparatus, terminal device and computer-readable storage medium. Background Art
[0002] There are electronic whiteboard apps or terminal devices on the market, and users can write or draw on this type of app or terminal device. If the user controls the translation or zoom of the canvas during drawing or writing, either the "zoom" switch in the toolbar needs to be turned on, or the "single and double finger" switch needs to be turned on. In addition, some require simultaneous control by hand and pen, for example, fingers are only used to control the canvas, and the pen is only used to draw on the canvas. It can be seen that the actual effect is not good and the experience is not smooth. Therefore, it is necessary to solve the problem of overly complex control of writing devices. Summary of the invention
[0003] The present application provides a device control method, which can conveniently control a terminal device used for writing and drawing.
[0004] In a first aspect, the present application provides a device control method, which is applied to a touch device, and the method includes:
[0005] Acquire the current operation mode and the current touch point of the touch device; the current touch point is the contact point between the user's finger or stylus and the touch device;
[0006] If the current touch point includes a first touch point and a second touch point and the current operation mode is a writing and drawing mode, obtaining a historical movement track of the first touch point on the touch device, and the generation time of the first touch point is earlier than that of the second touch point;
[0007] If the length of the historical motion trajectory is greater than a preset first target length, maintaining the writing and drawing mode;
[0008] If the length of the historical motion trajectory is less than or equal to the first target length, the writing and drawing mode is switched to the picture control mode.
[0009] In some embodiments of the present application, if the length of the historical motion trajectory is less than or equal to the first target length, switching the writing and drawing mode to the picture control mode includes:
[0010] If the length of the historical motion trajectory is less than or equal to the first target length, clearing the writing and drawing traces corresponding to the historical motion trajectory;
[0011] If the writing and drawing traces corresponding to the historical motion trajectory are completely cleared, the writing and drawing mode is switched to the picture control mode.
[0012] In some embodiments of the present application, after obtaining the current operating mode and the current touch point of the touch device, the method further includes:
[0013] If the current touch point includes the first touch point and the second touch point, and the current operation mode is the erasing mode, obtaining a historical erasing track of the first touch point on the touch device;
[0014] If the historical erasing track is greater than a preset second target length, maintaining the erasing mode;
[0015] If the historical erasing track is less than or equal to the second target length, the erasing mode is switched to the picture control mode.
[0016] In some embodiments of the present application, if the historical erasure trajectory is less than or equal to the second target length, switching the erasure mode to the picture control mode includes:
[0017] If the historical erasure track is less than or equal to the second target length, restoring the erasure trace corresponding to the historical erasure track;
[0018] If the erased traces are completely restored, the erase mode is switched to the picture control mode.
[0019] In some embodiments of the present application, after obtaining the current operating mode and the current touch point of the touch device, the method further includes:
[0020] If the current touch point includes a first touch point and a second touch point and the current operation mode is a function selection mode, the function selection mode is switched to the screen control mode.
[0021] In some embodiments of the present application, the method further includes:
[0022] If the picture control mode is entered, determining a first displacement direction and a first displacement distance corresponding to the first touch point and a second displacement direction and a second displacement distance corresponding to the second touch point;
[0023] If the first displacement direction and the second displacement direction are the same, shifting the display screen of the touch device according to the first displacement distance and the second displacement distance;
[0024] If the first displacement direction and the second displacement direction are different, the display image of the touch device is scaled according to the first displacement distance and the second displacement distance.
[0025] In some embodiments of the present application, after entering the screen control mode, the method further includes:
[0026] If any one of the first touch point and the second touch point disappears, determining a target displacement direction and a target displacement distance corresponding to the existing touch point;
[0027] The display screen of the touch control device is translated according to the target displacement direction and the target displacement distance.
[0028] In a second aspect, the present application further provides a device control apparatus, applied to a touch device, the apparatus comprising:
[0029] A first acquisition module, used to acquire a current operation mode and a current touch point of the touch device; the current touch point is a contact point between a user's finger or a stylus and the touch device;
[0030] A second acquisition module is used to acquire a historical motion track of the first touch point on the touch device if the current touch point includes a first touch point and a second touch point and the current operation mode is a writing and drawing mode, and the generation time of the first touch point is earlier than that of the second touch point;
[0031] A mode control module, configured to maintain the writing and drawing mode if the length of the historical motion trajectory is greater than a preset first target length;
[0032] A mode control module is used to switch the writing and drawing mode to the picture control mode if the length of the historical motion trajectory is less than or equal to the first target length.
[0033] In a third aspect, the present application also provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in any one of the device control methods described.
[0034] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to implement the steps in any one of the device control methods described.
[0035] The device control method provided by the present application obtains the current operation mode of the touch device and the number of current touch points. If the current operation mode is the writing and drawing mode and the user controls the touch device through two touch points, the length of the historical motion trajectory of the touch points generated in advance can be used to determine whether the touch device maintains the writing and drawing mode or switches to the screen control, thereby achieving the effect of controlling different modes through one operation method. The user does not need to use different operation methods to control different modes, which improves the convenience of control. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0037] Figure 1 is a schematic diagram of a scene of a device control system provided in an embodiment of the present application;
[0038] Figure 2 This is a schematic diagram of an embodiment of a device control method in an embodiment of the present application;
[0039] Figure 3 It is a functional module schematic diagram of the device control device in the embodiment of the present application;
[0040] Figure 4 It is a schematic diagram of the structure of the terminal device in the embodiment of the present application. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0042] In the description of the present application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the feature. In the description of the present application, "plurality" means two or more, unless otherwise clearly and specifically defined.
[0043] In this application, the word "exemplary" is used to mean "used as an example, illustration or description". Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. At the same time, it is to be understood that in the specific implementation of this application, when user information, user data and other related data are involved, when the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data shall comply with relevant laws, regulations and standards of relevant countries and regions.
[0044] In order to enable any person skilled in the art to implement and use the present application, the following description is provided. In the following description, details are listed for the purpose of explanation. It should be understood that those of ordinary skill in the art will recognize that the present application can be implemented without using these specific details. In other examples, known structures and processes will not be elaborated in detail to avoid unnecessary details that make the description of the present application obscure. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in the present application.
[0045] The present application provides a device control method, apparatus, device and storage medium, which are described in detail below.
[0046] See also Figure 1 , Figure 1 Schematic diagram of a scene of a device control system provided in an embodiment of the present application. The device control system may include a terminal device 100 and a touch control device 200. The touch control device 200 may transmit data to the terminal device 100. Figure 1 The terminal device 100 in the embodiment can obtain the touch operation instruction of the user transmitted back by the touch control device 200 to execute the device control method in the present application.
[0047] In the embodiment of the present application, the terminal device 100 includes but is not limited to a desktop computer, a portable computer, a network server, a PDA (Personal Digital Assistant), a tablet computer, a wireless terminal device, an embedded device, etc.
[0048] In the embodiment of the present application, the touch control device 200 can be mounted on the terminal device 100, or the terminal device 100 and the touch control device 200 can also be connected to each other by wired communication or wireless communication. The wireless communication can be implemented by any communication method, including but not limited to mobile communication based on the 3rd Generation Partnership Project (3GPP), Long Term Evolution (LTE), Worldwide Interoperability for Microwave Access (WiMAX), or computer network communication based on TCP / IP Protocol Suite (TCP / IP) and User Datagram Protocol (UDP).
[0049] It should be noted that Figure 1 The scenario diagram of the device control system shown is only an example. The device control system and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can know that with the evolution of the device control system and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
[0050] like Figure 2 As shown, Figure 2 This is a flow chart of an embodiment of a device control method in an embodiment of the present application. The device control method may include the following steps 201 to 204:
[0051] 201. Obtain a current operation mode and a current touch point of a touch device; the current touch point is a contact point between a user's finger or a stylus and the touch device.
[0052] In the embodiment of the present application, the touch device may be any type of electronic device, such as a tablet computer, a mobile phone, etc. Alternatively, a device consisting of a touch panel and any electronic device with computing capabilities may also belong to the touch device, which is not limited in the specific embodiment of the present application.
[0053] In addition, the touch device can also generally be a device with complex functions. Therefore, the touch device can also have multiple modes. For example: computing mode, writing and drawing mode, and so on. In actual application scenarios, if the touch device is in the writing and drawing mode, and the user needs to control the touch device at this time, for example, to zoom or translate the current screen, because it is in the writing and drawing mode, the user needs to exit the writing and drawing mode, and then zoom or translate through the corresponding control gestures. Therefore, the user needs to manually switch modes. In order to prevent the user from manually switching the mode of the device, it is necessary to effectively identify whether the user needs to continue writing and drawing, or needs to control the device in the writing and drawing mode. Therefore, it is necessary to obtain the user's current touch point information. Among them, obtaining the user's current touch point can be obtained by any existing technology, and the specific embodiments of the present application are not limited.
[0054] 202. If the current touch points include the first touch point and the second touch point and the current operation mode is the writing and drawing mode, obtain the historical movement trajectory of the first touch point on the touch device, and the generation time of the first touch point is earlier than that of the second touch point.
[0055] In actual situations, when the current operating mode is the writing and drawing mode, the user may use two fingers to write and draw. However, if the user needs to perform zoom control or translation control during writing and drawing, the user can also use two fingers to control. Therefore, it is necessary to effectively identify whether the user is using two fingers to perform operations, such as writing and drawing, or zoom control or translation control. In an embodiment of the present application, if a first touch point and a second touch point appear, the historical motion trajectory corresponding to the first touch point can be determined first, and then it can be determined whether the user needs to draw or control based on the historical motion trajectory.
[0056] In actual scenarios, if the user needs to use two fingers to operate, there are two situations. The first is: the user first uses one finger, and during the use of the first finger, the user uses the second finger. Therefore, there is a sequence in the generation time between the first touch point and the second touch point. The second is: using two fingers at the same time. It should be noted that the scenario of the prior art is the second one. When the user uses two fingers at the same time, it can be directly determined that the user needs related controls such as zooming, which is not within the scope of the embodiments of the present application. Therefore, it can be understood that the embodiments of the present application are described based on the first case.
[0057] Based on this, a more detailed application scenario corresponding to the first case above is: in the writing state, another finger is pressed on the canvas. At this time, the historical motion trajectory corresponding to the first touch point is obtained. Subsequently, it can be determined whether the user needs to write or control based on the historical motion trajectory. Among them, the method of obtaining the historical motion trajectory can refer to any existing technology, and the specific embodiment of this application is not limited.
[0058] 203. If the length of the historical motion trajectory is greater than the preset first target length, the writing and drawing mode is maintained.
[0059] The above steps can obtain the historical motion trajectory corresponding to the first touch point. After obtaining the historical motion trajectory, the user's intention can be determined based on the historical motion trajectory. Specifically, the reasons for determining the user's intention based on the historical motion trajectory may include: if the trajectory drawn by the first finger that falls is very long, it is determined that the user actually wants to write, and does not want to trigger zooming or translation. Therefore, in an embodiment of the present application, the historical motion trajectory can be judged against a preset first target length, and the first target length can be a length threshold set in advance. If the historical motion trajectory exceeds the length threshold, it can be determined that the user needs to write. At this time, after maintaining the writing and painting mode, the user's second finger can also participate in writing and painting.
[0060] 204. If the length of the historical motion trajectory is less than or equal to the first target length, the writing and drawing mode is switched to the picture control mode.
[0061] According to the above description, when the historical motion trajectory corresponding to the first touch point is shorter, it is determined that the user actually wants to control. Therefore, the writing and drawing mode is ended at this time and switched to the screen control mode. Under the screen control mode, the current screen of the touch device can respond to the instructions issued by the user's fingers and make corresponding changes. The specific embodiments of the present application are not described in detail. For example: if two fingers move in opposite directions, the screen will be enlarged; if they move in opposite directions, the screen will be reduced; if they move in the same direction, the screen will be translated in the direction of the movement.
[0062] In summary, users can use two fingers to perform four operations, including writing and drawing, zooming in, zooming out, and panning. This simplifies the user's operation process and eliminates the need for users to exit the writing and drawing mode and then enter the control mode during the writing and drawing process.
[0063] The device control method provided by the present application obtains the current operation mode of the touch device and the number of current touch points. If the current operation mode is the writing and drawing mode and the user controls the touch device through two touch points, the length of the historical motion trajectory of the touch points generated in advance can be used to determine whether the touch device maintains the writing and drawing mode or switches to the screen control, thereby achieving the effect of controlling different modes through one operation method. The user does not need to use different operation methods to control different modes, which improves the convenience of control.
[0064] In order to better implement the embodiment of the present application, in one embodiment of the present application, if the length of the historical motion trajectory is less than or equal to the first target length, the writing and drawing mode is switched to the picture control mode, including:
[0065] If the length of the historical motion trajectory is less than or equal to the first target length, the writing and painting traces corresponding to the historical motion trajectory are cleared; if the writing and painting traces corresponding to the historical motion trajectory are completely cleared, the writing and painting mode is switched to the screen control mode.
[0066] In the above embodiment, a scheme is provided for when to maintain the writing and drawing mode and when to switch to the screen control mode. However, when it is necessary to switch the writing and drawing mode to the screen control mode, the motion trajectory of the historical motion trajectory corresponding to the first touch point is shorter. Because it is determined at this time that the user actually wants to control, not write and draw. Therefore, it is necessary to clear the writing and drawing traces corresponding to the historical motion trajectory. Among them, the clearing of writing and drawing traces can be carried out in any way, and the specific embodiments of the present application are not limited. After the clearing of the writing and drawing traces is completed, the writing and drawing mode can be switched to the screen control mode. This ensures that when the user zooms or pans the screen, the writing and drawing traces corresponding to the historical motion trajectory will not affect the observation.
[0067] In order to better implement the embodiments of the present application, in one embodiment of the present application, after obtaining the current operating mode and the current touch point of the touch device, the method further includes:
[0068] If the current touch point includes the first touch point and the second touch point, and the current operating mode is the erasing mode, obtain the historical erasing trajectory of the first touch point on the touch device; if the historical erasing trajectory is greater than the preset second target length, maintain the erasing mode; if the historical erasing trajectory is less than or equal to the second target length, switch the erasing mode to the screen control mode.
[0069] The above embodiment provides a scheme for switching between a writing and drawing mode and a screen switching mode. Of course, the touch device may also include an erasing mode. For example, when a user makes a mistake in writing or drawing, the user may select the erasing mode to erase the wrong part of the writing or drawing. Therefore, in the erasing mode, in order to improve the erasing efficiency, the user may also use two fingers to erase. At the same time, in order to ensure the accuracy of erasing, the user may erase while zooming. Therefore, in the erasing mode, the user also has a demand for simplified operation. Therefore, in the erasing mode, the historical erasing track corresponding to the first touch point may be determined. Among them, if the length of the historical erasing track is still greater than the set threshold corresponding to the second target length, it can still be determined that the user currently needs to erase, and the area corresponding to the user's second finger also performs an erasing operation. If the length of the historical erasing track is less than the second target length, it can be determined that the user needs to control the screen, and then the erasing mode can be switched to the screen control mode. In addition, the second target length may be less than the first target length, and the specific values of the second target length and the first target length may be set according to actual conditions, and the embodiment of the present application is not limited.
[0070] In order to better implement the embodiment of the present application, in one embodiment of the present application, if the historical erasing track is less than or equal to the second target length, the erasing mode is switched to the picture control mode, including:
[0071] If the historical erasure track is less than or equal to the second target length, the erasure trace corresponding to the historical erasure track is restored; if the erasure trace is completely restored, the erasure mode is switched to the picture control mode.
[0072] Similarly, in the above embodiment, a scheme is provided for when to maintain the erasing mode and when to switch to the screen control mode. However, when it is necessary to switch the erasing mode to the screen control mode, the motion trajectory of the historical motion trajectory corresponding to the first touch point is shorter. Because at this time it is determined that the user actually wants to control, not erase. Therefore, it is necessary to restore the erasing traces corresponding to the historical erasing traces. Among them, the restoration method can be restored in any way, and the specific embodiments of the present application are not limited. After the restoration of the erasing traces is completed, the erasing mode can be switched to the screen control mode. This ensures that when the user zooms or pans the screen, the content of the screen will not be lost due to some irrelevant operations.
[0073] In order to better implement the embodiments of the present application, in one embodiment of the present application, after obtaining the current operating mode and the current touch point of the touch device, the method further includes:
[0074] If the current touch points include the first touch point and the second touch point and the current operation mode is the function selection mode, the function selection mode is switched to the screen control mode.
[0075] In actual application scenarios, the current mode can be not only a writing and drawing mode, an erasing mode, etc., but also a function selection mode. For example, the user needs to select some function modules. At this time, in the function selection mode, when two touch points appear, it can be proved that the user needs to control the current screen immediately. At this time, the function selection mode can be directly switched to the screen control mode.
[0076] In order to better implement the embodiment of the present application, in one embodiment of the present application, the method further includes:
[0077] If entering the screen control mode, determine the first displacement direction and the first displacement distance corresponding to the first touch point and the second displacement direction and the second displacement distance corresponding to the second touch point; if the first displacement direction and the second displacement direction are the same, translate the display screen of the touch device according to the first displacement distance and the second displacement distance; if the first displacement direction and the second displacement direction are different, scale the display screen of the touch device according to the first displacement distance and the second displacement distance.
[0078] The above embodiments provide solutions for switching from various modes to the screen control mode. After entering the screen control mode, the user can perform various operations to control the screen. Therefore, the embodiments of the present application also provide a specific control solution.
[0079] Specifically, when entering the screen control mode, there are two touch points on the touch device. Because the touch point is formed by the user's contact with the touch device through a finger or a stylus. If the user needs to zoom or translate, the user needs to move the finger or stylus to move, so that the touch point will move accordingly. At this time, the touch device can respond according to the movement data of the touch point to achieve zooming or translation. Among them, the coordinates of the first touch point on the touch device can be set to (X1, Y1), and the coordinates of the second touch point on the touch device can be set to (X2, Y2). If, based on the movement of the coordinates of the first touch point and the coordinates of the second touch point, it is determined that the displacement directions of the two touch points are different, it can be determined that the user currently needs to perform a zoom operation. When it is determined to be a zoom operation, the zooming can be performed as follows:
[0080] First, determine the zoom center. The zoom center can be the midpoint of the coordinates (X1, Y1) and (X2, Y2) of the first touch point and the second touch point, that is, centerX = (X1 + X2) / 2, centerY = (Y1 + Y2) / 2. Next, it is necessary to calculate the zoom multiple. When calculating the zoom multiple, the change rate of the distance between the two fingers can be used as the zoom multiple. The distance between the two fingers in the previous time can be obtained by the following formula (1), which is as follows:
[0081]
[0082] The distance between the two fingers at this time can be obtained by the following formula (2), which is as follows:
[0083]
[0084] Then calculate the current scaling factor: curScale = (curDistance-preDistance) / preDistance+1. The reason why 1 is added here is that curDistance-preDistance may be a negative number, and the scaling factor cannot be negative. Adding 1 can ensure that it is always positive. The final scaling factor is scale = curScale / preScale, where preScale is the scaling factor formed by the last two fingers, and the calculation method is the same as curScale. Of course, scale needs to be controlled within a reasonable range and cannot be scaled infinitely. For example, the lower limit is set to 1 / 3 and the upper limit is set to 3 to prevent the scaling from being too large, resulting in unclear display of the content in the canvas. With the scaling center and scaling factor, you can use the Android standard method canvas.scale(scale, scale, centerX, centerY) to scale the canvas.
[0085] If it is determined according to the coordinates of the two touch points that the moving directions of the two touch points are the same, it can be proved that the user needs to perform a translation operation. Therefore, if the user needs to perform a translation operation, the translation can be performed in the following manner.
[0086] Specifically, the translation algorithm includes: the displacement in the X direction is dx=(X1-preX1)+(X2-preX2), the displacement in the Y direction is dy=(Y1-preY1)+(Y2-preY2), and then, the Android standard method canvas.translate(dx,dy) is called to translate the canvas.
[0087] In order to better implement the embodiment of the present application, in one embodiment of the present application, after entering the picture control mode, the method further includes:
[0088] If any one of the first touch point and the second touch point disappears, the target displacement direction and the target displacement distance corresponding to the existing touch point are determined; and the display screen of the touch device is translated according to the target displacement direction and the target displacement distance.
[0089] The above embodiment provides a specific control scheme after entering the screen control mode. However, in some application scenarios, after the user enters the screen control mode, it is possible that one of the two fingers is lifted, that is, any one of the first touch point and the second touch point disappears. At this time, lift any one of the fingers, and there will be only one finger left on the canvas, because one finger cannot perform zoom operations. Therefore, at this time, the zoom and translation state is switched to the translation state. At this time, there is a problem. If the user switches to the screen control mode in the two-finger state and lifts one finger, what mode should be at this time? The answer to this question in the embodiment of the present application is: continue to maintain the screen control mode, because the previous description has determined that the user's current intention is canvas control, and there is no need to switch back to the writing and painting mode at this time. Therefore, it is sufficient to maintain the screen control mode at this time. One finger cannot zoom, and the control logic of the translation is executed at this time.
[0090] In addition, if the user needs to exit the screen control mode, it is also very convenient. Just lift the remaining finger and put it down again to automatically switch back to the writing and drawing mode. The translation of a single finger is even simpler: dx = X-preX, dy = Y-preY, and then use canvas.translate(dx,dy) to complete the translation control.
[0091] In order to better implement the device control method in the embodiment of the present application, in addition to the device control method, the embodiment of the present application also provides a device control device, which is applied to a touch device, such as Figure 3 As shown, the device 300 includes:
[0092] The first acquisition module 301 is used to acquire the current operation mode and the current touch point of the touch device; the current touch point is the contact point between the user's finger or stylus and the touch device;
[0093] A second acquisition module 302 is used to acquire a historical motion track of the first touch point on the touch device if the current touch point includes the first touch point and the second touch point and the current operation mode is the writing and drawing mode, and the generation time of the first touch point is earlier than that of the second touch point;
[0094] A mode control module 303, configured to maintain the writing and drawing mode if the length of the historical motion trajectory is greater than a preset first target length;
[0095] The mode control module 303 is used to switch the writing and drawing mode to the picture control mode if the length of the historical motion trajectory is less than or equal to the first target length.
[0096] The device control apparatus provided by the present application obtains the current operation mode of the touch device and the number of current touch points through the first acquisition module 301. If the current operation mode is the writing and drawing mode and the user controls the touch device through two touch points, the second acquisition module 302 can use the motion length of the historical motion trajectory of the touch point generated in advance, and the mode control module 303 can determine whether the touch device maintains the writing and drawing mode or switches to the screen control according to the length of the historical motion trajectory, thereby achieving the effect of controlling different modes through one operation method. Users do not need to use different operation methods to control different modes, which improves the convenience of control.
[0097] In some embodiments of the present application, the mode control module 303 is specifically used to:
[0098] If the length of the historical motion trajectory is less than or equal to the first target length, clear the writing and drawing traces corresponding to the historical motion trajectory;
[0099] If the writing and drawing traces corresponding to the historical motion trajectory are cleared, the writing and drawing mode is switched to the screen control mode.
[0100] In some embodiments of the present application, the mode control module 303 is further configured to:
[0101] If the current touch points include the first touch point and the second touch point, and the current operation mode is the erasing mode, obtaining a historical erasing track of the first touch point on the touch device;
[0102] If the historical erasing track is greater than the preset second target length, the erasing mode is maintained;
[0103] If the historical erasing track is less than or equal to the second target length, the erasing mode is switched to the picture control mode.
[0104] In some embodiments of the present application, the mode control module 303 is further configured to:
[0105] If the historical erasure track is less than or equal to the second target length, the erasure trace corresponding to the historical erasure track is restored;
[0106] If the erased traces are restored, the erase mode is switched to the picture control mode.
[0107] In some embodiments of the present application, the mode control module 303 is further configured to:
[0108] If the current touch points include the first touch point and the second touch point and the current operation mode is the function selection mode, the function selection mode is switched to the screen control mode.
[0109] In some embodiments of the present application, the mode control module 303 is further configured to:
[0110] If entering the picture control mode, determining a first displacement direction and a first displacement distance corresponding to the first touch point and a second displacement direction and a second displacement distance corresponding to the second touch point;
[0111] If the first displacement direction and the second displacement direction are the same, the display screen of the touch device is translated according to the first displacement distance and the second displacement distance;
[0112] If the first displacement direction and the second displacement direction are different, the display image of the touch device is scaled according to the first displacement distance and the second displacement distance.
[0113] In some embodiments of the present application, the mode control module 303 is further configured to:
[0114] If any one of the first touch point and the second touch point disappears, determining the target displacement direction and the target displacement distance corresponding to the existing touch point;
[0115] The display screen of the touch device is translated according to the target displacement direction and the target displacement distance.
[0116] The present application also provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the steps of any device control method in the present application. The terminal device integrates any device control method provided in the present application. Figure 4 As shown, it shows a schematic diagram of the structure of the terminal device involved in the embodiment of the present application, specifically:
[0117] The terminal device may include one or more processing core processors 401, one or more computer-readable storage media memories 402, a power supply 403, an input unit 404 and other components. Those skilled in the art will appreciate that Figure 4 The terminal device structure shown in the figure does not constitute a limitation on the terminal device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:
[0118] The processor 401 is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire terminal device. By running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, the processor 401 executes various functions of the terminal device and processes data, thereby monitoring the terminal device as a whole. Optionally, the processor 401 may include one or more processing cores; the processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, the user interface and the application program, etc., and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.
[0119] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0120] The terminal device also includes a power supply 403 for supplying power to each component. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, power consumption management and other functions through the power management system. The power supply 403 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0121] The terminal device may further include an input unit 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0122] Although not shown, the terminal device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the terminal device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402, thereby realizing various functions, such as:
[0123] Get the current operation mode and the current touch point of the touch device; the current touch point is the contact point between the user's finger or stylus and the touch device;
[0124] If the current touch points include the first touch point and the second touch point and the current operation mode is the writing and drawing mode, obtaining the historical movement track of the first touch point on the touch device, and the generation time of the first touch point is earlier than that of the second touch point;
[0125] If the length of the historical motion trajectory is greater than the preset first target length, the writing and drawing mode is maintained;
[0126] If the length of the historical motion trajectory is less than or equal to the first target length, the writing and drawing mode is switched to the screen control mode.
[0127] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0128] To this end, the embodiment of the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any device control method provided in the embodiment of the present application. For example, the computer program loaded by the processor can execute the following steps:
[0129] Get the current operation mode and the current touch point of the touch device; the current touch point is the contact point between the user's finger or stylus and the touch device;
[0130] If the current touch points include the first touch point and the second touch point and the current operation mode is the writing and drawing mode, obtaining the historical movement track of the first touch point on the touch device, and the generation time of the first touch point is earlier than that of the second touch point;
[0131] If the length of the historical motion trajectory is greater than the preset first target length, the writing and drawing mode is maintained;
[0132] If the length of the historical motion trajectory is less than or equal to the first target length, the writing and drawing mode is switched to the screen control mode.
[0133] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.
[0134] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.
[0135] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0136] The above is a detailed introduction to a device control method and apparatus provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A device control method, characterized in that: Applied to a touch device, the method comprises: Acquire the current operation mode and the current touch point of the touch device; the current touch point is the contact point between the user's finger or stylus and the touch device; If the current touch point includes a first touch point and a second touch point and the current operation mode is a writing and drawing mode, obtaining a historical movement track of the first touch point on the touch device, and the generation time of the first touch point is earlier than that of the second touch point; If the length of the historical motion trajectory is greater than a preset first target length, maintaining the writing and drawing mode; If the length of the historical motion trajectory is less than or equal to the first target length, the writing and drawing mode is switched to the picture control mode.
2. The device control method according to claim 1, characterized in that: If the length of the historical motion trajectory is less than or equal to the first target length, switching the writing and drawing mode to the picture control mode includes: If the length of the historical motion trajectory is less than or equal to the first target length, clearing the writing and drawing traces corresponding to the historical motion trajectory; If the writing and drawing traces corresponding to the historical motion trajectory are completely cleared, the writing and drawing mode is switched to the picture control mode.
3. The device control method according to claim 1, characterized in that: After obtaining the current operating mode and the current touch point of the touch device, the method further includes: If the current touch point includes the first touch point and the second touch point, and the current operation mode is the erasing mode, obtaining a historical erasing track of the first touch point on the touch device; If the historical erasing track is greater than a preset second target length, maintaining the erasing mode; If the historical erasing track is less than or equal to the second target length, the erasing mode is switched to the picture control mode.
4. The device control method according to claim 3, characterized in that: If the historical erasure track is less than or equal to the second target length, switching the erasure mode to the picture control mode includes: If the historical erasure track is less than or equal to the second target length, restoring the erasure trace corresponding to the historical erasure track; If the erased traces are completely restored, the erase mode is switched to the picture control mode.
5. The device control method according to claim 1, characterized in that: After obtaining the current operating mode and the current touch point of the touch device, the method further includes: If the current touch point includes a first touch point and a second touch point and the current operation mode is a function selection mode, the function selection mode is switched to the screen control mode.
6. The device control method according to any one of claims 1 to 5, characterized in that: The method further comprises: If the picture control mode is entered, determining a first displacement direction and a first displacement distance corresponding to the first touch point and a second displacement direction and a second displacement distance corresponding to the second touch point; If the first displacement direction and the second displacement direction are the same, shifting the display screen of the touch device according to the first displacement distance and the second displacement distance; If the first displacement direction and the second displacement direction are different, the display image of the touch device is scaled according to the first displacement distance and the second displacement distance.
7. The device control method according to claim 6, characterized in that: After entering the picture control mode, the method further includes: If any one of the first touch point and the second touch point disappears, determining a target displacement direction and a target displacement distance corresponding to the existing touch point; The display screen of the touch control device is translated according to the target displacement direction and the target displacement distance.
8. A device control device, characterized in that: Applied to a touch device, the device comprises: A first acquisition module, used to acquire a current operation mode and a current touch point of the touch device; the current touch point is a contact point between a user's finger or a stylus and the touch device; A second acquisition module is used to acquire a historical motion track of the first touch point on the touch device if the current touch point includes a first touch point and a second touch point and the current operation mode is a writing and drawing mode, and the generation time of the first touch point is earlier than that of the second touch point; A mode control module, configured to maintain the writing and drawing mode if the length of the historical motion trajectory is greater than a preset first target length; A mode control module is used to switch the writing and drawing mode to the picture control mode if the length of the historical motion trajectory is less than or equal to the first target length.
9. A terminal device, characterized in that: The terminal device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the steps in the device control method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps in the device control method according to any one of claims 1 to 7.
