Cursor display method, smart device, and storage medium

By updating the cursor position in real time in the Android text control, the pause and delay problems when dragging the cursor are solved, smooth cursor movement is achieved, and the user experience is improved.

WO2025200957A1PCT designated stage Publication Date: 2025-10-02NIO SMART TECH CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/080457
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-26
Filing Date
2025-03-04
Publication Date
2025-10-02

AI Technical Summary

Technical Problem

The cursor in traditional Android text controls has obvious pauses and delays when dragging, which affects the user experience.

Method used

By obtaining the touch screen position based on the user's touch operation, determining the position of the cursor in the text control view coordinate system, and updating the cursor display in real time, continuous and smooth movement of the cursor is achieved.

Benefits of technology

It eliminates the pause when dragging the cursor, improves the smoothness and comfort of user operations, and provides a more intuitive and natural interface interaction experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025080457_02102025_PF_FP_ABST
    Figure CN2025080457_02102025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data processing. Specifically provided are a cursor display method, a smart device, and a storage medium, which aim to solve the technical problem of there being a noticeable feeling of stuttering and latency during the dragging of a cursor in an existing text control. To this end, the cursor display method in the present application comprises: on the basis of a touch operation of a user, acquiring a first position, wherein the touch operation involves the user touching a touch screen of a smart device, and the first position is a corresponding position of the touch operation on the touch screen; on the basis of the first position, determining a second position, wherein the second position is the position of a cursor in a view coordinate system of a text control; and on the basis of the second position, updating the display of the cursor in a current frame. In this way, a touch operation for dragging a cursor is processed, and the cursor is drawn in real time, so that the effect of a cursor smoothly moving along with a touch operation of a user is achieved, and a feeling of stuttering during the dragging of the cursor is eliminated, thereby improving the usage experience of users.
Need to check novelty before this filing date? Find Prior Art

Description

Cursor display method, intelligent device and storage medium

[0001] This application claims priority to Chinese patent application CN 202410355087.8, filed on March 26, 2024, with the invention name “Cursor display method, smart device and storage medium”. The entire contents of the above Chinese patent application are incorporated into this application by reference. Technical Field

[0002] The present application relates to the field of data processing technology, and specifically provides a cursor display method, an intelligent device, and a storage medium. Background Art

[0003] Currently, the cursor in traditional Android text controls is not properly processed. When dragging the cursor, it jumps bit by bit according to the current text offset. The cursor position is only refreshed every time the offset changes. In this case, users will feel a noticeable pause and delay. As mobile screen refresh rates increase, the display effect begins to pursue a more delicate and smooth effect, and the optimization of cursor display is imminent.

[0004] Accordingly, the art needs a new cursor display solution to solve the above problems. Summary of the Invention

[0005] In order to overcome the above-mentioned defects, the present application is proposed to provide a solution or at least partially solve the technical problem that the cursor in the existing text control has a noticeable pause and delay when dragging. The present application provides a cursor display method, a smart device and a storage medium.

[0006] In a first aspect, the present application provides a cursor display method, the method comprising:

[0007] Acquire a first position based on a touch operation of a user, wherein the touch operation is the user touching the touch screen of the smart device, and the first position is a corresponding position of the finger on the touch screen;

[0008] Determine a second position based on the first position, where the second position is the position of the cursor in the view coordinate system of the text control;

[0009] The display of the current frame cursor is updated based on the second position.

[0010] In one embodiment of the present application, determining the second position based on the first position includes:

[0011] Determine a position offset based on the first position, where the position offset is a position offset of the finger in the view coordinate system;

[0012] determining a third position based on the position offset, where the third position is a current row of the finger in the text layout of the text control;

[0013] The second position is determined based on the first position and the third position.

[0014] In one embodiment of the present application, determining the position offset based on the first position includes:

[0015] Get the text layout object of the text control;

[0016] The position offset is determined based on the first position and the text layout object.

[0017] In one embodiment of the present application, determining the third position based on the position offset includes:

[0018] Get the text layout object of the text control;

[0019] The third position is determined based on the position offset and the text layout object.

[0020] In one embodiment of the present application, determining the second position based on the first position and the third position includes:

[0021] determining boundary information of the current row based on the third position;

[0022] determining a horizontal coordinate of the cursor in the view coordinate system based on the first position;

[0023] The second position is determined based on the boundary information of the current row and the horizontal coordinate.

[0024] In one embodiment of the present application, the boundary information includes the top position and the bottom position of the current row in the view coordinate system.

[0025] In one embodiment of the present application, updating the current frame cursor based on the second position includes:

[0026] determining a position of the current frame cursor based on the second position and the width of the cursor;

[0027] Redraw the current frame cursor based on the set position of the current frame cursor;

[0028] The display of the current frame cursor is updated based on the drawn cursor.

[0029] In one embodiment of the present application, before determining the second position based on the first position, the method further includes: determining whether the cursor is dragged based on the user's touch operation.

[0030] In a second aspect, a smart device is provided, comprising:

[0031] at least one touch screen;

[0032] at least one processor;

[0033] and, a memory communicatively coupled to the at least one processor;

[0034] Wherein, a computer program is stored in the memory, and when the computer program is executed by the at least one processor, the aforementioned cursor display method is implemented.

[0035] In a third aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored in the computer-readable storage medium, wherein the program codes are suitable for being loaded and run by a processor to execute any one of the aforementioned cursor display methods.

[0036] The above one or more technical solutions of this application have at least one or more of the following beneficial effects:

[0037] The cursor display method disclosed herein specifically includes: obtaining a first position based on a user's touch operation, where the touch operation is the user touching the touchscreen of a smart device, and the first position is the corresponding position of the finger on the touchscreen; determining a second position based on the first position, where the second position is the position of the cursor in the view coordinate system of a text control; and updating the current frame cursor based on the second position. By processing the touch operation of dragging the cursor and drawing the cursor in real time, the cursor is smoothly moved in response to the user's touch operation, eliminating the sense of pause when dragging the cursor and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The disclosure of this application will be more easily understood with reference to the accompanying drawings. Those skilled in the art will readily appreciate that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of this application. Furthermore, similar numbers in the figures represent similar components, where:

[0039] FIG1 is a schematic flow chart of main steps of a cursor display method according to an embodiment of the present application;

[0040] FIG2 is a schematic diagram of the position of a touch point in a screen coordinate system and a view coordinate system in one embodiment of the present application;

[0041] FIG3 is a schematic diagram of determining a position offset in one embodiment of the present application;

[0042] FIG4 is a schematic diagram of a complete flow chart of a cursor display method according to an embodiment of the present application;

[0043] FIG5 is a schematic diagram of a complete flow chart of a cursor display method according to another embodiment of the present application;

[0044] FIG6 is a schematic block diagram of the main structure of a cursor display device according to an embodiment of the present application;

[0045] FIG7 is a schematic diagram of the structure of a smart device in one embodiment of the present application. DETAILED DESCRIPTION

[0046] Some embodiments of the present application are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present application and are not intended to limit the scope of protection of the present application.

[0047] In the description of this application, "module" and "processor" may include hardware, software, or a combination of both. A module may include hardware circuitry, various suitable sensors, communication ports, and memory. It may also include software components, such as program code, or a combination of software and hardware. A processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. A processor has data and / or signal processing capabilities. A processor may be implemented in software, hardware, or a combination of both. Non-transitory computer-readable storage media include any suitable medium capable of storing program code, such as magnetic disks, hard disks, optical disks, flash memory, read-only memory, random access memory, etc. The term "A and / or B" refers to all possible combinations of A and B, such as only A, only B, or both A and B. The terms "at least one of A or B" or "at least one of A and B" have similar meanings to "A and / or B" and may include only A, only B, or both A and B. The singular forms "a" and "the" may also include the plural forms.

