CN109683798A - A kind of text determines method, terminal and computer readable storage medium - Google Patents

A kind of text determines method, terminal and computer readable storage medium Download PDF

Info

Publication number
CN109683798A
CN109683798A CN201811629788.7A CN201811629788A CN109683798A CN 109683798 A CN109683798 A CN 109683798A CN 201811629788 A CN201811629788 A CN 201811629788A CN 109683798 A CN109683798 A CN 109683798A
Authority
CN
China
Prior art keywords
text
character
determined
position information
operating position
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811629788.7A
Other languages
Chinese (zh)
Other versions
CN109683798B (en
Inventor
张楚天
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
MIGU Music Co Ltd
MIGU Culture Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
MIGU Music Co Ltd
MIGU Culture Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, MIGU Music Co Ltd, MIGU Culture Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201811629788.7A priority Critical patent/CN109683798B/en
Publication of CN109683798A publication Critical patent/CN109683798A/en
Application granted granted Critical
Publication of CN109683798B publication Critical patent/CN109683798B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • G06F3/04883Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures for inputting data by handwriting, e.g. gesture or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range

Abstract

The embodiment of the invention discloses a kind of text maninulation method, terminal and computer readable storage mediums.Above-mentioned text maninulation method includes: that gesture update event is received in current display text when receiving text selection instruction;When gesture update event meets preset condition, the first operating position information is acquired;Wherein, preset condition is for characterizing gesture update event as text selection operation;According to the first operating position information, the first intermediate character position and the first character number are determined;According to the first intermediate character position and the first character number, the first text selection region is determined.

Description

A kind of text determines method, terminal and computer readable storage medium
Technical field
The present invention relates to technical field of mobile terminals more particularly to a kind of text to determine method, terminal and computer-readable Storage medium.
Background technique
With the fast development of information technology, the function of mobile terminal is more and more complete, browses text by mobile terminal Or editor's text also becomes increasingly prevalent.Content of text interested for user, user can have duplication text content Demand, further to handle text.
It in the prior art, is all that text area is selected by the movement of former and later two cursors when replicating text in the terminal Domain, however, needing repeatedly to move cursor, terminal can just determine text when the display screen of terminal is smaller and resolution ratio is lower This selection region, process is cumbersome, inefficiency.
Summary of the invention
In order to solve the above technical problems, an embodiment of the present invention is intended to provide a kind of texts to determine method, terminal and computer Readable storage medium storing program for executing simplifies the process in text selecting region, improves the efficiency that terminal determines text selecting region.
In order to achieve the above objectives, the technical scheme of the present invention is realized as follows:
In a first aspect, the embodiment of the invention provides a kind of texts to determine method, comprising:
Gesture update event is obtained in current display text;
When the gesture update event meets preset condition, the first operating position information is acquired;Wherein, the default item Part is for characterizing gesture update event as text selection operation;
According to the first operating position information, the first intermediate character position and the first character number are determined;
According to first intermediate character position and first character number, the first text selection region is determined.
In the above scheme, after first intermediate character of determination and the first character number, the method also includes:
Acquire the second operating position information;
According to the first operating position information and the second operating position information, the second intermediate character position is determined;
According to the first operating position information, the second operating position information and first character number, determine Second character number;
According to second intermediate character position and second character number, the second text selection region is determined.
In the above scheme, described according to the first operating position information, determine the first intermediate character position and first Character number, comprising:
According to the first operating position information, the first selected areas is determined;
According to the first selected areas, the first center pixel position and the first pixel number are determined;
The text font size for obtaining the current display text determines the corresponding pixel number of the text font size;
According to first center pixel position, first intermediate character position is determined;
According to first pixel number pixel number corresponding with the text font size, first character number is determined.
In the above scheme, described according to first intermediate character position and first character number, determine first Text selection region, comprising:
According to first intermediate character position and first character number, the first text initial position is determined;
According to first text initial position and first character number, first text selection region is determined.
In the above scheme, described according to first operating position and the second operating position information, determine second Intermediate character position, comprising:
According to the first operating position information, the first selected areas is determined;
According to the first selected areas, the first center pixel position and the first diagonal distance midpoint are determined;
According to the second operating position information, the second selected areas is determined;
According to the second selected areas, the second diagonal distance midpoint is determined;
According to first diagonal distance midpoint and second diagonal distance midpoint, the second center pixel position is determined It sets;
According to second center pixel position, second intermediate character position is determined.
In the above scheme, described according to first diagonal distance midpoint and second diagonal distance midpoint, it determines Second center pixel position out, comprising:
By the offset between second diagonal distance midpoint and first diagonal distance midpoint, it is determined as centre bit Set offset;
According to the center position offsets and first center pixel position, the second center pixel position is determined.
In the above scheme, it is described according to the first operating position information, the second operating position information with it is described First character number determines the second character number, comprising:
According to the first operating position information and the second operating position information, scaling is determined;
According to the scaling, processing is zoomed in and out to first character number, determines the second character number.
In the above scheme, described according to the first operating position information and the second operating position information, it determines Scaling, comprising:
According to the first operating position information, the first diagonal distance is determined;
According to the second operating position information, the second diagonal distance is determined;
The ratio between second diagonal distance and first diagonal distance are determined as scaling.
In the above scheme, described according to second intermediate character position and second character number, determine second Text selection region, comprising:
According to second intermediate character position and second character number, the second text initial position is determined;
According to second text initial position and second character number, second text selection region is determined.
Second aspect, the embodiment of the invention provides a kind of terminals, comprising:
Acquiring unit, for obtaining gesture update event in current display text;
Acquisition unit, for acquiring the first operating position information when the gesture update event meets preset condition;Its In, the preset condition is for characterizing gesture update event as text selection operation;
Determination unit, for determining the first intermediate character position and the first character according to the first operating position information Number;And according to first intermediate character position and first character number, determine the first text selection region.
In the above scheme, the acquisition unit is also used in first intermediate character of determination and the first character number Later, the second operating position information is acquired.
The determination unit is also used to according to the first operating position information and the second operating position information, really Fixed second intermediate character position;And according to second intermediate character position and second character number, determine the second text This chosen area.
In the above scheme, the acquiring unit is also used to obtain the text font size of current display text;
The determination unit is specifically used for determining the first selected areas according to the first operating position information;According to One selected areas determines the first center pixel position and the first pixel number;Determine the corresponding pixel number of the text font size;According to First center pixel position determines first intermediate character position;And according to first pixel number and the text The corresponding pixel number of this font size determines first character number.
In the above scheme, the determination unit is specifically used for according to first intermediate character position and described first Character number determines the first text initial position;According to first text initial position and first character number, determine First text selection region.
In the above scheme, the determination unit is specifically used for determining the first choosing according to the first operating position information Middle region;According to the first selected areas, the first center pixel position and the first diagonal distance midpoint are determined;According to second behaviour Make location information, determines the second selected areas;According to the second selected areas, the second diagonal distance midpoint is determined;According to described Pair of horns determines the second center pixel position apart from midpoint and second diagonal distance midpoint;According to second center Location of pixels determines second intermediate character position.
In the above scheme, the determination unit is used for second diagonal distance midpoint and first pair of angular distance From the offset between midpoint, it is determined as center position offsets;
According to the center position offsets and first center pixel position, the second center pixel position is determined.
In the above scheme, the determination unit is specifically used for according to the first operating position information and described second Operating position information, determines scaling;And according to the scaling, place is zoomed in and out to first character number Reason, determines the second character number.
In the above scheme, the determination unit is specifically used for determining first pair according to the first operating position information Angular distance;According to the second operating position information, the second diagonal distance is determined;And by second diagonal distance with it is described The ratio between first diagonal distance is determined as scaling.
In the above scheme, the determination unit, for according to second intermediate character position and second character Number determines the second text initial position;According to second text initial position and second character number, determine described in Second text selection region.
The third aspect, the embodiment of the invention also provides a kind of terminals, comprising: memory and processor;
The memory, for storing executable text maninulation instruction;
The processor realizes such as above-mentioned for executing the executable text maninulation stored in the memory instruction Method described in one side.
Fourth aspect, the present invention provide a kind of computer readable storage medium, contain executable text maninulation instruction, are used for When processor being caused to execute, such as the described in any item methods of above-mentioned first aspect are realized.
The embodiment of the invention provides a kind of texts to determine method, terminal and computer readable storage medium, ought be above This display area obtains gesture update event;When gesture update event meets preset condition, the first operating position information is acquired, Preset condition is for characterizing gesture update event as text selection operation;According to the first operating position information, determine in first Between character position and the first character number;According to the first intermediate character position and the first character number, the first text selection is determined Region.It is fast by two fingers operation information when terminal judges that operating gesture meets preset condition using above-mentioned technical implementation way Speed determines text selecting region, simplifies the process in text selecting region, improves the operating efficiency for choosing text.
Detailed description of the invention
Fig. 1 is the flow chart one that a kind of text provided in an embodiment of the present invention determines method;
Fig. 2 is the flowchart 2 that a kind of text provided in an embodiment of the present invention determines method;
Fig. 3 is the flow chart of determination the first intermediate character position and the first character number provided in an embodiment of the present invention;
Fig. 4 is the schematic diagram of a scenario of illustrative the first selected areas of determination provided in an embodiment of the present invention;
Fig. 5 is the flow chart in the first text selection of determination provided in an embodiment of the present invention region;
Fig. 6 is the flow chart of the second intermediate character of determination provided in an embodiment of the present invention position;
Fig. 7 is the schematic diagram of a scenario of illustrative the second selected areas of determination provided in an embodiment of the present invention;
Fig. 8 is the flow chart of the second character number of determination provided in an embodiment of the present invention;
Fig. 9 is the flow chart in the second text selection of determination provided in an embodiment of the present invention region;
Figure 10 is a kind of structural schematic diagram of terminal provided in an embodiment of the present invention.
Figure 11 is a kind of composed structure schematic diagram of terminal provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description.
Embodiment one
The embodiment of the present invention provides a kind of text and determines method, as shown in Figure 1, this method may include:
S101, gesture update event is obtained in current display text.
A kind of text provided in an embodiment of the present invention determines that method is realized under the scene for choosing text at the terminal.Eventually Display text content in the display interface is held, when user needs to operate content of text, terminal needs first to determine text This chosen area just can be carried out the operation of next step.Terminal will first be triggered when determining text selection region by gesture operation Text selection instruction, into text selection mode, then determines selected content of text, however, hand by gesture operation Gesture operation is characterized by gesture update event, thus, which, which needs first to obtain gesture in current display text, updates thing Part, only after terminal gets gesture update event, it is true that terminal just can be carried out a kind of text provided in an embodiment of the present invention Determine method.
It should be noted that being provided with touch screen in terminal in the embodiment of the present invention, terminal can be connect by touch screen Receive gesture update event.
The gesture update event acquired in current display text of terminal in the embodiment of the present invention, refers to that terminal is supervised The gesture operation on touch screen each time heard, i.e., when finger operates on the touchscreen each time, terminal can all be got Gesture update event.It should be noted that the gesture update event that terminal is acquired in current display text, can be one Or the operation such as click, sliding, long-pressing of multiple fingers, here, the embodiment of the present invention is with no restriction.
It should be noted that having included at least finger in current display text in gesture update event acquired in terminal The number of touch points in sheet, operation and finger touching display text of the finger in the touch points of current display text Time.
In the embodiment of the present invention, terminal triggers text selection instruction by gesture operation event, into text selection mode.
Optionally, the gesture operation event that terminal triggering text selection instructs in the embodiment of the present invention, can be in text The long press operation in region is also possible to the clicking operation on function button, the specific gesture behaviour for triggering text selection instruction Make event, can be configured according to practical application by user or research staff, this is not restricted for the embodiment of the present invention.
Terminal is set out text selection instruction by gesture operation event, and into after text selection mode, terminal can be with Two String localization symbols are shown in current display text, and the display position that current text chooses finger URL is determined as text Choose the initial position of symbol.
Optionally, text selection finger URL can be shown in the default location of currently display this paper, and default location is determined For the initial position of text selection symbol, which can be sets in advance;Text selection finger URL is also possible to The touch points of long press operation are shown, using the coordinate of touch points as the initial position of text selection finger URL.Specific text choosing The display mode of instruction fetch can be configured by user or research staff according to actual needs, and the embodiment of the present invention does not limit System.
In embodiments of the present invention, the initial position of above-mentioned two text selection finger URL can not be overlapped, and terminal can be with According to two text selection finger URLs, one default text selection region is set automatically in display text.Preferably, default text It can only include a character in this selection region.
Terminal in the embodiment of the present invention can be mobile terminal, such as smart phone, iPad, e-text reader etc. Electronic equipment with text display function, this is not restricted for the embodiment of the present invention.
S102, when gesture update event meets preset condition, acquire the first operating position information;Wherein, the default item Part is for characterizing gesture update event as text selection operation.
After terminal obtains gesture update event in current display text, the acquired gesture of terminal judgement updates thing Whether part meets preset condition, and when determining that gesture update event meets preset condition, terminal enters text selection operation, this When, terminal can acquire the first operating position, to carry out the processing of next step;When gesture update event is unsatisfactory for preset condition, Terminal does not enter text selection operation, continues waiting for gesture update event.
In embodiments of the present invention, preset condition can be the number of touch points of the finger in current display text.
It should be noted that in embodiments of the present invention, preset condition can be touching of the finger in current display text Touch number >=2 a little.
Illustratively, it is 2 that preset condition, which can be the number of touch points of the finger in current display text, that is, works as finger When the number of the touch points in current display text is 2, meet preset condition, is operated into text selection.
In embodiments of the present invention, when the gesture update event that terminal obtains meets preset condition, into text selection behaviour When making, terminal can collect the first operating position information.In the embodiment of the present invention, terminal will meet preset condition and hand The location information for referring to touch points when carrying out gesture operation to current display text for the first time, as the first operating position information.
Optionally, the location information of touch points of the finger in current display text can be finger in current display text The co-ordinate position information of touch points in sheet, alternatively, being also possible to indicate the other information of touch points position, such as grid information Deng this is not restricted for the embodiment of the present invention.
Illustratively, the first operating position information can be the coordinate position of touch points of the finger in current display text Information.Also, since the number of touch points of the finger in current display text can be 2, the first operative position confidence Breath can be the co-ordinate position information of two finger touch points in current display text, i.e. the first operating position information can be with It is the co-ordinate position information of two finger touch points.
S103, according to the first operating position information, determine the first intermediate character position and the first character number.
After terminal collects the first operating position information, terminal can determine one according to the first operating position information A first selected areas, and then according to the first selected areas, it is capable of determining that the first intermediate character position in the first selected areas It sets and the first character number of the first selected areas.
Specifically, terminal determines the first selected areas according to the first operating position information, it is to be shown according to finger currently The location information of touch points on text determines the first selected areas such as co-ordinate position information or grid information.
Illustratively, with the first operating position information be two finger touch points co-ordinate position information, to terminal according to First operating position information determines that the first selected areas is illustrated.When terminal gets the coordinate bit of two finger touch points When setting, using two pairs of coordinates as vertex, using the line of two pairs of coordinates as diagonal line, it is capable of determining that a rectangle region Domain, the region are the first selected areas.
Terminal needs to be further determined that among first according to the first selected areas after determining the first selected areas Character position and the first character number.
It should be noted that the first intermediate character position in the embodiment of the present invention, refers to being located at the first selected areas The character at center, the position in entire text, i.e., which character in text.The first character in the embodiment of the present invention Number refers to the character sum that text corresponding to the first selected areas is possessed.
Specifically, terminal after determining the first selected areas, can directly determine out the middle imago of the first selected areas Sum of all pixels in plain position and the first selected areas, and using the center pixel position of the first selected areas as imago in first Plain position, using the sum of all pixels in the first selected areas as the first pixel number;Terminal obtains the text word of current display text Number, and then it is capable of determining that the corresponding pixel number of text font size;Terminal determines the first middle word according to the first center pixel position Accord with position;Terminal determines the first character number according to the first pixel number pixel number corresponding with text font size.
It should be noted that terminal can use the text font size information that existing method obtains current display text, or Using the method that other can be realized this function, this is not restricted by the present invention.
Specifically, terminal is after determining the first center pixel position, it can be according to view application programming interface (Application Programming Interface, API) or the corresponding pixel number of text font size, are determined in first Between character position.
Specifically, terminal after determining the first pixel number, gets the text font size of current display text, and can be really Pixel number shared by each character of current text is made, in turn, terminal pixel according to shared by the first pixel number and each character Number, can determine the first character number.
S104, according to the first intermediate character position and the first character number, determine the first text selection region.
Terminal can first determine that the first text rises after determining the first intermediate character position and the first character number Beginning position, terminal determine the first text selection region further according to the first text initial position and the first character number.
It should be noted that the first text initial position, refers to first of text corresponding to the first selected areas Character, the position in entire text, i.e., which character in text.
Illustratively, the first text initial position, can be by the half of the first intermediate character position and the first character number To be determined.
Terminal is after determining the first text initial position, since terminal has had learned that the first text initial position at this time With the first character number, then the first text selection region is and originates since the first text initial position to the first text The sum of position and the first character number place terminate.
A kind of text provided in an embodiment of the present invention determines method, by when receive text selection instruction when, current Gesture update event is received in display text;When gesture update event meets preset condition, the first operating position information is acquired, Wherein, preset condition is for characterizing gesture update event as text selection operation;According to the first operating position information, first is determined Intermediate character position and the first character number;According to the first intermediate character position and the first character number, determine that the first text selects Take region.Using above-mentioned technical implementation way, when terminal judges that operating gesture meets preset condition, operated by two fingers quick It determines text selecting region, simplifies the process in text selecting region, improve the operating efficiency for choosing text.
Embodiment two
The embodiment of the invention provides a kind of texts to determine method, as shown in Fig. 2, this method may include:
S201, gesture update event is obtained in current display text.
It should be noted that S201 is consistent with the process description of S201 in embodiment one in the embodiment of the present invention, herein not It repeats again.
S202, when gesture update event meets preset condition, acquire the first operating position information;Wherein, the default item Part is for characterizing gesture update event as text selection operation.
It should be noted that S202 is consistent with the process description of S102 in embodiment one in the embodiment of the present invention, herein not It repeats again.
S203, according to the first operating position information, determine the first intermediate character position and the first character number.
It should be noted that S203 is consistent with the process description of S103 in embodiment one in the embodiment of the present invention, herein not It repeats again.
S204, the second operating position information of acquisition.
After determining the first intermediate character position and the first character number, terminal, which continues to get, meets preset condition Gesture update event when, terminal will acquire the second operating position information, and determine second according to the second operating position information Text selection region, using the second text selection region as the desired text selection region of end user.
It should be noted that the second operating position information of the embodiment of the present invention, refers to that terminal is determining the first text After this chosen area, the location information of touch points of the collected one or many fingers in current text.
Optionally, the location information of touch points of the finger in current display text can be finger in current display text The co-ordinate position information of touch points in sheet, alternatively, being also possible to indicate the other information of touch points position, such as grid information Deng this is not restricted for the embodiment of the present invention.
S205, according to the first operating position information and the second operating position information, determine the second intermediate character position.
Terminal acquires the second operating position information, can determine the second selected areas, since terminal is using more at this time Secondary gesture operation obtains the second text selection region, and therefore, the second intermediate character position of the second selected areas needs to pass through First operating position information and the second operating position information determine jointly.
It should be noted that the second intermediate character position in the embodiment of the present invention, refers to being located at the second selected areas The character at center, the position in entire text, i.e., which character in text.
Specifically, terminal defines the first selected areas, and according to the first selected areas according to the first operating position Domain defines the first center pixel position, at this point, terminal is it needs to be determined that the first diagonal distance midpoint;Terminal is according to the second behaviour Make location information, be capable of determining that the second selected areas, and according to the second selected areas, determines the second diagonal distance midpoint; In this way, terminal can determine the second diagonal distance midpoint according to the first diagonal distance midpoint and the second diagonal distance midpoint First diagonal distance midpoint how many distance are deviated from, and then just can determine that out that the first center pixel is deviateed in the second center pixel position Position is how many distance, due to the first center pixel position it is known that at this point, terminal is assured that out the second center pixel position; Terminal determines the second intermediate character position according to the second center pixel position.
Illustratively, with the second operating position information be two finger touch points co-ordinate position information, to terminal according to Second operating position information determines that the second selected areas is illustrated.When terminal gets the coordinate bit of two finger touch points When setting, using two pairs of coordinates as vertex, using the line of two pairs of coordinates as diagonal line, a rectangular area is determined, it should Region is the second selected areas.
First diagonal distance midpoint of the embodiment of the present invention, refers to cornerwise midpoint of the first selected areas, Second diagonal distance midpoint of the embodiment of the present invention, refers to cornerwise midpoint of the second selected areas.
Terminal, can be according to view API or the corresponding pixel of text font size after determining the second center pixel position Number, determines the second intermediate character position.
S206, according to the first operating position information, the second operating position information and the first character number, determine the second character Number.
Terminal is after determining the second intermediate character position, it is also necessary to determine the second character number, can just determine Two text selection regions.Since terminal is using multiple gesture operation to obtain the second text selection region, thus, the second character Number be not directly determined according to the second operating position, but be based on the first character number, and twice two fingers operation contracting Ratio is put to determine.
It should be noted that terminal is after collecting the second operating position information, it can be according to the second operative position confidence Breath determines the second selected areas, and the second character number is due character number in text corresponding to the second selected areas.
Specifically, terminal determines scaling according to the first operating position information and the second operating position information;Terminal According to scaling, processing is zoomed in and out to the first character number, and then determine the second character number.
Specifically, terminal can determine the first diagonal distance according to the first operating position information;According to the second operating position Information determines the second diagonal distance;The ratio between second diagonal distance and the first diagonal distance are determined as scaling.
S207, according to the second intermediate character position and the second character number, determine the second text selection region.
Terminal just can determine that out that the second text originates after determining the second intermediate character position and the second character number Position, terminal determine the second text selection region further according to the second text initial position and the second character number.
It should be noted that the second text initial position, refers to first of text corresponding to the second selected areas Character, the position in entire text, i.e., which character in text.
Illustratively, the second text initial position, can be by the half of the second intermediate character position and the second character number To be determined.
Terminal is after determining the second text initial position, the second text initial position and second as known to terminal at this time Character number, the second text selection region are since the second text initial position, to the second text initial position and the The sum of two character numbers place terminates.
A kind of text provided in an embodiment of the present invention determines method, by when receive text selection instruction when, current Gesture update event is received in display text;When gesture update event meets preset condition, the first operating position information is acquired, Wherein, preset condition is for characterizing gesture update event as text selection operation;According to the first operating position information, first is determined Intermediate character position and the first character number;According to the first intermediate character position and the first character number, determine that the first text selects Take region;After determining the first intermediate character position and the first character number, the second operating position information is acquired;According to first Operating position information and the second operating position information, determine the second intermediate character position;According to the first operating position information, second Operating position information and the first character number, determine the second character number;According to the second intermediate character position and the second character Number, determines the second text selection region.Using above-mentioned technical implementation way, terminal judges that operating gesture meets preset condition When, text selecting region is quickly determined by two fingers operation information, and quickly adjustment text choosing can be operated by multiple two fingers Region is selected, the process in text selecting region is simplified, improves the operating efficiency for choosing text.
Embodiment three
Based on the same inventive concept with embodiment one, the embodiment of the present invention provides a kind of text and determines method, this method May include:
S301, gesture update event is obtained in current display text.
S302, when gesture update event meets preset condition, acquire the first operating position information;Wherein, the default item Part is for characterizing gesture update event as text selection operation.
When gesture update event meets preset condition, terminal acquires the first operating position information.Specifically, in this implementation In example, the collected first operating position information of terminal is two fingers in the current coordinate bit confidence for showing upper touch points herein Breath.
Illustratively, the coordinate (x of the first operating position information two finger touch points collected for terminal1,y1) and (x2,y2)。
S303, according to the first operating position information, determine the first intermediate character position and the first character number.
After terminal collects the first operating position information, terminal can determine one according to the first operating position information A first selected areas, and then according to the first selected areas, it is capable of determining that the first intermediate character position in the first selected areas It sets and the first character number of the first selected areas.
Illustratively, terminal is getting a co-ordinate position information (x to finger touch points1,y1) and (x2,y2) after, The terminal can be according to (x1,y1) and (x2,y2) determine first selected areas an of rectangle, and determine that first chooses The first intermediate character position in region and the first character number.
It should be noted that the first intermediate character position in the embodiment of the present invention refers to being located at by the first operating position The character at the center of selected areas determined by information, the corresponding position in entire text, i.e., in the text which Character.The first character number in the embodiment of the present invention refers to the selected areas determined by the first operating position information In text possessed character sum.
Specifically, as shown in figure 3, a kind of text provided in an embodiment of the present invention determines that the S303 in method specifically can wrap It includes: S3031-S3035.It is as follows:
S3031, according to the first operating position information, determine the first selected areas.
Terminal collects two fingers in current display text after the coordinate of touch points, and terminal can be by two fingers The coordinate of touch points is as vertex, using the line of the touch points coordinate of two fingers as diagonal line, determines a rectangle region Domain, the region are the first selected areas.
Illustratively, as shown in figure 4, the coordinate of finger touch points 1 is (x1,y1), the coordinate of finger touch points 2 is (x2, y2), at this point, respectively with (x1,y1) and (x2,y2) it is used as vertex, with (x1,y1) and (x2,y2) line as diagonal line, terminal A rectangular area 1 can be determined in current display text, and using the rectangle selected areas as the first selected areas.
S3032, according to the first selected areas, determine the first center pixel position and the first pixel number.
Terminal can directly determine out the first center of the rectangular area after obtaining the first selected areas of rectangle Location of pixels and the first pixel number.
Illustratively, the first center pixel position that terminal is determined according to the first selected areas, can be the first selected areas The center pixel coordinate $ orgRangeCenter=(x, y) in domain;Correspondingly, terminal is according to the first of the determination of the first selected areas Pixel number is the sum of all pixels in the first selected areas.
S3033, the text font size for obtaining current display text, determine the corresponding pixel number of text font size.
Terminal obtains the font size of current display text after determining the first center pixel position and the first pixel number, and According to the corresponding relationship of font size and pixel number, pixel number corresponding to text font size is obtained.
It should be noted that the corresponding relationship of text font size and pixel number, can be pair of existing font size and pixel number It should be related to, this is not restricted for the embodiment of the present invention.
Illustratively, when text is shown with No. four words, pixel number corresponding to No. four words is 18, and terminal, which can determine, to be worked as The shared pixel number of the preceding each character of text is 18 × 18.
S3034, according to the first center pixel position, determine the first intermediate character position.
Terminal can determine the word positioned at the first selected areas center according to the center pixel position of the first selected areas Symbol corresponding position in entire text, that is, determine which character in text.
Optionally, in embodiments of the present invention, the center pixel position $ of the first selected areas known to terminal OrgRangeCenter=(x, y), at this point, terminal can determine the first intermediate character position $ according to view API OrgRangeCenterIndex can also determine the first intermediate character position $ according to the corresponding relationship of font size and pixel number OrgRangeCenterIndex, here, the embodiment of the present invention is with no restriction.
S3035, according to the first pixel number pixel number corresponding with text font size, determine the first character number.
Terminal can be determined shared by each character of current text after it there is known the corresponding pixel number of text font size First pixel number and pixel number shared by each character are then divided by by pixel number.In this way, terminal can obtain the first character Number $ orgRangeCount.
So far, terminal can determine the first intermediate character position and the first character according to the first operating position information Number.
S304, according to the first intermediate character position and the first character number, determine the first text selection region.
Terminal is capable of determining that the first text start bit behind known first intermediate character position and the first character number It sets, then, terminal can determine the first text selection region according to the first text initial position and the first character number.
Specifically, as shown in figure 5, a kind of text provided in an embodiment of the present invention determines that the S304 in method specifically can wrap : S3041-S3042 is included to realize.It is as follows:
S3041, according to the first intermediate character position and the first character number, determine the first text initial position.
It, can be according to the first intermediate character position after terminal determines the first intermediate character position and the first character number The first text initial position is directly determined out with the first character number.It should be noted that the first text in the embodiment of the present invention This initial position refers to the first character in the first text selection region.
Illustratively, the first text initial position $ orgRangeStart, can be calculated by following formula:
$ orgRangeStart=$ orgRangeCenterIndex- $ orgRangeCount/2
It should be noted that since the position of the first character of text is exactly 0, thus the first text initial position $ OrgRangeStart cannot be less than 0, if value of the $ orgRangeStart less than 0, $ orgRangeStart is directly assigned It is 0;If $ orgRangeStart exceeds text size, $ orgRangeStart=text size -1.
S3042, according to the first text initial position and the first character number, determine the first text selection region.
For terminal after having known the first text initial position and the first character number, terminal can directly determine out One text selection region.At this point, the first text selecting region is since the first text initial position, until the first text originates The sum of position and the first character number place terminate.
A kind of text provided in an embodiment of the present invention determines method, by when receive text selection instruction when, current Gesture update event is received in display text;When gesture update event meets preset condition, the first operating position information is acquired, Wherein, preset condition is for characterizing gesture update event as text selection operation;According to the first operating position information, first is determined Intermediate character position and the first character number;According to the first intermediate character position and the first character number, determine that the first text selects Take region.Using above-mentioned technical implementation way, when terminal judges that operating gesture meets preset condition, pass through two fingers operation information It quickly determines text selecting region, simplifies the process in text selecting region, improve the operating efficiency for choosing text.
Example IV
Based on the same inventive concept with embodiment two, the embodiment of the present invention provides a kind of text and determines method, this method May include:
S401, gesture update event is received in current display text.
It should be noted that S401 is consistent with the process description of S301 in embodiment three in the embodiment of the present invention, herein not It repeats again.
S402, when gesture update event meets preset condition, acquire the first operating position information;Wherein, the default item Part is for characterizing gesture update event as text selection operation.
It should be noted that S402 is consistent with the process description of S302 in embodiment three in the embodiment of the present invention, herein not It repeats again.
S403, according to the first operating position information, determine the first intermediate character position and the first character number.
It should be noted that S403 is consistent with the process description of S303 in embodiment three in the embodiment of the present invention, herein not It repeats again.
S404, the second operating position information of acquisition.
In the embodiment of the present invention, when terminal continues to get the gesture update event for meeting preset condition, terminal will be acquired Second operating position information.Correspondingly, the second operating position information is the seat of two finger touch points in current display text Mark.
Illustratively, the coordinate position of the touch points of the second operating position information two fingers collected for terminal (x'1,y'1) and (x'2,y'2)。
S405, according to the first operating position information and the second operating position information, determine the second intermediate character position.
Terminal acquires the second operating position information, is capable of determining that the second selected areas, since terminal is using more at this time Secondary gesture operation obtains the second text selection region, and therefore, the second intermediate character position of the second selected areas needs to pass through First operating position information and the second operating position information determine jointly.
Illustratively, in the embodiment of the present invention, the second intermediate character position refers to being located at by (x'1,y'1) and (x'2, y'2) determined by selected areas center character, the corresponding position in entire text, i.e., in the text which Character.
Specifically, as shown in fig. 6, a kind of text provided in an embodiment of the present invention determines that the S405 in method specifically can wrap It includes:
S4051, according to the first operating position, determine the first selected areas.
Terminal is according to the first operating position information, i.e. the coordinate of terminal touch points of collected two fingers for the first time, and Using the coordinate as vertex, the line of coordinate determines the first selected areas as diagonal line.
Illustratively, as shown in fig. 7, the coordinate of finger touch points 1 is (x1,y1), the coordinate of finger touch points 2 is (x2, y2), at this point, respectively with (x1,y1) and (x2,y2) it is used as vertex, with (x1,y1) and (x2,y2) line as diagonal line, terminal It can determine that a rectangular area 1, the region are the first selected areas in current display text.
S4052, according to the first selected areas, determine the first center pixel position and the first diagonal distance midpoint.
After terminal determines the first selected areas, the center pixel position of the first selected areas can be directly determined out, i.e., The midpoint of the diagonal distance of first center pixel position and the first selected areas, i.e. the first diagonal distance midpoint.
Terminal determines the first center pixel position $ orgRangeCenter=(x, y) of the first selected areas and first couple Angular distance midpoint $ orgCenter.
Specifically, the first center pixel position orgRangeCenter=(x, y) can be directly determined, first pair of angular distance From midpoint $ orgCenter, then can determine according to the following formula:
$ orgCenter=((x1+x2)/2,(y1+y2)/2)。
S4053, according to the second operating position information, determine the second selected areas.
Terminal is according to the second operating position information, i.e. touching of the terminal in two fingers of collected multiple gesture operation The coordinate of point, and using the coordinate as vertex, the line of coordinate determines the first selected areas as diagonal line.
Illustratively, after determining the first selected areas, as shown in fig. 7, in current display text, finger touching The coordinate of point 1 ' is (x'1,y'1), the coordinate of finger touch points 2 ' is (x'2,y'2), terminal is respectively with (x'1,y'1) and (x'2, y'2) it is used as vertex, with (x'1,y'1) and (x'2,y'2) line as diagonal line, terminal can be in current display text really A rectangular area 2 is made, which is to determine the second selected areas.
S4054, according to the second selected areas, determine the second diagonal distance midpoint.
Terminal can directly determine out the diagonal distance midpoint of the selected areas after determining the second selected areas, i.e., and Two diagonal distance midpoints.
Illustratively, the second diagonal distance midpoint is $ newCenter=((x1'+x'2)/2,(y1'+y'2)/2)。
S4055, according to the first diagonal distance midpoint and the second diagonal distance midpoint, determine the second center pixel position.
Specifically, terminal can determine the offset between the second diagonal distance midpoint and the first diagonal distance midpoint For center position offset;Terminal determines the second center pixel according to center position offsets and the first center pixel position Position.
Illustratively, center position offsets can be expressed as $ newCenter- $ orgCenter, correspondingly, in second Heart location of pixels newRangeCenter=(x', y'), can be calculated according to the following formula:
$ newRangeCenter=$ orgRangeCenter+ ($ newCenter- $ orgCenter).
S4056, according to the second center pixel position, determine the second intermediate character position.
Terminal can determine the word positioned at the second selected areas center according to the center pixel position of the second selected areas Corresponding position in the text is accorded with, that is, which character in text determined.
Optionally, in embodiments of the present invention, the center pixel position $ of the second selected areas known to terminal NewRangeCenter=(x', y'), at this point, terminal can determine the second intermediate character position $ according to view API NewRangeCenterIndex can also determine the second intermediate character position $ according to the corresponding relationship of font size and pixel number NewRangeCenterIndex, here, the embodiment of the present invention is with no restriction.
So far, terminal can be determined among second according to the first operating position information and the second operating position information Character position.
S406, according to the first operating position information, the second operating position information and the first character number, determine the second character Number.
The second character number in the embodiment of the present invention refers to the selected areas determined by the second operating position information The due character sum of text institute in domain.
Illustratively, as shown in figure 8, a kind of text provided in an embodiment of the present invention determines that the S406 in method specifically can be with It include: S4061-S4062.It is as follows:
S4061, according to the first operating position information and the second operating position information, determine scaling.
Specifically, terminal can determine the first diagonal distance according to the first operating position information;According to the second operating position Information determines the second diagonal distance;The ratio between second diagonal distance and the first diagonal distance are determined as scaling.
Illustratively, terminal is after known first operating position information, so that it may determine the first diagonal distance
Correspondingly, terminal can also determine the second diagonal distance after known second operating position information
Correspondingly, scaling is are as follows:
$ rate=$ distance/ $ orgDistance.
S4062, according to scaling, processing is zoomed in and out to the first character number, determines the second character number.
Since terminal is using multiple gesture operation to obtain the second text selection region, thus, the second character number is simultaneously It is directly determined not according to the second operating position, but is based on the first character number, and the scaling of two fingers operation twice To determine.
Specifically, the second character number can be determined by following formula:
$ newRangeCount=$ orgRangeCount × $ rate
So far, terminal can be according to the first operating position information, the second operating position information and the first character number, really Make the second character number.
S407, according to the second intermediate character position and the second character number, determine the second text selection region.
It should be noted that the second text selection region refers in the region determined by the second operating position information Content of text.
Specifically, as shown in figure 9, a kind of text provided in an embodiment of the present invention determines that the S407 in method specifically can wrap It includes: S4071-S4072.It is as follows:
S4071, according to the second intermediate character position and the second character number, determine the second text initial position.
It, can be according to the second intermediate character position after terminal determines the second intermediate character position and the second character number The second text initial position is directly determined out with the second character number.It should be noted that the second text in the embodiment of the present invention This initial position refers to second character in the second text selection region
Illustratively, the second text initial position $ newRangeStart, can be calculated by following formula:
$ newRangeStart=$ newRangeCenterIndex- $ newRangeCount/2
It should be noted that since the position of the first character of text is exactly 0, thus the first text initial position $ NewRangeStart cannot be less than 0, if value of the $ newRangeStart less than 0, $ newRangeStart is directly assigned It is 0;If $ newRangeStart exceeds text size, $ newRangeStart=text size -1.
S4072, according to the second text initial position and the second character number, determine the second text selection region.
After the second text initial position known to terminal and the second character number, the second text selection region can be direct It is determined, at this point, the second text selection region is since the second text initial position, until the second text initial position Terminate with the sum of the second character number place.
A kind of text provided in an embodiment of the present invention determines method, by when receive text selection instruction when, current Gesture update event is received in display text;When gesture update event meets preset condition, the first operating position information is acquired, Wherein, preset condition is for characterizing gesture update event as text selection operation;According to the first operating position information, first is determined Intermediate character position and the first character number;According to the first intermediate character position and the first character number, determine that the first text selects Take region;After determining the first text selection region, the second operating position information is acquired;According to the first operating position information with Second operating position information determines the second intermediate character position;According to the first operating position information, the second operating position information with First character number determines the second character number;According to the second intermediate character position and the second character number, the second text is determined Chosen area.Using above-mentioned technical implementation way, when terminal judges that operating gesture meets preset condition, is operated and believed by two fingers Breath quickly determines text selecting region, and quickly adjustment text selecting region can be operated by multiple two fingers, simplifies text The process of selection region improves the operating efficiency for choosing text.
Embodiment five
As shown in Figure 10, the embodiment of the invention provides a kind of terminal 1, which may include:
Acquiring unit 10, for obtaining gesture update event in current display text.
Acquisition unit 11, for acquiring the first operating position information when gesture update event meets preset condition;Its In, the preset condition is for characterizing gesture update event as text selection operation.
Determination unit 12, for determining the first intermediate character position and the first character according to the first operating position information Number;And according to the first intermediate character position and the first character number, determine the first text selection region.
Optionally, the acquisition unit is also used to after first intermediate character of determination and the first character number, adopts Collect the second operating position information.
The determination unit is also used to according to the first operating position information and the second operating position information, really Fixed second intermediate character position;And according to second intermediate character position and second character number, determine the second text This chosen area.
Optionally, the acquiring unit is also used to obtain the text font size of current display text;
The determination unit is specifically used for determining the first selected areas according to the first operating position information;According to One selected areas determines the first center pixel position and the first pixel number;Determine the corresponding pixel number of the text font size;According to First center pixel position determines first intermediate character position;And according to first pixel number and the text The corresponding pixel number of this font size determines first character number.
Optionally, the determination unit is specifically used for determining the first selected areas according to the first operating position information Domain;According to the first selected areas, the first center pixel position and the first diagonal distance midpoint are determined;According to second operative position Confidence breath, determines the second selected areas;According to the second selected areas, the second diagonal distance midpoint is determined;According to described first pair Angular distance midpoint and second diagonal distance midpoint, determine the second center pixel position;According to second center pixel Position determines second intermediate character position.
Optionally, the determination unit is used for second diagonal distance midpoint and first diagonal distance midpoint Between offset, be determined as center position offsets;According to the center position offsets and first center pixel position It sets, determines the second center pixel position.
Optionally, the determination unit is specifically used for according to the first operating position information and second operative position Confidence breath, determines scaling;And according to the scaling, processing is zoomed in and out to first character number, is determined Second character number out.
Optionally, the determination unit is specifically used for determining first pair of angular distance according to the first operating position information From;According to the second operating position information, the second diagonal distance is determined;And by second diagonal distance and described first The ratio between diagonal distance is determined as scaling.
Optionally, the determination unit is used for according to second intermediate character position and second character number, really Fixed second text initial position;According to second text initial position and second character number, second text is determined This chosen area.
Embodiment six
Same inventive concept based on embodiment one to example IV, Figure 11 are a kind of terminal that the embodiment of the present invention proposes Composed structure schematic diagram, as shown in figure 11, terminal proposed by the present invention may include processor 01, be stored with processor 01 can The memory 02 executed instruction.Wherein, processor 01 is used to execute the executable text maninulation instruction stored in memory, with reality Method of the current embodiment one into any of example IV or multiple embodiments.
In an embodiment of the present invention, above-mentioned processor 01 can be application-specific IC (Application Specific Integrated Circuit, ASIC), digital signal processor (Digital Signal Processor, DSP), digital signal processing device (Digital Signal Processing Device, DSPD), programmable logic device (ProgRAMmable Logic Device, PLD), field programmable gate array (Field ProgRAMmable Gate Array, FPGA), CPU, controller, at least one of microcontroller, microprocessor.It is to be appreciated that being set for different It is standby, can also be to be other for realizing the electronic device of above-mentioned processor function, the embodiment of the present invention is not especially limited.The end End further includes memory 02, which can connect with processor 01, wherein memory 02 may be deposited comprising high-speed RAM Reservoir, it is also possible to further include nonvolatile memory, for example, at least two magnetic disk storages.
In practical applications, above-mentioned memory 02 can be volatile memory (volatile memory), such as at random It accesses memory (Random-Access Memory, RAM);Or nonvolatile memory (non-volatile memory), Such as read-only memory (Read-Only Memory, ROM), flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid state hard disk (Solid-State Drive, SSD);Or the combination of the memory of mentioned kind, and to place It manages device 01 and instruction and data is provided.
In addition, each functional module in the present embodiment can integrate in one processing unit, it is also possible to each list Member physically exists alone, and can also be integrated in one unit with two or more units.Above-mentioned integrated unit both can be with Using formal implementation of hardware, can also be realized in the form of software function module.
If integrated unit realizes that being not intended as independent product is sold or made in the form of software function module Used time can store in a computer readable storage medium, based on this understanding, the technical solution sheet of the present embodiment The all or part of the part that contributes to existing technology or the technical solution can be with software product in other words in matter Form embodies, which is stored in a storage medium, including some instructions are used so that a meter It calculates machine equipment (can be personal computer, server or the network equipment etc.) or processor (processor) executes this implementation The all or part of the steps of example method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. is various to deposit Store up the medium of program code.
The embodiment of the present invention provides a kind of computer readable storage medium, is stored thereon with achievable program, is applied to eventually In end, such as side of the embodiment one into example IV in any one or more embodiments is realized when which is executed by processor Method.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program Product.Therefore, the shape of hardware embodiment, software implementation or embodiment combining software and hardware aspects can be used in the present invention Formula.Moreover, the present invention, which can be used, can use storage in the computer that one or more wherein includes computer usable program code The form for the computer program product implemented on medium (including but not limited to magnetic disk storage and optical memory etc.).
The present invention be referring to according to the method for the embodiment of the present invention, the realization of equipment (system) and computer program product Flow diagram and/or block diagram describe.It should be understood that flow diagram and/or box can be realized by computer program instructions The combination of each flow and/or block in figure and the process in implementation process schematic diagram and/or block diagram and/or box. These computer program instructions be can provide to general purpose computer, special purpose computer, Embedded Processor or other programmable datas The processor of processing equipment is to generate a machine, so that passing through computer or the processor of other programmable data processing devices The instruction of execution generate for realizing in one box of implementation process schematic diagram one process or multiple processes and/or block diagrams or The device for the function of being specified in multiple boxes.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, The manufacture of device is enabled, which realizes in implementation process schematic diagram one process or multiple processes and/or block diagrams one The function of being specified in a box or multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction that is executed on other programmable devices provide for realizing in one process of implementation process schematic diagram or multiple processes and/or The step of function of being specified in one or more blocks of the block diagram.
The foregoing is only a preferred embodiment of the present invention, is not intended to limit the scope of the present invention.

Claims (20)

1. a kind of text determines method, which is characterized in that the described method includes:
Gesture update event is obtained in current display text;
When the gesture update event meets preset condition, the first operating position information is acquired;Wherein, the preset condition is used It is that text selection operates in characterization gesture update event;
According to the first operating position information, the first intermediate character position and the first character number are determined;
According to first intermediate character position and first character number, the first text selection region is determined.
2. the method according to claim 1, wherein in first intermediate character of determination and the first character number Later, the method also includes:
Acquire the second operating position information;
According to the first operating position information and the second operating position information, the second intermediate character position is determined;
According to the first operating position information, the second operating position information and first character number, second is determined Character number;
According to second intermediate character position and second character number, the second text selection region is determined.
3. determining the method according to claim 1, wherein described according to the first operating position information One intermediate character position and the first character number, comprising:
According to the first operating position information, the first selected areas is determined;
According to the first selected areas, the first center pixel position and the first pixel number are determined;
The text font size for obtaining the current display text determines the corresponding pixel number of the text font size;
According to first center pixel position, first intermediate character position is determined;
According to first pixel number pixel number corresponding with the text font size, first character number is determined.
4. the method according to claim 1, wherein described according to first intermediate character position and described the One character number determines the first text selection region, comprising:
According to first intermediate character position and first character number, the first text initial position is determined;
According to first text initial position and first character number, first text selection region is determined.
5. according to the method described in claim 2, it is characterized in that, described grasp according to first operating position with described second Make location information, determine the second intermediate character position, comprising:
According to the first operating position information, the first selected areas is determined;
According to the first selected areas, the first center pixel position and the first diagonal distance midpoint are determined;
According to the second operating position information, the second selected areas is determined;
According to the second selected areas, the second diagonal distance midpoint is determined;
According to first diagonal distance midpoint and second diagonal distance midpoint, the second center pixel position is determined;
According to second center pixel position, second intermediate character position is determined.
6. according to the method described in claim 5, it is characterized in that, described according to first diagonal distance midpoint and described Determine the second center pixel position in two diagonal distance midpoints, comprising:
By the offset between second diagonal distance midpoint and first diagonal distance midpoint, it is inclined to be determined as center Shifting amount;
According to the center position offsets and first center pixel position, the second center pixel position is determined.
7. according to the method described in claim 2, it is characterized in that, it is described according to the first operating position information, described Two operating position information and first character number, determine the second character number, comprising:
According to the first operating position information and the second operating position information, scaling is determined;
According to the scaling, processing is zoomed in and out to first character number, determines the second character number.
8. the method according to the description of claim 7 is characterized in that described according to the first operating position information and described the Two operating position information, determine scaling, comprising:
According to the first operating position information, the first diagonal distance is determined;
According to the second operating position information, the second diagonal distance is determined;
The ratio between second diagonal distance and first diagonal distance are determined as scaling.
9. according to the method described in claim 2, it is characterized in that, described according to second intermediate character position and described the Two character numbers determine the second text selection region, comprising:
According to second intermediate character position and second character number, the second text initial position is determined;
According to second text initial position and second character number, second text selection region is determined.
10. a kind of terminal, which is characterized in that the terminal includes:
Acquiring unit, for obtaining gesture update event in current display text;
Acquisition unit, for acquiring the first operating position information when the gesture update event meets preset condition;Wherein, The preset condition is for characterizing gesture update event as text selection operation;
Determination unit, for determining the first intermediate character position and the first character number according to the first operating position information; And according to first intermediate character position and first character number, determine the first text selection region.
11. terminal according to claim 10, which is characterized in that
The acquisition unit is also used to after first intermediate character of determination and the first character number, the second operation of acquisition Location information;
The determination unit is also used to determine according to the first operating position information and the second operating position information Two intermediate character positions;And according to second intermediate character position and second character number, determine that the second text selects Take region.
12. terminal according to claim 10, which is characterized in that
The acquiring unit is also used to obtain the text font size of current display text;
The determination unit is specifically used for determining the first selected areas according to the first operating position information;According to the first choosing Middle region determines the first center pixel position and the first pixel number;Determine the corresponding pixel number of the text font size;According to described First center pixel position determines first intermediate character position;And according to first pixel number and the text word Number corresponding pixel number, determines first character number.
13. terminal according to claim 10, which is characterized in that
The determination unit is specifically used for determining first according to first intermediate character position and first character number Text initial position;According to first text initial position and first character number, first text selection is determined Region.
14. terminal according to claim 11, which is characterized in that
The determination unit is specifically used for determining the first selected areas according to the first operating position information;According to the first choosing Middle region determines the first center pixel position and the first diagonal distance midpoint;According to the second operating position information, is determined Two selected areas;According to the second selected areas, the second diagonal distance midpoint is determined;According to first diagonal distance midpoint and institute The second diagonal distance midpoint is stated, determines the second center pixel position;According to second center pixel position, described is determined Two intermediate character positions.
15. terminal according to claim 14, which is characterized in that
The determination unit, for by the offset between second diagonal distance midpoint and first diagonal distance midpoint Amount, is determined as center position offsets;According to the center position offsets and first center pixel position, is determined Two center pixel positions.
16. terminal according to claim 11, which is characterized in that
The determination unit is specifically used for being determined according to the first operating position information and the second operating position information Scaling;And according to the scaling, processing is zoomed in and out to first character number, determines the second character Number.
17. terminal according to claim 16, which is characterized in that
The determination unit is specifically used for determining the first diagonal distance according to the first operating position information;According to described Two operating position information, determine the second diagonal distance;And by the ratio between second diagonal distance and first diagonal distance It is determined as scaling.
18. terminal according to claim 11, which is characterized in that
The determination unit, for determining the second text according to second intermediate character position and second character number Initial position;According to second text initial position and second character number, second text selection region is determined.
19. a kind of terminal characterized by comprising memory and processor;
The memory, for storing executable text maninulation instruction;
The processor realizes claim 1 to 9 for executing the executable text maninulation stored in the memory instruction Described in any item methods.
20. a kind of computer readable storage medium, which is characterized in that be stored with executable text maninulation instruction, locate for causing When managing device execution, the described in any item methods of claim 1 to 9 are realized.
CN201811629788.7A 2018-12-28 2018-12-28 Text determination method, terminal and computer readable storage medium Active CN109683798B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811629788.7A CN109683798B (en) 2018-12-28 2018-12-28 Text determination method, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811629788.7A CN109683798B (en) 2018-12-28 2018-12-28 Text determination method, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109683798A true CN109683798A (en) 2019-04-26
CN109683798B CN109683798B (en) 2021-10-29

Family

ID=66190142

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811629788.7A Active CN109683798B (en) 2018-12-28 2018-12-28 Text determination method, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109683798B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112987994A (en) * 2021-03-31 2021-06-18 维沃移动通信有限公司 Frame selection annotation method, frame selection annotation device, electronic equipment and storage medium
CN114265525A (en) * 2021-12-27 2022-04-01 咪咕数字传媒有限公司 Text selection method and device, electronic equipment and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070229471A1 (en) * 2006-03-30 2007-10-04 Lg Electronics Inc. Terminal and method for selecting displayed items
CN102654821A (en) * 2011-03-04 2012-09-05 腾讯科技(深圳)有限公司 Method and device for locating text cursor
CN106020694A (en) * 2016-05-24 2016-10-12 北京京东尚科信息技术有限公司 Electronic device, selected area dynamic adjusting method and device
CN106648379A (en) * 2017-01-17 2017-05-10 维沃移动通信有限公司 Method and device for selecting text area
CN107066167A (en) * 2016-09-27 2017-08-18 华为技术有限公司 A kind of regional selection method, device and graphic user interface
KR20170133776A (en) * 2016-05-26 2017-12-06 주식회사 한글과컴퓨터 Processing method based on multi-touch of terminal and device thereof

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070229471A1 (en) * 2006-03-30 2007-10-04 Lg Electronics Inc. Terminal and method for selecting displayed items
CN102654821A (en) * 2011-03-04 2012-09-05 腾讯科技(深圳)有限公司 Method and device for locating text cursor
CN106020694A (en) * 2016-05-24 2016-10-12 北京京东尚科信息技术有限公司 Electronic device, selected area dynamic adjusting method and device
KR20170133776A (en) * 2016-05-26 2017-12-06 주식회사 한글과컴퓨터 Processing method based on multi-touch of terminal and device thereof
CN107066167A (en) * 2016-09-27 2017-08-18 华为技术有限公司 A kind of regional selection method, device and graphic user interface
CN106648379A (en) * 2017-01-17 2017-05-10 维沃移动通信有限公司 Method and device for selecting text area

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112987994A (en) * 2021-03-31 2021-06-18 维沃移动通信有限公司 Frame selection annotation method, frame selection annotation device, electronic equipment and storage medium
CN114265525A (en) * 2021-12-27 2022-04-01 咪咕数字传媒有限公司 Text selection method and device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN109683798B (en) 2021-10-29

Similar Documents

Publication Publication Date Title
US10664510B1 (en) Displaying clusters of media items on a map using representative media items
CN103605804B (en) A kind of method and system being ranked up to desktop object
US8830184B2 (en) Image displaying device, image displaying method, and program for displaying images
CN101388041B (en) Browsers page navigation method and system for handhold terminal
CN105959564B (en) A kind of photographic method and mobile terminal
CN109508093A (en) A kind of virtual reality exchange method and device
US20150215245A1 (en) User interface for graphical representation of and interaction with electronic messages
US11604580B2 (en) Configuration of application execution spaces and sub-spaces for sharing data on a mobile touch screen device
CN108064368A (en) The control method and device of flexible display device
CN107659837B (en) A kind of multi-medium data control method for playing back and mobile terminal
TW201112074A (en) Touch gesture detecting method of a touch panel
CN104991696B (en) A kind of information processing method and electronic equipment
CN107704157B (en) Multi-screen interface operation method and device and storage medium
KR20120107109A (en) Method and mobile terminal for processing contacts
CN104035666A (en) Device, method, and graphical user interface with content display modes and display rotation heuristics
CN105630275B (en) desktop display system and method
CN110428499A (en) The method of three-dimensional live map is superimposed on two-dimensional surface map
WO2014121626A1 (en) Displaying method, device and storage medium of mobile terminal shortcuts
CN104820619B (en) A kind of application programe switch-over method and device of mobile terminal
CN109542278B (en) Touch data processing method and device and touch equipment
CN105824553A (en) Touch method and mobile terminal
CN105426067A (en) Desktop icon replacement method and apparatus
CN109683798A (en) A kind of text determines method, terminal and computer readable storage medium
CN107222737B (en) A kind of processing method and mobile terminal of depth image data
CN108491152B (en) Touch screen terminal control method, terminal and medium based on virtual cursor

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant