Text editing method, terminal device and readable storage medium

By detecting the pressing and sliding operation of the touch screen slide bar and determining the target cursor position, and performing matching text editing operations based on the text stack, the problem of low efficiency of text editing operations in the prior art is solved, and the effect of simplifying the operation process and improving efficiency is achieved.

CN113705173BActive Publication Date: 2025-04-25GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010443007.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-22
Publication Date
2025-04-25
Estimated Expiration
2040-05-22

AI Technical Summary

Technical Problem

In the prior art, text editing operation is inefficient, and users need to execute option click operations multiple times, resulting in cumbersome operation process.

Method used

By detecting whether the sliding bar displayed on the touch screen is press-sliding operation, and when the sliding bar is detected, the target cursor position is determined in the text to be edited, and a matching text editing operation is performed based on the text stack.

Benefits of technology

The execution process of text editing operations is simplified and the implementation efficiency of text editing operations is improved. Users only need to perform corresponding text editing operations through the sliding situation on the slide bar, without multiple option clicks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113705173B_ABST
    Figure CN113705173B_ABST
Patent Text Reader

Abstract

The present application provides a text editing method, a terminal device and a readable storage medium, which relate to the field of text processing. The present application detects whether a pressing and sliding operation occurs on a sliding bar displayed on a touch screen, and when a pressing and sliding operation is detected on the sliding bar, a target cursor position corresponding to the pressing and sliding operation is determined in the text to be edited with the current cursor editing position as the starting point, and then a text editing operation matching the starting sliding direction of the pressing and sliding operation is performed between the current cursor editing position and the target cursor position of the text to be edited based on a text stack for caching text characters, so that the corresponding text editing operation can be performed only by the sliding situation on the sliding bar, without the user having to perform option pressing operations multiple times as in the prior art, thereby simplifying the execution process of the text editing operation and improving the implementation efficiency of the text editing operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of text processing, and in particular to a text editing method, a terminal device and a readable storage medium. Background Art

[0002] With the continuous development of electronic technology, touch screens are widely used in various electronic devices (such as smart phones, tablet computers and self-service control terminals). Such electronic devices can usually realize text editing functions through touch screens. In the process of realizing text editing functions, common text editing operations such as text cutting, text pasting, text copying and text deletion have also attracted widespread attention from users due to their extremely high convenience.

[0003] At present, the implementation method of the above-mentioned commonly used text editing operations (for example, text cutting or text pasting) generally requires the user to select text in the text box to be operated on the touch screen, and long press the text box to pop up a menu option, select and click the copy, cut or delete option in the menu option, so that the selected text can be copied, cut or deleted. Or, directly long press the text box to be operated to pop up a menu option, select and click the paste option in the menu option, so that the cached text content can be pasted into the text box to be operated. In this process, when the user implements a certain text editing operation, it is necessary to perform multiple option click operations on the touch screen, and the implementation efficiency of the entire text editing operation is extremely low, and the corresponding execution process is relatively cumbersome. Summary of the invention

[0004] In view of this, the purpose of the present application is to provide a text editing method, apparatus, terminal device and readable storage medium, which can avoid the user from performing option clicking operations multiple times, simplify the execution process of text editing operations, and improve the implementation efficiency of text editing operations.

[0005] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0006] In a first aspect, an embodiment of the present application provides a text editing method, which is applied to a terminal device including a touch screen, wherein the terminal device stores a text stack for caching text characters, and a sliding bar for indicating a text editing operation is displayed on the touch screen, and the method includes:

[0007] Detecting whether a pressing and sliding operation occurs on the sliding bar;

[0008] When a pressing and sliding operation is detected on the sliding bar, a target cursor position corresponding to the pressing and sliding operation is determined in the text to be edited with the current cursor editing position as a starting point;

[0009] Based on the text stack, a text editing operation matching the starting sliding direction of the push-slide operation is performed between the current cursor editing position and the target cursor position of the text to be edited.

[0010] In a second aspect, an embodiment of the present application provides a text editing device, which is applied to a terminal device including a touch screen, wherein the terminal device stores a text stack for caching text characters, and a sliding bar for indicating a text editing operation is displayed on the touch screen, and the device includes:

[0011] An action detection module, used to detect whether a pressing and sliding operation occurs on the sliding bar;

[0012] A position determination module, for determining a target cursor position corresponding to the pressing and sliding operation in the text to be edited with the current cursor editing position as a starting point when a pressing and sliding operation occurs on the sliding bar;

[0013] The text editing module is used to perform a text editing operation matching the starting sliding direction of the press-slide operation between the current cursor editing position and the target cursor position of the text to be edited based on the text stack.

[0014] In a third aspect, an embodiment of the present application provides a terminal device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the text editing method described in the aforementioned embodiment.

[0015] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the text editing method described in the aforementioned embodiment is implemented.

[0016] This application has the following beneficial effects:

[0017] The present application detects whether a press-slide operation occurs on a sliding bar displayed on the touch screen, and when a press-slide operation is detected on the sliding bar, determines a target cursor position corresponding to the press-slide operation with the current cursor editing position as the starting point in the text to be edited, and then performs a text editing operation matching the starting sliding direction of the press-slide operation between the current cursor editing position and the target cursor position of the text to be edited based on a text stack used to cache text characters. This allows the corresponding text editing operation to be performed only through the sliding conditions on the sliding bar, without the user having to perform option click operations multiple times as in the prior art, thereby simplifying the execution process of the text editing operation and improving the implementation efficiency of the text editing operation.

[0018] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;

[0021] Figure 2 One of the flowcharts of the text editing method provided in the embodiment of the present application;

[0022] Figure 3 for Figure 2 One of the flowchart diagrams of the sub-steps included in step S230;

[0023] Figure 4 for Figure 2 The second flowchart diagram of the sub-steps included in step S230;

[0024] Figure 5 The second flowchart of the text editing method provided in the embodiment of the present application;

[0025] Figure 6 for Figure 5 One of the flowchart diagrams of the sub-steps included in step S260;

[0026] Figure 7 for Figure 5 The second flowchart diagram of the sub-steps included in step S260;

[0027] Figure 8 The third flowchart of the text editing method provided in the embodiment of the present application;

[0028] Fig. 9 A fourth flowchart of the text editing method provided in an embodiment of the present application;

[0029] Fig.10 A schematic diagram of the functional modules of the text editing device provided in an embodiment of the present application.

[0030] Icons: 10 - terminal device; 11 - memory; 12 - processor; 13 - communication unit; 14 - touch screen; 100 - text editing device; 110 - motion detection module; 120 - position determination module; 130 - text editing module. DETAILED DESCRIPTION

[0031] 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. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0032] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0033] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0034] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0035] Please refer to Figure 1 , Figure 1: is a schematic diagram of the structure of the terminal device 10 provided in an embodiment of the present application. In an embodiment of the present application, the terminal device 10 can be used to perform a text editing operation with a simple implementation process that does not require the user to perform an option click operation, so as to improve the implementation efficiency of the corresponding text editing operation. Among them, the terminal device 10 can provide a touch display interface so that the user can directly press and slide on the touch display interface to allow the terminal device 10 to perform a text editing operation corresponding to the sliding situation. In this embodiment, the terminal device 10 can be, but is not limited to, a smart phone with a touch display screen, a tablet computer, and a self-service control terminal.

[0036] In this embodiment, the terminal device 10 includes a text editing device 100, a memory 11, a processor 12, a communication unit 13, and a touch screen 14. The memory 11, the processor 12, the communication unit 13, and the touch screen 14 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, the memory 11, the processor 12, the communication unit 13, and the touch screen 14 can be electrically connected to each other through one or more communication buses or signal lines.

[0037] In this embodiment, the memory 11 can be used to store programs, and the processor 12 can execute the programs accordingly after receiving the execution instruction. The memory 11 can be, but not limited to, random access memory (RAM), read only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electric erasable programmable read-only memory (EEPROM), etc. The terminal device 10 can create a text stack for caching text characters in the memory 11, and the text stack can perform data processing on the text characters to be cached or the cached text characters based on its own "data first in, last out" characteristic.

[0038] In this embodiment, the processor 12 may be an integrated circuit chip with signal processing capability. The processor 12 may be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), and a network processor (NP). A general-purpose processor may be a microprocessor or any conventional processor, etc., which may implement or execute the methods, steps, and logic diagrams disclosed in the embodiments of the present application.

[0039] In this embodiment, the communication unit 13 is used to establish a communication connection between the terminal device 10 and other electronic devices through a network, and to perform data exchange through the network.

[0040] In this embodiment, the touch screen 14 is used to display data and generate instructions matching the touch operation in response to the user's touch operation on the screen. The touch screen 14 may display a slider indicating the text editing operation in the upper layer of the view layer where the text to be edited is located, so that the user can press and slide on the slider and / or press and drag the slider. In one implementation of this embodiment, the touch screen 14 may also display a deletion icon indicating the data cached in the text stack, so that the user can click on the deletion icon.

[0041] In this embodiment, the text editing device 100 includes at least one software function module that can be stored in the memory 11 in the form of software or firmware or fixed in the operating system of the terminal device 10. The processor 12 can be used to execute the executable modules stored in the memory 11, such as the software function modules and computer programs included in the text editing device 100. The terminal device 10 performs the corresponding text editing operation only according to the sliding condition of the user on the sliding bar through the text editing device 100, without the user having to perform the option clicking operation multiple times as in the prior art, thereby simplifying the execution process of the text editing operation and improving the efficiency of the text editing operation.

[0042] Understandably, Figure 1 The block diagram shown is only a schematic diagram of a structure of the terminal device 10. The terminal device 10 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0043] In the present application, in order to ensure that the terminal device 10 can simplify the execution process of the text editing operation, avoid the user from performing the option clicking operation multiple times, and improve the efficiency of the text editing operation, the present application implements the above function by providing a text editing method applied to the terminal device 10. The text editing method provided by the present application is described in detail below.

[0044] Optionally, see Figure 2 , Figure 2 It is one of the flowcharts of the text editing method provided in the embodiment of the present application. In the embodiment of the present application, Figure 2 The text editing method shown is shown below.

[0045] Step S210, detecting whether a pressing and sliding operation occurs on the sliding bar.

[0046] In this embodiment, the terminal device 10 monitors the pressing condition of the touch area corresponding to the slide bar, and determines that a pressing and sliding operation occurs on the slide bar when the pressing condition is manifested as the pressing position moving within the touch area of ​​the slide bar. The user can perform the pressing operation on the touch screen 14 by using a finger or a touch pen.

[0047] Step S220, when a press-slide operation is detected on the slide bar, a target cursor position corresponding to the press-slide operation is determined in the text to be edited with the current cursor editing position as the starting point.

[0048] In this embodiment, the target cursor position is used to indicate the end cursor position of the editing position range of the text editing operation that matches the push-slide operation, and the current cursor editing position is used to indicate the start cursor position of the editing position range of the text editing operation that matches the push-slide operation. The target cursor position changes with the change of the pressed position on the slider, and the pressed position on the slider can move along a first direction parallel to the direction in which the slider extends, or along a second direction opposite to the first direction. The user can also adjust the pressed position in combination with the first direction and the second direction, thereby determining the final target cursor position corresponding to the push-slide operation.

[0049] In one implementation of this embodiment, when the user presses and slides on the sliding bar in a first direction, the target cursor position will be adjusted forward starting from the cursor position corresponding to the previous pressing position; when the user presses and slides on the sliding bar in a second direction, the target cursor position will be adjusted backward starting from the cursor position corresponding to the previous pressing position. When the pressing position issued by the user is always at the boundary position of the sliding bar in the first direction, the corresponding target cursor position will be continuously adjusted forward, and when the pressing position issued by the user is always at the boundary position of the sliding bar in the second direction, the corresponding target cursor position will be continuously adjusted backward.

[0050] Step S230 , performing a text editing operation that matches the starting sliding direction of the push-slide operation between the current cursor editing position and the target cursor position of the text to be edited based on the text stack.

[0051] In this embodiment, when a press-slide operation occurs on the slide bar, the text editing operation performed by the terminal device 10 will match the starting sliding direction of the press-slide operation. At this time, the editing range of the text editing operation is from the current cursor editing position of the text to be edited to the target cursor position corresponding to the real-time pressing position during the entire press-slide process. The text editing operation varies with the starting sliding direction. For example, when the starting sliding direction is the first direction, the text editing operation is text cutting or text copying; when the starting sliding direction is the second direction, the text editing operation is text pasting.

[0052] In the embodiment of the present application, the terminal device 10 executes Figure 2 The text editing method shown can execute the corresponding text editing operation only according to the user's sliding on the sliding bar, without the user having to perform option clicking operations multiple times as in the prior art, thereby simplifying the execution process of the text editing operation and improving the implementation efficiency of the text editing operation.

[0053] Optionally, see Figure 3 , Figure 3 yes Figure 2 One of the flowchart diagrams of the sub-steps included in step S230 of the embodiment of the present application, when the starting sliding direction of the press sliding operation is the first direction, and the text editing operation matching the first direction is text cutting, the step S230 may include sub-steps S231 to S235.

[0054] Sub-step S231 , marking the text content between the current cursor editing position and the target cursor position of the text to be edited.

[0055] In this embodiment, when the starting sliding direction is the first direction, the terminal device 10 can complete the marking operation of the text content between the current cursor editing position and the target cursor position by modifying the style color of the text content between the current cursor editing position and the target cursor position of the text to be edited, or adjusting the background color of the text content, or adding an underline / deletion line at the position of the text content, so that the user can intuitively know the text content between the current cursor editing position and the target cursor position through the touch screen 14.

[0056] Sub-step S232, detecting whether the current cursor editing position of the text to be edited is adjusted after the text annotation is completed.

[0057] In this embodiment, after the terminal device 10 completes the text annotation operation on the text to be edited, it will monitor in real time whether the current cursor editing position of the terminal device 10 before performing the text annotation operation has changed, and implement the position adjustment detection operation of the current cursor editing position. When the terminal device 10 detects that the current cursor editing position is adjusted, the terminal device 10 will correspondingly execute sub-step S233, otherwise the terminal device 10 will correspondingly execute sub-steps S234 and S235.

[0058] Sub-step S233, cutting the annotated text content on the text to be edited into the text stack for caching.

[0059] In this embodiment, when the terminal device 10 detects that the current cursor editing position is adjusted, the terminal device 10 cuts the marked text content on the text to be edited into a text stack for caching to complete the text cutting operation.

[0060] Sub-step S234, detecting whether a double-click operation occurs on the sliding bar.

[0061] In this embodiment, when the terminal device 10 does not detect that the current cursor editing position is adjusted, it will detect in real time whether a double-click operation occurs on the sliding bar.

[0062] Sub-step S235, if a double-click operation is detected on the slide bar, the marking operation on the marked text content on the text to be edited is canceled.

[0063] In this embodiment, when the terminal device 10 does not detect that the current cursor editing position has been adjusted, and a double-click operation occurs on the slider, it may indicate that the user wants to cancel the text cutting operation. At this time, the terminal device 10 will not execute sub-step S233, and will correspondingly cancel the marking operation on the marked text content in the file to be edited.

[0064] In an embodiment of the present application, the terminal device 10 can implement a text cutting function with a simplified process by executing sub-steps S231 to S235 when the starting sliding direction of the press-slide operation is the first direction.

[0065] Optionally, see Figure 4 , Figure 4 yes Figure 2 2 is a flow chart of sub-steps included in step S230 of the present application. In the embodiment of the present application, when the starting sliding direction of the press-slide operation is the second direction, and the text editing operation matching the second direction is text pasting, the step S230 may include sub-steps S236 to S238.

[0066] Sub-step S236 , extracting from the text stack in a first-in, last-out order a text string to be loaded whose string length matches the text length from the current cursor editing position to the target cursor position.

[0067] In this embodiment, when the starting sliding direction is the second direction, the terminal device 10 will determine the text length of the text to be edited from the current cursor editing position to the target cursor position in real time according to the change of the target cursor position, and according to the "first in, last out" characteristic of the text stack, extract the text string to be loaded whose string length is the same as the text length from the text characters cached in the text stack.

[0068] Sub-step S237, pasting the text string to be loaded at the current cursor editing position of the text to be edited, and marking the pasted text string to be loaded.

[0069] In this embodiment, after the terminal device 10 extracts the text string to be loaded from the text stack, the terminal device 10 will paste the text string to be loaded at the current cursor editing position of the text to be edited to complete the text adding operation of the text string to be loaded. At the same time, after the terminal device 10 completes the text adding operation of the text string to be loaded, it will mark the added text string to be loaded accordingly, so that the user can preview the text string to be pasted through the touch screen 14. Among them, the terminal device 10 can complete the corresponding text string marking operation by modifying the style color of the added text string to be loaded, or adjusting the background color of the text string to be loaded, or adding an underline at the position of the text string to be loaded.

[0070] Sub-step S238, when it is detected that the pressing and sliding operation ends, cancel the marking operation on the marked text string on the text to be edited.

[0071] In this embodiment, after the terminal device 10 completes the text annotation operation on the added text string to be loaded, it will detect the pressing position of the press sliding operation in real time, and when the pressing position disappears, it will cancel the annotation operation of the annotated text string on the text to be edited, thereby realizing the corresponding text paste function.

[0072] In an embodiment of the present application, the terminal device 10 can implement a text pasting function with a simplified process by executing sub-steps S236 to S238 when the starting sliding direction of the press-slide operation is the second direction.

[0073] In the present application, the present application can also provide a solution for executing a corresponding text editing operation by judging the pressing and dragging of the slider, so as to avoid the user from performing the option pressing operation multiple times as in the prior art, simplify the execution process of the text editing operation, and improve the efficiency of the text editing operation. Another text editing method provided by the present application is described in detail below.

[0074] Optionally, see Figure 5 , Figure 5 This is the second flow chart of the text editing method provided in the embodiment of the present application. In the embodiment of the present application, Figure 5 The text editing method shown is shown below.

[0075] Step S240, detecting whether the sliding bar is pressed and dragged.

[0076] In this embodiment, the terminal device 10 monitors the position change of the pressing position on the sliding bar, and when it is detected that the position change is manifested as the pressing position exceeding the original touch area of ​​the sliding bar, determines that the sliding bar is pressed and dragged.

[0077] Step S250, when it is detected that the slide bar is pressed and dragged, a target cursor position corresponding to the pressing and dragging operation is determined in the text to be edited with the current cursor editing position as the starting point.

[0078] In this embodiment, the target cursor position at this time is used to indicate the end coordinate position of the editing position range of the text editing operation matching the press-drag operation. In the process of pressing and dragging the slider, the user can also adjust the distribution of the pressed position in the slider accordingly (i.e., the press-slide operation), thereby adjusting the final target cursor position corresponding to the press-drag operation. In the process of pressing and dragging the slider, the user can adjust the distribution of the pressed position in the slider accordingly (i.e., the press-slide operation), thereby adjusting the final target cursor position corresponding to the press-drag operation. In the process of pressing and dragging the slider, the dragging direction of the slider can be a third direction perpendicular to the extension direction of the slider length, or a fourth direction opposite to the third direction.

[0079] In one implementation of this embodiment, when the user presses and drags the slide bar in the third direction, the target cursor position will be adjusted forward with the cursor position corresponding to the previous pressed position as the starting point; when the user presses and drags the slide bar in the fourth direction, the target cursor position will be adjusted backward with the cursor position corresponding to the previous pressed position as the starting point. In this process, the user can also adjust the target cursor position by pressing and sliding on the slide bar in the first direction or the second direction without dragging the slide bar, in conjunction with the press and drag operation.

[0080] Step S260 , performing a text editing operation that matches the starting drag direction of the press-drag operation between the current cursor editing position and the target cursor position of the text to be edited based on the text stack.

[0081] In this embodiment, when the slider is pressed and dragged, the text editing operation performed by the terminal device 10 will match the starting drag direction of the pressing and dragging operation. At this time, the editing range of the text editing operation is from the current cursor editing position of the text to be edited to the target cursor position corresponding to the real-time pressing position during the entire pressing and sliding process. The text editing operation varies with the starting drag direction. For example, when the starting drag direction is the third direction, the text editing operation is text cutting or text copying; when the starting drag direction is the fourth direction, the text editing operation is text pasting.

[0082] In the embodiment of the present application, the terminal device 10 can execute Figure 5 The text editing method shown can execute corresponding text editing operations only according to the user's pressing and dragging of the sliding bar, without the user having to perform option clicking operations multiple times as in the prior art, thereby simplifying the execution process of text editing operations and improving the implementation efficiency of text editing operations.

[0083] Optionally, see Figure 6 , Figure 6 yes Figure 5 One of the flowchart diagrams of the sub-steps included in step S260 of the embodiment of the present application, when the starting drag direction of the press-drag operation is a third direction, and the text editing operation matching the third direction is text cutting, the step S260 may include sub-steps S261 to S265.

[0084] Sub-step S261 , marking the text content between the current cursor editing position and the target cursor position of the text to be edited.

[0085] In this embodiment, when the starting drag direction of the press and drag operation is a third direction, the terminal device 10 can complete the marking operation of the text content between the current cursor editing position and the target cursor position of the text to be edited by modifying the style color of the text content between the current cursor editing position and the target cursor position, or adjusting the background color of the text content, or adding an underline / deletion line at the position of the text content, so as to enable the user to intuitively know the text content between the current cursor editing position and the target cursor position through the touch screen 14.

[0086] Sub-step S262, detecting whether the current cursor editing position of the text to be edited is adjusted after the text annotation is completed.

