Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or described herein. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The control display method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Referring to fig. 1, fig. 1 is a flowchart of a control display method according to an embodiment of the present disclosure. The control display method provided by the embodiment of the application comprises the following steps:
s101, receiving a first input of a display text.
The control display method provided by this embodiment can be applied to a control display device, which can be an electronic device, and the technical scheme is explained by taking the example that the control display method is applied to the electronic device.
The method comprises the steps of displaying text on a text display interface of a display screen of the electronic equipment, and receiving first input of a user for the displayed text. The first input may be a touch operation of the user on the display screen, or a sliding operation of the user on the display screen, and the embodiment is not limited in particular.
S102, responding to the first input, and displaying a cursor in the display text.
In response to the first input, a cursor is displayed in the displayed text, wherein a position of the cursor in the displayed text may be determined in accordance with a position of the first input.
And S103, displaying the target control in the interface according to the display position of the cursor.
In this embodiment, the text display interface includes a first display interface and a second display interface, where the first display interface is used to display a text and the second display interface is used to display a virtual keyboard. And displaying target controls with different display parameters on a second display interface according to the position of the cursor in the display text, wherein the display parameters comprise parameters such as display brightness, display icons and display colors of the target controls.
It should be noted that the target control is used to delete characters in the displayed text, and the virtual keyboard may be a virtual 9-key keyboard, a virtual 26-key keyboard, or other input form virtual keyboard.
In an optional implementation manner, in the process of text processing using the electronic device, after the user sets the display position of the cursor to the last character of the text content to be deleted through the first input, the user deletes the text content to be deleted through the second input to the target control.
In this embodiment, the display position of the cursor needs to be set at a specific position, that is, after the last character of the text content to be deleted, the display position is limited by other factors such as the size of the display screen of the electronic device, and the user is prone to misoperation, and may need to perform multiple operations to accurately set the cursor at the specific position.
Based on the above possible existing situation, in the embodiment of the present application, in the process of text processing, a user displays a cursor in a display text according to a first input of the user to the display text, and displays a target control in an interface according to a display position of the cursor, because a display parameter of the target control is associated with the display position of the cursor, the display position of the cursor in the embodiment may be flexibly set, and the user may delete characters in the display text by performing a related operation on the target control. Compared with the prior art that the display position of the cursor can only be set behind the character to be deleted, the display position of the cursor can be flexibly set in the embodiment, so that the operation modes of the user are enriched, the mode that the user deletes the text is more convenient and fast, and the efficiency of text editing is improved.
Further, after the target control is displayed in the interface, the method further includes:
receiving a second input of the target control by the user; in response to the second input, deleting the target text content.
Receiving a second input of the user for the target control, where the second input may be a touch operation of the user for the display screen, or a sliding operation of the user on the display screen, and the embodiment is not limited in particular.
In response to the second input, deleting target text content, wherein the target text content can be N characters positioned in the display text before the cursor; or M characters behind the cursor in the displayed text, wherein M and N are positive integers.
Further, the displaying a target control in an interface according to the display position of the cursor includes:
under the condition that the display position of the cursor is the initial position of the display text, displaying a target control in an interface, wherein the target control is displayed in a first mode; or under the condition that the display position of the cursor is the termination position of the display text, displaying a target control in an interface, wherein the target control is displayed in a second mode; or under the condition that the display position of the cursor is the middle position of the display text, displaying a target control in an interface, wherein the target control is displayed in a third mode.
In the case where the cursor is located at a different position for displaying text, the display manner of the target control is different, and there may be the following three cases:
a first possible case is that the display position of the cursor is the starting position of the displayed text, and the target control is displayed in a first manner, in which case the target control displayed in the first manner comprises a first arrow, wherein the pointing direction of the first arrow is towards the right.
It will be appreciated that the text entry sequence is now entered from left to right, and therefore, when the cursor is at the start of the displayed text, the sequence of the subsequent text in the entire text is to the right of the cursor, in which case the user only needs to delete the content of the text to the right.
When the display position of the cursor is the start position of the displayed text, no character exists before the display position of the cursor, and the first character of the displayed text is after the display position of the cursor. Referring to FIG. 2, the first character in the text is displayed as the "root" character, as shown, the cursor is positioned in front of the "root" character, in which case the target control is displayed in a first manner.
A second possible case is that the display position of the cursor is the termination position of the displayed text, and the target control is displayed in the second manner, in which case the target control displayed in the second manner includes a second arrow, wherein the pointing direction of the second arrow is towards the left.
It will be appreciated that the text entry order is now entered from left to right, so that when the cursor is at the end of the text display position, the order of the preceding text in the entire text is to the left of the cursor, in which case the user only needs to delete the content of the text to the left.
When the display position of the cursor is the end position of the displayed text, the last character of the displayed text is located before the display position of the cursor, and no character exists after the display position of the cursor. Referring to fig. 3, the last character in the text is shown as. "character, as shown, cursor is located". "after the character, in this case, the target control is displayed in a second manner.
A third possible case is that the display position of the cursor is an intermediate position of the displayed text, and the target control is displayed in a third manner, in which case the target control displayed in the third manner includes the first arrow and the second arrow.
It will be appreciated that the present text input sequence is input from left to right, and therefore, when the position of the cursor is the middle position of the displayed text, the text exists before and after the cursor, in this case, the user needs to delete any text content on the left and right sides, and therefore, the first arrow and the second arrow may be the arrow pointing to the right and the arrow pointing to the left, respectively.
In the case where the display position of the cursor is the middle position of the displayed text, the display position of the cursor is set between adjacent characters of the displayed text. Referring to FIG. 4, the cursor is shown between the characters "and" by ", in which case the target control is displayed in a third manner.
Further, a first target arrow is included on the target control, and the receiving a second input to the target control by the user includes:
receiving a second input of the first target arrow from the user; said deleting target text content in response to said second input comprises: determining corresponding target text content according to the display position of the cursor and the pointing direction of the first target arrow; and deleting the target text content.
In this embodiment, the target control includes a first target arrow, where the first target arrow is a first arrow or a second arrow. As described above, the pointing direction of the first arrow is to the right, and the pointing direction of the second arrow is to the left.
Specifically, how to determine the corresponding target text content according to the display position of the cursor and the pointing direction of the first target arrow is described as follows:
one possible scenario is that, referring to fig. 2, the cursor is shown at the start of the displayed text, in which case the target control is displayed in a first manner, i.e. the target control comprises a first arrow, which is then the target arrow.
The operation of clicking or sliding the first arrow by the user can be used as the second input, and the target text content can be determined according to the second input of the user. As shown in fig. 2, the pointing direction of the first arrow is towards the right, and all characters on the right side of the cursor in the text line where the cursor is located are determined as the target text content, i.e., "setting according to the current mobile terminal and input method control".
Another possible situation is that, referring to fig. 3, the cursor is shown at the end of the displayed text, in which case the target control is displayed in a second manner, i.e. the target control comprises a second arrow, which is the target arrow.
The operation of clicking or sliding the second arrow by the user can be used as the second input, and the target text content can be determined according to the second input of the user. As shown in fig. 3, the pointing direction of the first arrow is toward the left, and all characters positioned at the left side of the cursor in the text line where the cursor is positioned are determined as target text content, i.e., "it is fast. ".
Another possible situation is that, referring to fig. 4, as shown, the cursor is located at the middle position of the displayed text, in this case, the target control is displayed in a third way, that is, the target control includes a first arrow and a second arrow, and then the arrow clicked or slid by the user can be used as the target arrow.
In this case, if the user clicks or slides the first arrow (arrow to the right), all the characters on the text line where the cursor is located on the right side of the cursor are determined as the target text content, i.e., "due to movement". If the user clicks or slides the second arrow (left arrow), all the characters positioned at the left side of the cursor in the text line where the cursor is positioned are determined as target text content, namely, "delete button starts to delete in keyboard".
And deleting the target text content after determining the target text content.
It can be understood that after all the characters of the text line where the cursor is located are deleted, the contents of the previous line or the next line can be deleted in sequence, similar to the existing deletion operation rule. For example, after deleting "due to movement" on the right side of the cursor, the user continues to click or slide the first arrow (arrow to the right), and the "edit on terminal area … …" on the next row may be deleted in order.
Therefore, the user can delete a plurality of characters at different positions of the cursor by executing one operation on the target arrow, so that the text editing mode of the user is enriched, and the text editing efficiency is improved.
Further, a second target arrow is included on the target control, and the receiving a second input to the target control by the user includes:
receiving a second input of the user to a second target arrow; said deleting target text content in response to said second input comprises: determining a target text line according to the input parameters of the second input, wherein the target text line is different from the text line where the cursor is located; determining target text content in the target text line according to the display position of the cursor and the pointing direction of the second target arrow; and deleting the target text content.
In this embodiment, referring to fig. 5a to 5c, no matter where the display position of the cursor is to display the text, a second target arrow may be included on the target control, where the second target arrow may include a first arrow pointing to the right, a second arrow pointing to the left, a third arrow pointing to the top, and a fourth arrow pointing to the bottom.
It will be understood that the second target arrow may also include any one or combination of the first arrow, the second arrow, the third arrow and the fourth arrow.
In one possible case, referring to fig. 5a, the display text includes 9 lines, and the cursor is located in the last line of the display text.
In this case, the user may click or slide the third arrow pointing upwards to delete all the characters included in the displayed text before the 9 th line, i.e. the 8 th line, i.e. to delete the "cursor moved to the correct position" in the displayed text, resulting in an insufficient operation.
Alternatively, the user may click or slide a second arrow pointing to the left, deleting all the characters in line 9 that are before the cursor, i.e. deleting the "shortcut" in the displayed text. ".
It can be understood that, in the case that the user clicks or slides the third arrow pointing upward to delete the character in the 8 th row, the process may selectively delete the character in the 9 th row according to the position of the cursor in the 9 th row, in addition to deleting all the characters in the 8 th row. For example, as shown in fig. 5a, after the user clicks the third arrow pointing upward, and determines that the corresponding position of the cursor in the 9 th row in the 8 th row is "moving", the word "cursor moving" is determined as a deletable word, and the user may delete the character by clicking multiple times.
Another possible situation is that, referring to fig. 5b, the display text includes 9 lines in total, and the cursor is located on the first line in the display text.
In this case, the user may click or slide the fourth arrow pointing downwards to delete all characters included in the displayed text at line 1 and line 2, i.e. to delete the "counter" in the displayed text when the user needs to delete the entered content.
Alternatively, the user may click or slide the first arrow pointing to the right, deleting all characters in the target text line that are located behind the cursor, i.e., "settings according to the current mobile terminal and input method space" in the displayed text.
Another possible scenario is that, referring to fig. 5c, the display text includes 9 lines in total, and the cursor is located on the 5 th line in the display text.
In this case, the user may click or slide the third arrow pointing upward to delete all the characters included in the displayed text that are in the line 5 before, i.e., in the line 4, i.e., to delete "move the cursor to the rear of the content to be deleted" in the displayed text.
Alternatively, the user may click or slide a fourth arrow pointing downward to delete all characters included in the displayed text that are in the line 5 after the line 6, i.e., delete the "edit area on terminal and font size limit, user pass" in the displayed text.
Alternatively, the user may click or slide a second arrow pointing to the left, deleting all characters in the target text line that are located before the cursor, i.e., deleting the "delete button in the keyboard in the displayed text to begin deleting. ".
Alternatively, the user may click or slide the first arrow pointing to the right, deleting all characters in the target text line that are located after the cursor, i.e., "due to movement" in the displayed text.
In the above case, the target text line in the displayed text may be determined according to an input parameter of a second input to the second target arrow by the user, where the input parameter may be a duration of pressing the second target arrow by the user.
Referring to fig. 5c, as shown, the displayed text includes 9 text lines, wherein the cursor is located on the 5 th line of the displayed text. An optional implementation manner is that the input duration may be set to 2 seconds in advance, and the target text line is determined according to the relationship between the input parameter and the preset input duration.
For example, if the user presses the third arrow for 4 seconds, that is, the input parameter is 4 seconds, if the cursor is on the 5 th row, since the pointing direction of the third arrow is upward, the 3 rd row, which is two rows different from the 5 th row, is determined as the target text row.
For another example, if the length of time that the user presses the fourth arrow is 4 seconds, that is, the input parameter is 4 seconds, and the cursor is on the 5 th row, since the pointing direction of the fourth arrow is downward, the 7 th row that is two rows different from the 5 th row is determined as the target text row.
Then, the target text content in the target text line is determined according to the display position of the cursor and the pointing direction of the target arrow, and the target text content is deleted.
As an example, referring to fig. 5c, in the case that the cursor is located on the 5 th line of the display text and the target text line displays the 3 rd line of the text, as shown in the figure, since the cursor is located behind the 14 th character from left to right on the 5 th line, the 1 st character to the 14 th character from left to right on the 3 rd line can be determined as the target text content, and the 14 characters are deleted from the display text.
In an alternative embodiment, the length of the third arrow may be set to multiple segments, for example, the third arrow is set to 2 segments, and when the user presses the first segment of the third arrow, the characters included in the line before the text line where the cursor is located are deleted; when the user presses the second segment of the third arrow, the characters included in the second line before the text line where the cursor is located are deleted.
For example, the display text includes 9 lines in total, and the cursor is located on the 5 th line in the display text, i.e., the 5 th line of the target text line. In this case, the third arrow is set to 2 segments, and the user can press the first segment of the third arrow to delete all characters included in the displayed text in a line before the 5 th line, i.e., the 4 th line; the user may also press the second section of the third arrow to delete all characters included in the displayed text two lines before the 5 th line, i.e. the 3 rd line.
In another alternative embodiment, the length of the fourth arrow may be set to multiple segments, for example, the fourth arrow is set to 2 segments, and when the user presses the first segment of the fourth arrow, the characters included in the line next to the text line where the cursor is located are deleted; when the user presses the second segment of the fourth arrow, the characters included in the second line after the text line where the cursor is located are deleted.
For example, the display text includes 9 lines in total, and the cursor is located on the 5 th line in the display text. In this case, the fourth arrow is set to 2 segments, and the user can press the first segment of the fourth arrow to delete all characters included in the displayed text one line after the 5 th line, i.e., the 6 th line; the user may also press the second segment of the fourth arrow to delete all characters included in line 2, i.e. line 7, following line 5 in the displayed text.
Optionally, after the displaying a cursor in the displayed text in response to the first input, the method further includes:
receiving a third input of the user for the target control; responding to the third input, and displaying a target control interface, wherein the target control interface comprises H mobile controls and a first target control, and H is a positive integer; receiving a fourth input by the user for the movement control; in response to the fourth input, moving a position of the cursor in the displayed text; receiving a fifth input of the user for the first target control; deleting characters in the displayed text in response to the fifth input.
In this embodiment, a user may perform touch operation on the target control, so that the display screen displays the target control interface. Referring to fig. 6, as shown in the figure, the target control interface includes 4 moving controls and a first target control, where the first target control includes a first arrow pointing to the right and a second arrow pointing to the left, and the 4 moving controls are respectively a first moving control pointing to the upward direction, a second moving control pointing to the downward direction, a third moving control pointing to the left, and a fourth moving control pointing to the right. The movement control is used for moving the position of the cursor in the displayed text. The user can move the cursor by clicking or sliding the movement control.
After moving the cursor to the corresponding position, the user can click or slide the first arrow or the second arrow to delete the characters in the displayed text.
In the embodiment, the user can accurately move the cursor to the corresponding position by moving the control without clicking the screen for many times to move the cursor, so that redundant operations of the user are reduced, and the efficiency of text editing is improved.
As shown in fig. 7, the control display apparatus 200 includes:
a first receiving module 201, configured to receive a first input of a display text;
a first display module 202, configured to display a cursor in the displayed text in response to the first input;
and the second display module 203 is configured to display the target control in the interface according to the display position of the cursor.
Optionally, the display device 200 further includes:
the second receiving module is used for receiving a second input of the target control by the user;
a deletion module to delete the target text content in response to the second input.
Optionally, the second display module 203 is further configured to:
under the condition that the display position of the cursor is the initial position of the display text, displaying a target control in an interface, wherein the target control is displayed in a first mode; or,
under the condition that the display position of the cursor is the termination position of the display text, displaying a target control in an interface, wherein the target control is displayed in a second mode; or,
and under the condition that the display position of the cursor is the middle position of the display text, displaying a target control in an interface, wherein the target control is displayed in a third mode.
Optionally, the second receiving module is further configured to:
receiving a second input of the first target arrow from the user;
the deletion module is further configured to:
determining corresponding target text content according to the display position of the cursor and the pointing direction of the first target arrow;
and deleting the target text content.
Optionally, the second receiving module is further configured to:
receiving a second input of the user to a second target arrow;
the deletion module is further configured to:
determining a target text line according to the input parameters of the second input;
determining target text content in the target text line according to the display position of the cursor and the pointing direction of the second target arrow;
and deleting the target text content.
The control display device in the embodiment of the present application may be a mobile terminal, or may be a component, an integrated circuit, or a chip in the terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The control display device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The control display device provided in the embodiment of the present application can implement each process implemented by the control display method in the method embodiment of fig. 1, and is not described here again to avoid repetition.
In the embodiment of the application, in the process of text processing, a user displays a cursor in a display text according to a first input of the user to the display text, and displays a target control in an interface according to the display position of the cursor. Because the display parameter of the target control is associated with the display position of the cursor, the display position of the cursor in the embodiment can be flexibly set, and the user can delete the characters in the displayed text by performing related operations on the target control. Compared with the prior art that the display position of the cursor can only be set behind the character to be deleted, the display position of the cursor can be flexibly set in the embodiment, so that the operation modes of the user are enriched, the mode that the user deletes the text is more convenient and fast, and the efficiency of text editing is improved.
Optionally, an electronic device is further provided in this embodiment of the present application, and includes a processor 310, a memory 309, and a program or an instruction stored in the memory 309 and capable of being executed on the processor 310, where the program or the instruction is executed by the processor 310 to implement each process of the above control display method embodiment, and can achieve the same technical effect, and details are not described here to avoid repetition.
It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and the non-mobile electronic devices described above.
Fig. 8 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 300 includes, but is not limited to: radio frequency unit 301, network module 302, audio output unit 303, input unit 304, sensor 305, display unit 306, user input unit 307, interface unit 308, memory 309, and processor 310.
Those skilled in the art will appreciate that the electronic device 300 may further include a power source (e.g., a battery) for supplying power to various components, and the power source may be logically connected to the processor 310 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system. The electronic device structure shown in fig. 8 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
Wherein, the processor 310 is configured to receive a first input of the display text;
displaying a cursor in the display text in response to the first input;
and displaying the target control in the interface according to the display position of the cursor.
Optionally, the processor 310 is further configured to receive a second input of the target control from the user;
in response to the second input, deleting the target text content.
Optionally, the processor 310 is further configured to display a target control in an interface if the display position of the cursor is the starting position of the displayed text, where the target control is displayed in a first manner; or,
under the condition that the display position of the cursor is the termination position of the display text, displaying a target control in an interface, wherein the target control is displayed in a second mode; or,
and under the condition that the display position of the cursor is the middle position of the display text, displaying a target control in an interface, wherein the target control is displayed in a third mode.
Optionally, the processor 310 is further configured to receive a second input of the first target arrow from the user;
determining corresponding target text content according to the display position of the cursor and the pointing direction of the first target arrow;
and deleting the target text content.
Optionally, the processor 310 is further configured to receive a second input of a second target arrow from the user;
determining a target text line according to the input parameters of the second input;
determining target text content in the target text line according to the display position of the cursor and the pointing direction of the second target arrow;
and deleting the target text content.
In the embodiment of the application, in the process of text processing, a user displays a cursor in a display text according to a first input of the user to the display text, and displays a target control in an interface according to the display position of the cursor. Because the display parameter of the target control is associated with the display position of the cursor, the display position of the cursor in the embodiment can be flexibly set, and the user can delete the characters in the displayed text by performing related operations on the target control. Compared with the prior art that the display position of the cursor can only be set behind the character to be deleted, the display position of the cursor can be flexibly set in the embodiment, so that the operation modes of the user are enriched, the mode that the user deletes the text is more convenient and fast, and the efficiency of text editing is improved.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the control display method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and so on.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement each process of the above control display method embodiment, and can achieve the same technical effect, and is not described herein again to avoid repetition.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.