[0048] Currently, the cursor in traditional Android text controls has not been specially processed. When dragging the cursor, it jumps bit by bit according to the offset of the current text. The cursor position is refreshed every time the offset changes. In this case, the user will feel a noticeable pause and delay.

[0049] To this end, the present application provides a cursor display method, a smart device, and a storage medium.

[0050] A text control is an interface element used to display and edit text.

[0051] Taking Android as an example, TextView is the most common and basic Android text control, used to display text content to the user. The TextView control has many attributes that can be set in XML files, and these attributes can also be declared dynamically in code. For example, you can set the text content, font color, and font size. TextView can also be configured to display clickable links when the text is a URL, email, phone number, or map.

[0052] For example, EditText is another Android text control that is a subclass of TextView. Users can edit an EditText control, meaning they can interact with it to enter or modify its contents. Listeners can also be set for the EditText control to detect whether the user's input is valid.

[0053] It can be understood that the above-mentioned text controls of the present application are not limited to text controls of the Android system, but can also be text controls of other smart device operating systems.

[0054] In order to make the purpose, technical solutions and advantages of this application more clear, the following is a further detailed description of the cursor display method of this application in conjunction with the accompanying drawings and embodiments, taking TextView as an example of a text control. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit the cursor display method described in this application to using TextView as a text control.

[0055] Please refer to FIG1 , which is a schematic flow chart of main steps of a cursor display method according to an embodiment of the present application.

[0056] As shown in FIG1 , the cursor display method in the embodiment of the present application mainly includes the following steps S101 to S103 .

[0057] Step S101: Acquire a first position based on a touch operation of a user, where the touch operation is the user touching a touch screen of a smart device, and the first position is a corresponding position of a finger on the touch screen.

[0058] The smart device in this application can be a mobile phone, a tablet computer, a personal computer (PC), a personal digital assistant (PDA), a smart watch, a netbook, a wearable electronic device, an augmented reality (AR) device, a virtual reality (VR) device, a vehicle-mounted device, a smart car, a smart speaker, a robot, etc. This application does not impose any special restrictions on the specific form of the smart device.

[0059] The smart device includes at least one touch screen. When a user touches the touch screen of the smart device, the smart device generates a touch event (TouchEvent). The touch event listener of the smart device can obtain detailed information about the touch event, including the horizontal coordinate (X value) and vertical coordinate (Y value) of the touch point in the touch screen coordinate system. As shown in FIG2 , the position (X, Y) of the touch point is shown in the screen coordinate system.

[0060] Step S102: determining a second position based on the first position, where the second position is the position of the cursor in the view coordinate system of the text control.

[0061] The view coordinate system of a text control is the positional relationship between a subview (such as a TextView or EditText text control) and its parent view. In this coordinate system, the top-left corner of the parent view is defined as the origin (0, 0). For smart devices, this origin corresponds to the top-left corner of the touchscreen, with positive directions pointing to the right horizontally and downward vertically. The view coordinate system shown in Figure 2 can be used as an example.

[0062] The second position is the position of the cursor in the view coordinate system of the text control determined by calculation.

[0063] Step S103: updating the display of the current frame cursor based on the second position.

[0064] In this application, a frame refers to a single image that constitutes a continuous dynamic image. The current frame cursor can be understood as the cursor that the user sees and operates at any given moment. When the user drags the cursor, the cursor moves continuously on the screen, forming a series of position points. These position points can be analogized as a continuous "frame" in the visual effect of real-time interaction.

[0065] Specifically, the current frame cursor is redrawn according to the position of the cursor in the view coordinate system of the text control, and the drawn current frame cursor is displayed.

[0066] When drawing a cursor, create a graphical element to represent the cursor, such as a vertical line (|) or an I-beam. Use the text control's drawing API to draw the cursor at the calculated cursor coordinates.