[0087] In this embodiment, after the terminal device 10 completes the text annotation operation on the text to be edited, it will monitor in real time whether the current cursor editing position of the terminal device 10 before performing the text annotation operation has changed, and implement the position adjustment detection operation of the current cursor editing position. When the terminal device 10 detects that the current cursor editing position is adjusted, the terminal device 10 will correspondingly execute sub-step S263, otherwise the terminal device 10 will correspondingly execute sub-steps S264 and S265.

[0088] Sub-step S263, cutting the annotated text content on the text to be edited into the text stack for caching.

[0089] In this embodiment, when the terminal device 10 detects that the current cursor editing position is adjusted, the terminal device 10 cuts the marked text content on the text to be edited into a text stack for caching to complete the text cutting operation.

[0090] Sub-step S264, detecting whether a double-click operation occurs on the sliding bar.

[0091] In this embodiment, when the terminal device 10 does not detect that the current cursor editing position is adjusted, it will detect in real time whether a double-click operation occurs on the sliding bar.

[0092] Sub-step S265, if a double-click operation is detected on the slide bar, the marking operation on the marked text content on the text to be edited is canceled.

[0093] In this embodiment, when the terminal device 10 does not detect that the current cursor editing position has been adjusted, and a double-click operation occurs on the slider, it may indicate that the user wants to cancel the text cutting operation. At this time, the terminal device 10 will not execute sub-step S263, and will correspondingly cancel the marking operation on the marked text content in the file to be edited.

[0094] In an embodiment of the present application, the terminal device 10 can implement a text cutting function with a simplified process by executing sub-steps S261 to S265 when the initial dragging direction of the press-drag operation is the third direction.

[0095] Optionally, see Figure 7 , Figure 7 yes Figure 5 2 is a flow chart of sub-steps included in step S260 of the present application. In the embodiment of the present application, when the starting drag direction of the press-drag operation is the fourth direction, and the text editing operation matching the fourth direction is text cutting, the step S260 may include sub-steps S266 to S268.

[0096] Sub-step S266, extracting from the text stack in a first-in, last-out order a text string to be loaded whose string length matches the text length from the current cursor editing position to the target cursor position.

[0097] In this embodiment, when the starting drag direction of the press and drag operation is the fourth direction, the terminal device 10 will determine the text length of the text to be edited from the current cursor editing position to the target cursor position in real time according to the change of the target cursor position, and according to the "first in, last out" characteristic of the text stack, extract the text string to be loaded whose string length is the same as the text length from the text characters cached in the text stack.

[0098] Sub-step S267, pasting the text string to be loaded at the current cursor editing position of the text to be edited, and marking the pasted text string to be loaded.

[0099] In this embodiment, after the terminal device 10 extracts the text string to be loaded from the text stack, the terminal device 10 will paste the text string to be loaded at the current cursor editing position of the text to be edited to complete the text adding operation of the text string to be loaded. At the same time, after the terminal device 10 completes the text adding operation of the text string to be loaded, it will mark the added text string to be loaded accordingly, so that the user can preview the text string to be pasted through the touch screen 14. Among them, the terminal device 10 can complete the corresponding text string marking operation by modifying the style color of the added text string to be loaded, or adjusting the background color of the text string to be loaded, or adding an underline at the position of the text string to be loaded.

[0100] Sub-step S268, when it is detected that the pressing and dragging operation ends, cancel the marking operation on the marked text string on the text to be edited.

[0101] In this embodiment, after the terminal device 10 completes the text annotation operation on the added text string to be loaded, it will detect the pressing position of the press sliding operation in real time, and when the pressing position disappears, it will cancel the annotation operation of the annotated text string on the text to be edited, thereby realizing the corresponding text paste function.

[0102] In an embodiment of the present application, the terminal device 10 can implement a text pasting function with a simplified process by executing sub-steps S266 to S268 when the starting sliding direction of the press-drag operation is the fourth direction.

[0103] In the present application, the present application also provides a solution for executing a corresponding text editing operation by judging the click condition of the slider, so as to avoid the user from executing the option click operation multiple times as in the prior art, simplify the execution process of the text editing operation, and improve the efficiency of the text editing operation. Another text editing method provided by the present application is described in detail below.

[0104] Optionally, see Figure 8 , Figure 8 This is the third flow chart of the text editing method provided in the embodiment of the present application. In the embodiment of the present application, Figure 8 The text editing method shown is shown below.

[0105] Step S270, detecting whether a double-click operation occurs on the slide bar.

[0106] In this embodiment, the terminal device 10 determines whether a double-click operation occurs on the slide bar by monitoring in real time whether the touch area where the slide bar is located is double-clicked.

[0107] Step S280, when a double-click operation is detected on the slide bar, all text strings are extracted from the text stack in a first-in-last-out order, and all the extracted text strings are pasted at the current cursor editing position of the text to be edited.

[0108] In this embodiment, when the terminal device 10 detects a double-click operation on the slider, the terminal device 10 will directly paste all text strings cached in the text stack to the current cursor editing position of the text to be edited to complete the corresponding text pasting operation.

[0109] In the present application, the present application also provides a solution for deleting text characters cached in a text stack to adjust the data capacity of the text stack. The text character deletion solution provided by the present application is described in detail below.

[0110] Optionally, see Fig. 9 , Fig. 9 This is the fourth flow chart of the text editing method provided in the embodiment of the present application. In the embodiment of the present application, Fig. 9 The text editing method shown is shown below.

[0111] Step S290, detecting whether the elimination icon is clicked.

[0112] Step S300: when it is detected that the delete icon is clicked, all text strings cached in the text stack are cleared.

[0113] In this application, in order to ensure that the text editing device 100 included in the terminal device 10 can be implemented normally, this application implements its functions by dividing the text editing device 100 into functional modules. The specific composition of the text editing device 100 provided by this application is described below.

[0114] Please refer to Fig.10 , Fig.10 1 is a functional module diagram of a text editing device 100 provided in an embodiment of the present application. In the embodiment of the present application, the text editing device 100 includes an action detection module 110 , a position determination module 120 and a text editing module 130 .

[0115] The action detection module 110 is used to detect whether a pressing and sliding operation occurs on the sliding bar.

[0116] The position determination module 120 is used to determine the target cursor position corresponding to the pressing and sliding operation in the text to be edited with the current cursor editing position as the starting point when a pressing and sliding operation occurs on the sliding bar.

[0117] The text editing module 130 is used to perform a text editing operation matching the starting sliding direction of the push-slide operation between the current cursor editing position and the target cursor position of the text to be edited based on the text stack.

[0118] Optionally, the action detection module 110 is further used to detect whether the sliding bar is pressed and dragged.

[0119] The position determination module 120 is further configured to determine a target cursor position corresponding to the pressing and dragging operation in the text to be edited, taking the current cursor editing position as a starting point, when it is detected that the slide bar is pressed and dragged.

[0120] The text editing module 130 is further configured to perform a text editing operation matching the starting drag direction of the press-drag operation between the current cursor editing position and the target cursor position of the text to be edited based on the text stack.

[0121] Optionally, the action detection module 110 is further used to detect whether a double-click operation occurs on the sliding bar.

[0122] The text editing module 130 is also used to extract all text strings from the text stack in a first-in-last-out order when a double-click operation is detected on the slider, and paste all the extracted text strings at the current cursor editing position of the text to be edited.

[0123] Optionally, the action detection module 110 is further used to detect whether the elimination icon is clicked.

[0124] The text editing module 130 is further configured to clear all text strings cached in the text stack when it is detected that the delete icon is clicked.

[0125] It should be noted that the basic principles and technical effects of the text editing device 100 provided in the embodiment of the present application are the same as those of the text editing method applied to the terminal device 10 mentioned above. For the sake of brief description, for parts not mentioned in this embodiment, please refer to the above description of the text editing method.

[0126] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0127] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0128] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a readable storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned readable storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0129] In summary, in a text editing method, apparatus, terminal device and readable storage medium provided in an embodiment of the present application, the present application detects whether a press-slide operation occurs on a sliding bar displayed on a touch screen, and when a press-slide operation is detected on the sliding bar, determines a target cursor position corresponding to the press-slide operation in the text to be edited with the current cursor editing position as the starting point, and then performs a text editing operation matching the starting sliding direction of the press-slide operation between the current cursor editing position and the target cursor position of the text to be edited based on a text stack for caching text characters. Thus, the corresponding text editing operation can be performed only through the sliding situation on the sliding bar, without the user having to perform the option click operation multiple times as in the prior art, thereby simplifying the execution process of the text editing operation and improving the implementation efficiency of the text editing operation.