[0067] Based on the above steps S101-S103, first, a first position is obtained based on the user's touch operation, where the touch operation is the user touching the touch screen of the smart device, and the first position is the corresponding position of the touch operation on the touch screen; based on the first position, a second position is determined, where the second position is the position of the cursor in the view coordinate system of the text control; and based on the second position, the current frame cursor is updated. In this way, the second position of the cursor in the view coordinate system of the text control (the position of the finger on the touch screen) is accurately calculated, which means that the cursor is no longer limited to bit-by-bit jumping between text characters, but can move continuously and smoothly according to the touch action, thereby achieving a more intuitive and natural user interface interaction experience. In the traditional way, the cursor only refreshes its position when the text offset changes, resulting in an obvious sense of pause and delay. However, the present application can achieve real-time tracking of the user's touch action and immediately update the display position of the current frame cursor, so that the user hardly feels any delay when dragging the cursor, thereby enhancing the smoothness and comfort of the operation.

[0068] The above steps S102 to S103 are further explained below.

[0069] Specifically, the above step S102 can be implemented through the following steps S1021 to S1023.

[0070] Step S1021: determining a position offset based on the first position, where the position offset is a position offset of the finger in the view coordinate system.

[0071] Specifically, when processing a touch event, the text control can convert the touch point of the touch event into a relative position in the TextView (that is, the position offset of the finger in the view coordinate system) by calling convertToLocalHorizontalCoordinate() of the text control TextView, where the touch point is based on the screen as the reference system.

[0072] Alternatively, the position offset may be determined in the following manner.

[0073] In a specific embodiment of the present application, determining the position offset based on the first position includes: acquiring a text layout object of the text control; and determining the position offset based on the first position and the text layout object.

[0074] Specifically, by obtaining the layout object of the text control TextView and calling the getOffsetForHorizontal() of the layout, the word closest to the touch point is found in the text layout of the TextView. That is, the offset position of this word relative to the first word in the text layout of the TextView is the position offset.

[0075] Exemplarily, taking Figure 3 as an example, when the user touches the word "种", the word closest to the touch point is the word "种". At this time, the word "种" is divided into two equal widths on the left and right. When the touch point is within the left half (left one - half) width range of the word "种", the position offset is 1. When the touch point is within the right half (right one - half) range of the word "种", the position offset is 2. When the user touches the middle position between the word "一" and the word "种", the word closest to the touch point can be "一", and the determined position offset is 1.

[0076] Step S1022: Determine the third position based on the position offset. The third position is the current line where the finger is in the text layout of the text control. In the text layout of a text control (such as TextView or EditText), the current line refers to the line where the cursor is or the line of text that the user is currently focused on when the text content is displayed.

[0077] In a specific embodiment of the present application, the determining the third position based on the position offset includes: obtaining the text layout object of the text control; and determining the third position based on the position offset and using the text layout object.

[0078] The text layout object (Layout object) of the text control is a class responsible for managing the text layout and measurement in the text control. In Android development, the Layout object can calculate the display method of the text, including the number of lines of the text, the start and end positions of each line, the width and height of the text, etc.

[0079] Specifically, first obtain the text layout object of the text control, and then call the getLineForOffset(offset) of the layout object of the TextView to obtain the current line where the touch operation is in the text layout of the text control.

[0080] Step S1023: Determine the second position based on the first position and the third position.

[0081] Specifically, step S1023 can be implemented through the following steps S10231 to S10233.

[0082] Step S10231: Determine the boundary information of the current row based on the third position.

[0083] The boundary information of the current row may include a top position and a bottom position of the current row in the view coordinate system.

[0084] Specifically, first obtain the text layout object, that is, the Layout object, call getLineTop(line) to obtain the top position of the current line in the view coordinate system, and call getLineBottom(line) to obtain the bottom position of the current line in the view coordinate system.

[0085] Step S10232: Determine the horizontal coordinate of the cursor in the view coordinate system based on the first position.

[0086] Specifically, call convertToLocalHorizontalCoordinate() of TextView to convert the X value of the touch point to the relative position x in TextView. The relative position is the left value, which is the horizontal coordinate of the cursor in the view coordinate system.

[0087] Step S10233: Determine the second position based on the boundary information of the current row and the horizontal coordinate of the cursor in the view coordinate system.