[0130] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A text editing method, characterized in that: The method is applied to a terminal device including a touch screen, wherein the terminal device stores a text stack for caching text characters, and a sliding bar for indicating a text editing operation is displayed on the touch screen, and the method comprises: Detecting whether a pressing and sliding operation occurs on the sliding bar; When a pressing and sliding operation is detected on the sliding bar, a target cursor position corresponding to the pressing and sliding operation is determined in the text to be edited with the current cursor editing position as a starting point; Based on the text stack, performing a text editing operation that matches the starting sliding direction of the push-slide operation between the current cursor editing position and the target cursor position of the text to be edited; When the starting sliding direction is a first direction parallel to the extending direction of the sliding bar, performing a text editing operation matching the starting sliding direction of the pressing and sliding operation based on the text stack between the current cursor editing position of the to-be-edited text and the target cursor position, includes: Marking the text content between the current cursor editing position and the target cursor position of the text to be edited; Check whether the current cursor editing position of the text to be edited is adjusted after the text annotation is completed; When it is detected that the current cursor editing position is adjusted, the marked text content on the text to be edited is cut into the text stack for caching.

2. The method according to claim 1, characterized in that The step of performing a text editing operation matching a starting sliding direction of the pressing and sliding operation between a current cursor editing position of the to-be-edited text and a target cursor position based on the text stack further includes: When it is not detected that the current cursor editing position is adjusted, detecting whether a double-click operation occurs on the slide bar; If a double-click operation is detected on the slide bar, the marking operation on the marked text content on the text to be edited is canceled.

3. The method according to claim 1, characterized in that When the starting sliding direction is a second direction opposite to the first direction, performing a text editing operation matching the starting sliding direction of the press sliding operation between the current cursor editing position and the target cursor position of the text to be edited based on the text stack, includes: Extracting a to-be-loaded text string whose string length matches the text length from the current cursor editing position to the target cursor position from the text stack in a first-in, last-out order; Pasting the text string to be loaded at the current cursor editing position of the text to be edited, and marking the pasted text string to be loaded; When it is detected that the pressing and sliding operation ends, the marking operation on the marked text string on the text to be edited is canceled.

4. The method according to claim 1, characterized in that The method further comprises: Detecting whether the sliding bar is pressed and dragged; When it is detected that the slide bar is pressed and dragged, a target cursor position corresponding to the pressing and dragging operation is determined in the text to be edited with the current cursor editing position as a starting point; Based on the text stack, a text editing operation matching the starting drag direction of the press-drag operation is performed between the current cursor editing position and the target cursor position of the text to be edited.

5. The method according to claim 4, characterized in that When the initial drag direction is a third direction perpendicular to the direction in which the slider extends, performing a text editing operation matching the initial drag direction of the press-drag operation based on the text stack between the current cursor editing position and the target cursor position of the text to be edited, including: Marking the text content between the current cursor editing position and the target cursor position of the text to be edited; Check whether the current cursor editing position of the text to be edited is adjusted after the text annotation is completed; When it is detected that the current cursor editing position is adjusted, the marked text content on the text to be edited is cut into the text stack for caching.

6. The method according to claim 5, characterized in that The step of performing a text editing operation matching a starting dragging direction of the press-drag operation between a current cursor editing position of the to-be-edited text and a target cursor position based on the text stack further includes: When it is not detected that the current cursor editing position is adjusted, detecting whether a double-click operation occurs on the slide bar; If a double-click operation is detected on the slide bar, the marking operation on the marked text content on the text to be edited is canceled.

7. The method according to claim 4, characterized in that When the initial drag direction is a fourth direction opposite to the third direction, performing a text editing operation matching the initial drag direction of the press-drag operation between the current cursor editing position and the target cursor position of the text to be edited based on the text stack, includes: Extracting a to-be-loaded text string whose string length matches the text length from the current cursor editing position to the target cursor position from the text stack in a first-in, last-out order; Pasting the text string to be loaded at the current cursor editing position of the text to be edited, and marking the pasted text string to be loaded; When it is detected that the pressing and dragging operation ends, the marking operation on the marked text string on the text to be edited is canceled.

8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: Detecting whether a double-click operation occurs on the slide bar; When a double-click operation is detected on the slide bar, all text strings are extracted from the text stack in a first-in-last-out order, and all the extracted text strings are pasted at the current cursor editing position of the text to be edited.

9. The method according to claim 8, characterized in that The touch screen also displays a deletion icon for clearing the text stack, and the method further includes: Detecting whether the elimination icon is clicked; When it is detected that the delete icon is clicked, all text strings buffered in the text stack are cleared.

10. A terminal device, characterized in that: It comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the text editing method described in any one of claims 1-9.

11. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the text editing method described in any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Text editing method and device for touch screen

    CN105867820A