[0088] Specifically, the bottom position of the current line in the view coordinate system is used as the bottom position of the cursor, the top position of the current line in the view coordinate system is used as the top position of the cursor, the horizontal coordinate of the cursor in the view coordinate system is used as the left position of the cursor, and the horizontal coordinate of the cursor in the view coordinate system plus the width of the cursor is used as the right position of the cursor.

[0089] In this way, the position of the cursor in the view coordinate system of the text control can be accurately obtained according to the position of the touch point in the screen coordinate system, which is conducive to achieving the effect of the cursor moving smoothly following the finger.

[0090] The above is a further description of step S102 , and the following further describes step S103 .

[0091] Specifically, step S103 can be implemented through the following steps S1031 to S1032.

[0092] Step S1031: Determine the position of the current frame cursor based on the second position and the width of the cursor.

[0093] Generally speaking, the cursor can be a vertical line (|) or a flashing mark of an I-block. Taking the vertical line (|) as an example, the width of the cursor is very small, usually just the width of a pixel, which represents an insertion point in the character stream. The height of the cursor usually matches the height of the currently used font so that the user can clearly identify the position of the cursor in the text. For the I-block cursor, the width of the I-block cursor is generally slightly larger than one pixel to make it easier to notice. It usually covers the width of one or more characters, and the specific width can be adjusted according to design needs. Similarly, the height of the I-block cursor should also be consistent with the height of the current font to ensure that the cursor can completely cover the vertical space of the character. The width of the cursor can be adaptively adjusted according to the actual application scenario, or it can be set according to the user's preferences. There is no specific limitation on this.

[0094] Specifically, according to the second position and the width of the cursor, the specific position where the cursor should be drawn in the current frame can be set through setBounds.

[0095] Exemplarily, the bottom position of the current line in the view coordinate system is used as the bottom position of the cursor, the top position of the current line in the view coordinate system is used as the top position of the cursor, the horizontal coordinate of the cursor in the view coordinate system is used as the left position of the cursor, and the horizontal coordinate of the cursor in the view coordinate system plus the width of the cursor is used as the right position of the cursor. At this time, the cursor position can be obtained as setBounds(left,top,left+width,bottom).

[0096] Step S1032: redrawing the current frame cursor based on the position of the current frame cursor.

[0097] Specifically, according to the specific position of the current frame cursor that has been set, invalidateCursor() is called and the current frame cursor view (View) is redrawn so that the new current frame cursor position can be displayed correctly.

[0098] In a specific embodiment of the present application, before determining the second position based on the first position, the method further includes: determining whether the cursor is dragged based on the user's touch operation.

[0099] As shown in Figure 4, when a touch event is received by the smart device (S201), the text control (e.g., TextView) processes the touch event (S202). Specifically, it first determines whether the cursor of the text control is being dragged (S203). If so, the position of the current frame cursor in the view coordinate system of the text control is determined according to the method of the aforementioned embodiment (S204); if not, the position of the current frame cursor in the view coordinate system of the text control is not determined. For example, if the user only touches the position of the current frame cursor with a finger but does not perform a drag action, the position of the current frame cursor in the view coordinate system of the text control is not determined. Finally, if it is determined that the cursor is being dragged, the cursor is drawn during the dragging process according to the position of the cursor (S205).

[0100] Specifically, when the cursor is dragged, the cursor's property value mIsDraggingCursor is set to true. When dragging ends or stops, the cursor's property value mIsDraggingCursor is set to false. Therefore, by determining the specific state of the cursor's property value mIsDraggingCursor, you can confirm whether the cursor is being dragged. In this way, you can accurately determine whether the cursor is being dragged.

[0101] In one embodiment, as shown in FIG5 , the cursor display method may be implemented specifically through the following steps S2041 to S2046 .

[0102] S2041: When the cursor is determined to be dragged, a touch operation is received and an offset of the touch event in the TextView is calculated based on the touch event position. If the offset is different from the previous offset, the offset of the current finger touch position in the view coordinate system of the TextView is updated. Specifically, Selection.setSelection() may be called to update the current offset.

[0103] S2042: Determine the current line of the touch operation in the text layout of the text control according to the offset in the text control TextView.

[0104] Specifically, getLineForOffset(offset) may be called to obtain the current line of the touch operation in the text layout of the text control.

[0105] S2043: Determine the bottom position and top position of the current row in the view coordinate system according to the current row.

[0106] Specifically, the top position of the current line in the view coordinate system is obtained by calling getLineTop(line), and the bottom position of the current line in the view coordinate system is obtained by calling getLineBottom(line).

[0107] S2044: Determine the horizontal coordinate of the cursor in the view coordinate system according to the position of the touch event.

[0108] Specifically, call convertToLocalHorizontalCoordinate() of TextView to convert the X value of the touch point to its relative position in TextView. This relative position is the horizontal coordinate of the cursor in the view coordinate system.

[0109] S2045: Setting the cursor position of the current frame according to the bottom position bottom and the top position top of the current line in the view coordinate system, the horizontal coordinate of the cursor in the view coordinate system, and the cursor width.

[0110] For example, the position of the current frame cursor can be set by setBounds(left, top, left+width, bottom).

[0111] S2046: Call invalidateCursor() to redraw the current frame cursor.

[0112] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art will understand that in order to achieve the effect of the present application, different steps do not have to be performed in such an order. They can be performed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present application.

[0113] Furthermore, the present application also provides a cursor display device.

[0114] Please refer to FIG6 , which is a main structural block diagram of a cursor display device according to an embodiment of the present application.

[0115] As shown in Figure 6, the cursor display device in the embodiment of the present application mainly includes an acquisition module 11, a determination module 12 and an update module 13. In some embodiments, one or more of the acquisition module 11, the determination module 12 and the update module 13 can be combined into one module.

[0116] In some embodiments, the acquisition module 11 can be configured to acquire the first position based on a user's touch operation, where the touch operation is the user touching the touch screen of the smart device, and the first position is a corresponding position of the touch operation on the touch screen.

[0117] The determination module 12 may be configured to determine a second position based on the first position, where the second position is a position of the cursor in a view coordinate system of the text control.

[0118] The update module 13 may be configured to update the current frame cursor based on the second position.

[0119] In one implementation, the description of specific implementation functions can refer to steps S101 to S103.

[0120] The above-mentioned cursor display device is used to execute the embodiment of the cursor display method shown in Figure 1. The technical principles, technical problems solved and technical effects produced by the two are similar. Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working process and related instructions of the cursor display device can refer to the contents described in the embodiment of the cursor display method, and will not be repeated here.

[0121] It will be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment of the present application can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of each of the above method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium can include: any entity or device, medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.

[0122] Furthermore, the present application also provides a smart device. In an embodiment of a smart device according to the present application, as shown in FIG7 , the smart device includes at least one processor 100, at least one memory 200, and at least one touch screen 300. The memory 200 can be configured to store a program for executing the cursor display method of the above-mentioned method embodiment, and the processor 100 can be configured to execute the program in the memory, which includes but is not limited to a program for executing the cursor display method of the above-mentioned method embodiment. For ease of explanation, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the method section of the embodiment of the present application.

[0123] In the embodiment of the present application, the smart device may be a control device device formed by various devices. In some possible implementations, the smart device may include multiple memories, multiple processors, and multiple touch screens. The program for executing the cursor display method of the above-mentioned method embodiment can be divided into multiple subroutines, and each subroutine can be loaded and run by the processor to execute different steps of the cursor display method of the above-mentioned method embodiment. Specifically, each subroutine can be stored in different memories respectively, and each processor can be configured to execute the program in one or more memories to jointly implement the cursor display method of the above-mentioned method embodiment, that is, each processor executes different steps of the cursor display method of the above-mentioned method embodiment respectively to jointly implement the cursor display method of the above-mentioned method embodiment.

[0124] The multiple processors may be processors deployed on the same device. For example, the smart device may be a high-performance device composed of multiple processors, and the multiple processors may be processors configured on the high-performance device. Furthermore, the multiple processors may be processors deployed on different devices. For example, the smart device may be a server cluster, and the multiple processors may be processors on different servers in the server cluster.

[0125] Furthermore, the present application also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present application, the computer-readable storage medium can be configured to store a program for executing the cursor display method of the above-mentioned method embodiment, and the program can be loaded and run by the processor to implement the above-mentioned cursor display method. For ease of explanation, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application. The computer-readable storage medium can be a memory device formed by various smart devices. Optionally, the computer-readable storage medium in the embodiment of the present application is a non-temporary computer-readable storage medium.

[0126] Furthermore, it should be understood that since the configuration of each module is merely for the purpose of illustrating the functional units of the apparatus of the present application, the physical devices corresponding to these modules may be the processor itself, or a portion of the software in the processor, a portion of the hardware, or a combination of software and hardware. Therefore, the number of modules in the figure is merely illustrative.

[0127] Those skilled in the art will appreciate that the various modules in the device can be adaptively split or merged. Such splitting or merging of specific modules will not cause the technical solution to deviate from the principles of this application. Therefore, the technical solutions after splitting or merging will fall within the scope of protection of this application.

[0128] Thus far, the technical solutions of the present application have been described in conjunction with the specific embodiments shown in the accompanying drawings. However, it is readily understood by those skilled in the art that the scope of protection of the present application is obviously not limited to these specific embodiments. Without departing from the principles of the present application, those skilled in the art may make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will fall within the scope of protection of the present application.

Claims

1. A cursor display method, characterized in that: The method comprises: Acquire a first position based on a touch operation of a user, wherein the touch operation is the user touching the touch screen of the smart device, and the first position is a corresponding position of the finger on the touch screen; Determine a second position based on the first position, where the second position is the position of the cursor in the view coordinate system of the text control; The display of the current frame cursor is updated based on the second position.

2. The cursor display method according to claim 1, wherein: The determining the second position based on the first position includes: Determine a position offset based on the first position, where the position offset is a position offset of the finger in the view coordinate system; determining a third position based on the position offset, where the third position is a current row of the finger in the text layout of the text control; The second position is determined based on the first position and the third position.

3. The cursor display method according to claim 2, wherein: The determining of the position offset based on the first position includes: Get the text layout object of the text control; The position offset is determined based on the first position and the text layout object.

4. The cursor display method according to claim 2, wherein: The determining of the third position based on the position offset includes: Get the text layout object of the text control; The third position is determined based on the position offset and the text layout object.

5. The cursor display method according to claim 2, wherein: The determining the second position based on the first position and the third position includes: determining boundary information of the current row based on the third position; determining a horizontal coordinate of the cursor in the view coordinate system based on the first position; The second position is determined based on the boundary information of the current row and the horizontal coordinate.

6. The cursor display method according to claim 5, characterized in that: The boundary information includes a top position and a bottom position of the current row in the view coordinate system.

7. The cursor display method according to any one of claims 1 to 6, characterized in that: The updating of the current frame cursor based on the second position includes: determining a position of the current frame cursor based on the second position and the width of the cursor; redrawing the current frame cursor based on the position of the current frame cursor; The display of the current frame cursor is updated based on the drawn cursor.

8. The cursor display method according to any one of claims 1 to 7, characterized in that: Before determining the second position based on the first position, the method further includes: determining whether the cursor is dragged based on a touch operation of the user.

9. A smart device, characterized in that: include: at least one touch screen; at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores a computer program, and when the computer program is executed by the at least one processor, the cursor display method according to any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium storing a plurality of program codes, characterized in that: The program code is suitable for being loaded and run by a processor to execute the cursor display method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Cursor positioning method

    CN104657077A

  • Cursor display method and device, electronic equipment and readable storage medium

    CN117170542A

  • Method for displaying cursor following korean-english character input mode

    KR101450668B1

  • Providing user interface feedback regarding cursor position on a display screen

    US20110083108A1