CN115220582A - Text input method, equipment, device and storage medium for supporting backspace input method - Google Patents
Text input method, equipment, device and storage medium for supporting backspace input method Download PDFInfo
- Publication number
- CN115220582A CN115220582A CN202210856978.2A CN202210856978A CN115220582A CN 115220582 A CN115220582 A CN 115220582A CN 202210856978 A CN202210856978 A CN 202210856978A CN 115220582 A CN115220582 A CN 115220582A
- Authority
- CN
- China
- Prior art keywords
- character
- type
- input
- backspace
- historical
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/02—Input arrangements using manually operated switches, e.g. using keyboards or dials
- G06F3/023—Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
- G06F3/0233—Character input methods
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
- Input From Keyboards Or The Like (AREA)
Abstract
本发明实施例提供支持退格输入法的文本输入方法、设备、装置和存储介质,涉及文本输入技术领域。其中,这种文本输入方法包含:S1、获取文本输入框的当前输入字符。其中,文本输入框为纯数字输入框。S2、判断当前输入字符的类型。其中,类型包括数字型、退格型和其它字符型。S3、当判断到当前输入字符的类型为退格型时,获取历史输入字符,并判断历史输入字符的类型。其中,历史输入字符为前一次输入的字符。S6、当判断到历史输入字符的类型为其他字符型时,将当前输入字符置为空值。能够有效的避免退格输入法因为特定情况产生的退格对文本输入框内的文字进行删除的情况,避免了有效信息丢失的问题。
Embodiments of the present invention provide a text input method, device, device and storage medium supporting the backspace input method, and relate to the technical field of text input. Wherein, the text input method includes: S1. Obtain the current input character of the text input box. Among them, the text input box is a pure number input box. S2. Determine the type of the current input character. Among them, types include numeric, backspace, and other character types. S3. When it is determined that the type of the current input character is the backspace type, the historical input character is obtained, and the type of the historical input character is determined. Among them, the historical input character is the character inputted last time. S6. When it is determined that the type of the historical input character is other character type, the current input character is set to a null value. The backspace input method can effectively avoid the situation that the text in the text input box is deleted due to the backspace generated by the backspace input method, and the problem of loss of effective information is avoided.
Description
技术领域technical field
本发明涉及文本输入技术领域,具体而言,涉及一种支持退格输入法的文本输入方法、设备、装置和存储介质。The present invention relates to the technical field of text input, and in particular, to a text input method, device, device and storage medium supporting a backspace input method.
背景技术Background technique
在一些软件的文本输入框中,有时会设置成仅允许特定类型的字符输入,如对于电子秤管理软件中的部分字段是仅由数字组成的。例如:货号、保质期时长等,这是行业中的习惯。为了防呆,秤管理软件一般会对这样的文本输入框做输入限制预防用户输入除数字以外的字符。In some software text input boxes, it is sometimes set to allow only certain types of characters to be input, for example, some fields in electronic scale management software are only composed of numbers. For example: item number, shelf life, etc. This is a habit in the industry. In order to prevent fools, the scale management software generally restricts the input of such a text input box to prevent the user from entering characters other than numbers.
在先技术中,对只允许输入数字的文本输入框的处理方式是:在键盘键入值的时候判断,当前键入值是否是数字或退格,如果不是就将键入的值置为#0(即:空字符),从而实现只允许输入数字的功能。然而,在先技术在面对那些会产生回删键的输入法时存在有效信息丢失的风险。In the prior art, the processing method for a text input box that only allows input of numbers is: when a value is input on the keyboard, it is judged whether the current input value is a number or a backspace, and if not, the input value is set to #0 (that is, : Null character), thus realizing the function of allowing only numbers to be entered. However, the prior art has the risk of losing valid information when faced with input methods that generate a delete key.
以越南字符为例,越南的字母除了常知的A至Z,还引用了5种声调来表示。如a字母就有多种声调:等。越南常用的输入法工具是unikey,在输入这些带有特殊声调的字母,通过组合键的模式来完成。如输入是通过按两下a来实现。又如输入字母是通过按下字母a与w来实现。Taking Vietnamese characters as an example, in addition to the commonly known A to Z, Vietnamese letters also refer to 5 tones to represent. For example, the letter a has multiple tones: Wait. The commonly used input method tool in Vietnam is unikey. When entering these letters with special tones, the key combination mode is used to complete them. as input This is done by pressing a twice. like typing letters This is done by pressing the letters a and w.
虽然表面上看上去,unikey就像拼音一样,组合字母后打出对应的值。但是实际上unikey在输入字母的时候,如其原理是,第一次按下a时,输入法输出a字符的键值(即:在文本框中输入a);第二次按下a时,输入法先输出退格字符(backspace)的键值(即:将文本框中的a删除),然后再输出字符的键值(即:在文本框中输入)。Although on the surface, unikey is like pinyin, and the corresponding value is typed after combining letters. But in fact, when unikey is entering letters, such as The principle is that when you press a for the first time, the input method outputs the key value of the character a (ie: enter a in the text box); when you press a for the second time, the input method outputs the backspace character first. Key value (ie: delete a in the text box), and then output The key value of the character (ie: type in the text box ).
现有的秤管理工具在使用Unikey输入法输入时,在只允许输入数字的字段中误输入带声调的字母时产生错误值,导致正常输入的数字被删除。例如:在123之后输入按两下a(即:误输入),这个过程中Unikey输入法会文本输入框输入三个ASCII编码:#97(即:a)、#8(即:退格)和#226(即:)。其中,#97和#226因为不属于数字和退格,会被置为空值不产生输入动作,而#8会产生退格动作而将之前正常输入的123中的3删除。When the existing scale management tool uses the Unikey input method for input, the wrong value is generated when a letter with a tone is entered by mistake in a field that only allows input of numbers, resulting in the deletion of the normally input number. For example: enter after 123 and press a twice (ie: wrong input ), in this process, the Unikey input method will input three ASCII codes in the text input box: #97 (ie: a), #8 (ie: backspace) and #226 (ie: ). Among them, #97 and #226 will be set to null because they do not belong to numbers and backspace, and will not generate input action, while #8 will generate backspace action and delete 3 in 123 that was normally input before.
有鉴于此,申请人在研究了现有的技术后特提出本申请。In view of this, the applicant hereby proposes the present application after studying the prior art.
发明内容SUMMARY OF THE INVENTION
本发明提供了一种支持退格输入法的文本输入方法、设备、装置和存储介质,以改善上述技术问题中的至少一个。The present invention provides a text input method, device, device and storage medium supporting the backspace input method, so as to improve at least one of the above technical problems.
第一方面、first,
本发明实施例提供了一种支持退格输入法的文本输入方法,其包含步骤S1、S2、S3和S6。The embodiment of the present invention provides a text input method supporting the backspace input method, which includes steps S1, S2, S3 and S6.
S1、获取文本输入框的当前输入字符;其中,所述文本输入框为纯数字输入框;S1, obtain the current input character of the text input box; wherein, the text input box is a pure digital input box;
S2、判断所述当前输入字符的类型;其中,所述类型包括数字型、退格型和其它字符型;S2, determine the type of the current input character; wherein, the type includes a number type, a backspace type and other character types;
S3、当判断到所述当前输入字符的类型为退格型时,获取历史输入字符,并判断所述历史输入字符的类型;其中,所述历史输入字符为前一次输入的字符;S3, when judging that the type of the current input character is a backspace type, obtain the historical input character, and judge the type of the historical input character; wherein, the historical input character is the previous input character;
S6、当判断到所述历史输入字符的类型为其他字符型时,将当前输入字符置为空值。S6. When it is determined that the type of the historical input character is another character type, set the current input character to a null value.
第二方面、Second,
本发明实施例提供了一种支持退格输入法的文本输入装置,其包含:An embodiment of the present invention provides a text input device supporting a backspace input method, which includes:
输入获取模块,用于获取文本输入框的当前输入字符;其中,所述文本输入框为纯数字输入框;an input acquisition module for acquiring the current input characters of a text input box; wherein, the text input box is a pure digital input box;
第一判断模块,用于判断所述当前输入字符的类型;其中,所述类型包括数字型、退格型和其它字符型;The first judgment module is used for judging the type of the current input character; wherein, the type includes a number type, a backspace type and other character types;
第二判断模块,用于当判断到所述当前输入字符的类型为退格型时,获取历史输入字符,并判断所述历史输入字符的类型;其中,所述历史输入字符为前一次输入的字符;The second judging module is configured to obtain historical input characters when it is judged that the type of the current input character is backspace type, and judge the type of the historical input character; wherein, the historical input character is the previous input character character;
第一执行模块,用于当判断到所述历史输入字符的类型为其他字符型时,将当前输入字符置为空值。The first execution module is configured to set the current input character to a null value when it is determined that the type of the historical input character is another character type.
第三方面、The third aspect,
本发明实施例提供了一种支持退格输入法的文本输入设备,其包括处理器、存储器,以及存储在所述存储器内的计算机程序;所述计算机程序能够被所述处理器执行,以实现如第一方面任意一段所说的支持退格输入法的文本输入方法。An embodiment of the present invention provides a text input device supporting a backspace input method, which includes a processor, a memory, and a computer program stored in the memory; the computer program can be executed by the processor to achieve A text input method that supports the backspace input method as described in any paragraph of the first aspect.
第四方面、Fourth aspect,
本发明实施例提供了一种计算机可读存储介质,该计算机可读存储介质包括存储的计算机程序,其中,在所述计算机程序运行时控制所述计算机可读存储介质所在设备执行如第一方面任意一段所说的支持退格输入法的文本输入方法。An embodiment of the present invention provides a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, wherein when the computer program runs, the device where the computer-readable storage medium is located is controlled to perform the first aspect Any text input method that supports the backspace input method mentioned in any paragraph.
通过采用上述技术方案,本发明可以取得以下技术效果:By adopting the above-mentioned technical scheme, the present invention can achieve the following technical effects:
通过本发明实施例能够在使用退格输入法对纯数字格式的文本输入框进行输入时,能够有效的避免退格输入法因为特定情况产生的退格对文本输入框内的文字进行删除的情况,避免了有效信息丢失的问题。The embodiments of the present invention can effectively avoid the situation that the backspace input method deletes the text in the text input box due to the backspace caused by the backspace input method when the backspace input method is used to input the text input box in pure digital format. , to avoid the problem of loss of effective information.
为使本发明的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below, and are described in detail as follows in conjunction with the accompanying drawings.
附图说明Description of drawings
为了更清楚地说明本发明实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本发明的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the accompanying drawings required in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention, and therefore do not It should be regarded as a limitation of the scope, and for those of ordinary skill in the art, other related drawings can also be obtained according to these drawings without any creative effort.
图1是本发明第一实施例提供的文本输入方法的流程示意图。FIG. 1 is a schematic flowchart of a text input method provided by a first embodiment of the present invention.
图2是本发明第一实施例提供的另一种文本输入方法的流程示意图。FIG. 2 is a schematic flowchart of another text input method provided by the first embodiment of the present invention.
图3是本发明第一实施例提供的文本输入方法的第一逻辑框图。FIG. 3 is a first logical block diagram of the text input method provided by the first embodiment of the present invention.
图4是本发明第一实施例提供的文本输入方法的第二逻辑框图。FIG. 4 is a second logical block diagram of the text input method provided by the first embodiment of the present invention.
图5是本发明第二实施例提供的文本输入装置的结构示意图。FIG. 5 is a schematic structural diagram of a text input device provided by a second embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
为了更好的理解本发明的技术方案,下面结合附图对本发明实施例进行详细描述。In order to better understand the technical solutions of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
在本发明实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本发明。在本发明实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. As used in the embodiments of the present invention and the appended claims, the singular forms "a," "the," and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise.
应当理解,本文中使用的术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should be understood that the term "and/or" used in this document is only an association relationship to describe the associated objects, indicating that there may be three kinds of relationships, for example, A and/or B, which may indicate that A exists alone, and A and B exist at the same time. B, there are three cases of B alone. In addition, the character "/" in this document generally indicates that the related objects are an "or" relationship.
取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”或“响应于检测”。类似地,取决于语境,短语“如果确定”或“如果检测(陈述的条件或事件)”可以被解释成为“当确定时”或“响应于确定”或“当检测(陈述的条件或事件)时”或“响应于检测(陈述的条件或事件)”。Depending on the context, the word "if" as used herein can be interpreted as "at" or "when" or "in response to determining" or "in response to detecting." Similarly, the phrases "if determined" or "if detected (the stated condition or event)" can be interpreted as "when determined" or "in response to determining" or "when detected (the stated condition or event)," depending on the context )" or "in response to detection (a stated condition or event)".
实施例中提及的“第一\第二”仅仅是是区别类似的对象,不代表针对对象的特定排序,可以理解地,“第一\第二”在允许的情况下可以互换特定的顺序或先后次序。应该理解“第一\第二”区分的对象在适当情况下可以互换,以使这里描述的实施例能够以除了在这里图示或描述的那些内容以外的顺序实施。The "first\second" mentioned in the embodiment is only to distinguish similar objects, and does not represent a specific order for the objects. It is understood that "first\second" can be interchanged with specific order or sequence. It should be understood that the "first\second" distinctions may be interchanged under appropriate circumstances to enable the embodiments described herein to be practiced in sequences other than those illustrated or described herein.
下面结合附图与具体实施方式对本发明作进一步详细描述:The present invention will be described in further detail below in conjunction with the accompanying drawings and specific embodiments:
实施例一:Example 1:
请参阅图1至4,本发明第一实施例提供一种支持退格输入法的文本输入方法,其可由支持退格输入法的文本输入设备(以下简称:输入设备)来执行。特别地,由输入设备中的一个或多个处理器来执行,以实现步骤S1、S2、S3和S6。Referring to FIGS. 1 to 4 , the first embodiment of the present invention provides a text input method supporting backspace input method, which can be executed by a text input device (hereinafter referred to as input device) supporting backspace input method. In particular, steps S1, S2, S3 and S6 are performed by one or more processors in the input device.
S1、获取文本输入框的当前输入字符。其中,文本输入框为纯数字输入框。S1. Obtain the current input character of the text input box. Among them, the text input box is a pure number input box.
具体的,本发明实施例在用户选中的文本输入框为纯数字格式的输入框时开始执行,对用户按下键盘后输入法输出的键值进行判断处理,从而确定对文本输入框所执行的操作,能够有效的避免对文本输入框中的文字进行误删的操作。Specifically, the embodiment of the present invention starts execution when the text input box selected by the user is an input box in pure digital format, and performs judgment processing on the key value output by the input method after the user presses the keyboard, so as to determine the execution of the text input box. The operation can effectively avoid the operation of mistakenly deleting the text in the text input box.
可以理解的是,所述输入设备设备可以是便携笔记本计算机、台式机计算机、服务器、智能手机或者平板电脑等具有计算性能的电子设备。It can be understood that the input device device may be an electronic device with computing performance, such as a portable notebook computer, a desktop computer, a server, a smart phone, or a tablet computer.
S2、判断当前输入字符的类型。其中,类型包括数字型、退格型和其它字符型。S2. Determine the type of the current input character. Among them, types include numeric, backspace, and other character types.
具体的,当前输入字符的键值为ASCII码。其中,退格的编码为#8,数字的编码为#48至#57,在本实施例中,除上述编码外的ASCII码均设置为其它字符类型。在其它实施例中,可以将小数点、斜杠、横杠等符号也纳入数字型中,本发明对数字型所包含的具体编码不做限定,只要其能够将ASCII码分为退格、文本输入框支持的类型和文本输入框不支持的类型等三种类型,即属于本发明的保护范围。Specifically, the key value of the currently input character is an ASCII code. The code of the backspace is #8, and the code of the number is #48 to #57. In this embodiment, the ASCII codes other than the above codes are all set to other character types. In other embodiments, symbols such as decimal points, slashes, and horizontal bars can also be included in the digital type. The present invention does not limit the specific codes included in the digital type, as long as it can divide the ASCII code into backspace, text input Three types, namely the type supported by the box and the type not supported by the text input box, belong to the protection scope of the present invention.
在本实施例中,直接对当前输入字符的类型进行判断,从而确定当前输入字符的类型。在其它实施例中,可以将这个步骤分为两个步骤,即:先判断当前输入的字符是否为三种类型中的某一种,当判断到当前输入字符的类型不是三种类型的某一种后,再判断当前输入字符是否为三种类型中的另一种。In this embodiment, the type of the currently input character is directly judged to determine the type of the currently input character. In other embodiments, this step can be divided into two steps, namely: first determine whether the currently input character is one of the three types, and when it is determined that the type of the currently input character is not one of the three types After the type, it is then judged whether the current input character is another one of the three types.
具体的,步骤S2为:判断当前输入字符是否是第一字符类型。当判断到当前输入字符不是第一字符类型时,判断当前输入字符是否是第二字符类型。其中,第一字符类型是数字型、退格型和其它字符型中的一个。第二字符类型是数字型、退格型和其它字符型中的另一个。Specifically, step S2 is: judging whether the current input character is the first character type. When it is determined that the current input character is not of the first character type, it is determined whether the current input character is of the second character type. Wherein, the first character type is one of number type, backspace type and other character types. The second character type is another of numeric, backspace, and other character types.
优选地,步骤S2为:判断所述当前输入字符是否是退格型;当判断到所述当前输入字符不是退格型时,判断所述当前输入字符是否是数字型;或者,判断所述当前输入字符是否是数字型;当判断到所述当前输入字符不是数字型时,判断所述当前输入字符是否是退格型。Preferably, step S2 is: judging whether the current input character is a backspace type; when it is judged that the current input character is not a backspace type, judging whether the currently input character is a number type; or, judging the current input character Whether the input character is of numeric type; when it is determined that the currently input character is not of numeric type, it is determined whether the current input character is of backspace type.
可以理解的是,通过分步骤来判断当前输入字符的类型,能够有效的减小执行该步骤时所需要的瞬间计算量,避免对输入设备造成卡顿。It can be understood that, by judging the type of the current input character by steps, the instantaneous calculation amount required to perform the step can be effectively reduced, and the input device can be prevented from being stuck.
S3、当判断到当前输入字符的类型为退格型时,获取历史输入字符,并判断历史输入字符的类型。其中,历史输入字符为前一次输入的字符。S3. When it is determined that the type of the current input character is the backspace type, the historical input character is obtained, and the type of the historical input character is determined. Among them, the historical input character is the character inputted last time.
具体的,类似步骤2,在本实施例中,直接对历史输入字符的类型进行判断,从而确定历史输入字符的类型。在其它实施例中,可以将这个步骤分为两个步骤,即:先判断当前输入的字符是否为三种类型中的某一种,当判断到历史输入字符的类型不是三种类型的某一种后,再判断历史输入字符是否为三种类型中的另一种。Specifically, similar to
具体的,步骤S2为:判断历史输入字符是否是第一字符类型。当判断到历史输入字符不是第一字符类型时,判断历史输入字符是否是第二字符类型。其中,第一字符类型是数字型、退格型和其它字符型中的一个。第二字符类型是数字型、退格型和其它字符型中的另一个。Specifically, step S2 is: judging whether the historical input character is the first character type. When it is determined that the historical input character is not of the first character type, it is determined whether the historical input character is of the second character type. Wherein, the first character type is one of number type, backspace type and other character types. The second character type is another of numeric, backspace, and other character types.
优选地,步骤S3为:判断所述历史输入字符是否是退格型;当判断到所述历史输入字符不是退格型时,判断所述历史输入字符是否是其它字符型;或者,判断所述历史输入字符是否是数字型;当判断到所述历史输入字符不是数字型时,判断所述历史输入字符是否是退格型。Preferably, step S3 is: judging whether the historical input character is a backspace type; when judging that the historical input character is not a backspace type, judging whether the historical input character is other character type; or, judging the Whether the historical input character is of the numeric type; when it is determined that the historical input character is not of the numeric type, it is determined whether the historical input character is of the backspace type.
可以理解的,通过分步进行判断,能够降低输入设备的瞬时计算量,使得本发明实施例的文本输入方法能够在配置较低的文本输入设备中,任然较为流畅的执行,获得更好的使用体验。It can be understood that, by performing the judgment step by step, the instantaneous calculation amount of the input device can be reduced, so that the text input method of the embodiment of the present invention can still be executed relatively smoothly in a text input device with a low configuration, and obtain better results. Use experience.
如图2所示,在上述实施例的基础上,本发明的一个可选地实施例中,步骤S3之后还包括步骤S4和S5。As shown in FIG. 2, on the basis of the foregoing embodiment, in an optional embodiment of the present invention, steps S4 and S5 are further included after step S3.
S4、当判断到当前输入字符的类型为数字型时,将当前输入字符写入文本输入框。S4. When it is determined that the type of the current input character is a numeric type, the current input character is written into the text input box.
S5、当判断到当前输入字符的类型是其它字符型时,将当前输入字符置为空值。S5. When it is determined that the type of the currently input character is other character type, the current input character is set to a null value.
可以理解的是,在其它实施例中,当判断到当前输入字符的类型为数字型或其它字符类型时,还可以执行其它人为定义的动作,本发明对此不做具体限定。It can be understood that, in other embodiments, when it is determined that the type of the currently input character is a numeric type or other character type, other artificially defined actions may also be performed, which is not specifically limited in the present invention.
S6、当判断到历史输入字符的类型为其他字符型时,将当前输入字符置为空值。S6. When it is determined that the type of the historical input character is other character type, the current input character is set to a null value.
具体的,在unikey等会产生退格的输入法中,产生多余退格的动作始终在两个字母中间,而字母在本发明实施例中属于其它字符类。因此,本发明实施例在判断到当前输入字符的类型为退格型,且历史输入字符的类型为其它字符型时,将当前输入字符置为空值,从而消除因输入法原因而产生的多余的退格动作。Specifically, in an input method such as unikey that can generate backspaces, the action of generating redundant backspaces is always between two letters, and letters belong to other character classes in the embodiment of the present invention. Therefore, in the embodiment of the present invention, when it is determined that the type of the current input character is the backspace type, and the type of the historical input character is other character type, the current input character is set to a null value, thereby eliminating the redundant input method. backspace action.
通过本发明实施例能够在使用退格输入法对纯数字格式的文本输入框进行输入时,能够有效的避免退格输入法因为特定情况产生的退格对文本输入框内的文字进行删除的情况,避免了有效信息丢失的问题。The embodiments of the present invention can effectively avoid the situation that the backspace input method deletes the text in the text input box due to the backspace caused by the backspace input method when the backspace input method is used to input the text input box in pure digital format. , to avoid the problem of loss of effective information.
如图2所示,在上述实施例的基础上,本发明的一个可选地实施例中,步骤S6之后还包括步骤S7。As shown in FIG. 2, on the basis of the foregoing embodiment, in an optional embodiment of the present invention, step S7 is further included after step S6.
S7、当判断到历史输入字符的类型为数字型或退格型时,删除文本输入框内最后一个显示的字符。S7. When it is determined that the type of the historical input character is a number type or a backspace type, delete the last displayed character in the text input box.
可以理解的是,在其它实施例中,当判断到历史输入字符的类型为数字型或退格型时,还可以执行其它人为定义的动作,本发明对此不做具体限定。只要其能够在当前输入字符的类型为退格型,且历史输入字符的类型为其它字符型时,将当前输入字符置为空值,从而消除因输入法原因而产生的多余的退格动作,即属于本发明的保护范围。It can be understood that, in other embodiments, when it is determined that the type of the historical input character is numeric or backspace, other artificially defined actions may also be performed, which is not specifically limited in the present invention. As long as it can set the current input character to a null value when the type of the current input character is backspace and the type of the historical input character is other character types, thereby eliminating the redundant backspace action caused by the input method, That is, it belongs to the protection scope of the present invention.
在上述实施例的基础上,本发明的一个可选地实施例中,历史输入字符默认为空值。优选地,步骤S1之前还包括步骤S0。On the basis of the above embodiment, in an optional embodiment of the present invention, the historical input character is a null value by default. Preferably, step S0 is further included before step S1.
S0、当文本输入框被选中时,将历史输入字符置为空值。S0. When the text input box is selected, set the historical input characters to null.
具体的,本发明实施例的文本输入方法在用户选中,只支持数字型的文本输入框后执行,在刚选中文本输入框时,将历史输入字符置为空值,能够避免用户在上一个文本输入框中输入字符而对当前文本输入框的输入可能产生的误判。Specifically, the text input method of the embodiment of the present invention is executed after the user selects a text input box that only supports numbers. When the text input box is just selected, the historical input character is set to a null value, which can prevent the user from entering the previous text Entering characters in the input box may cause misjudgment of the input of the current text input box.
可以理解的是,在本发明实施例中,空值和数字型、退格型的作用相同。即:当前输入字符的类型为退格型,且历史输入字符的类型为空值时删除文本输入框内最后一个显示的字符。It can be understood that, in this embodiment of the present invention, a null value has the same function as a numeric type and a backspace type. That is, when the type of the current input character is backspace, and the type of the historical input character is null, the last displayed character in the text input box is deleted.
在上述实施例的基础上,本发明的一个可选地实施例中,步骤S7之后还包括步骤S8和S9。On the basis of the foregoing embodiment, in an optional embodiment of the present invention, steps S8 and S9 are further included after step S7.
S8、将历史输入字符更新为当前输入字符,并判断是否退出当前文本输入框。S8. Update the historical input characters to the current input characters, and determine whether to exit the current text input box.
S9、当判断到退出当前文本输入框时,结束当前文本输入框的输入。否则,继续接收文本输入框的当前输入字符。S9, when it is determined to exit the current text input box, end the input of the current text input box. Otherwise, continue to receive the current input character of the text input box.
可以理解的是,在判断并执行完对当前输入字符的处理之后,将判断并执行处理后的当前输入字符赋值给历史输入字符,从而在下一个字符进行输入的时候,能够快速的获取历史输入字符,具有很好的实际意义。在其它实施例中,可以采用其它方式对历史输入的键值进行记录,本发明对如何获取历史输入字符不做具体限定。It can be understood that after judging and executing the processing of the current input character, the current input character after judgment and execution is assigned to the historical input character, so that when the next character is input, the historical input character can be quickly obtained. , has good practical significance. In other embodiments, other methods may be used to record the historically inputted key values, and the present invention does not specifically limit how to obtain historically inputted characters.
实施例二、Embodiment two,
如图5所示,本发明实施例提供了一种支持退格输入法的文本输入装置,其包含:As shown in FIG. 5 , an embodiment of the present invention provides a text input device supporting a backspace input method, which includes:
输入获取模块1,用于获取文本输入框的当前输入字符。其中,文本输入框为纯数字输入框。The input acquisition module 1 is used to acquire the current input character of the text input box. Among them, the text input box is a pure number input box.
第一判断模块2,用于判断当前输入字符的类型。其中,类型包括数字型、退格型和其它字符型。The
第二判断模块3,用于当判断到当前输入字符的类型为退格型时,获取历史输入字符,并判断历史输入字符的类型。其中,历史输入字符为前一次输入的字符。The
第一执行模块6,用于当判断到历史输入字符的类型为其他字符型时,将当前输入字符置为空值。The
在上述实施例的基础上,本发明的一个可选地实施例中,第一判断模块2,用于:判断当前输入字符是否是第一字符类型。当判断到当前输入字符不是第一字符类型时,判断当前输入字符是否是第二字符类型。其中,第一字符类型是数字型、退格型和其它字符型中的一个。第二字符类型是数字型、退格型和其它字符型中的另一个。On the basis of the above embodiment, in an optional embodiment of the present invention, the
在上述实施例的基础上,本发明的一个可选地实施例中,第二判断模块3,用于:判断历史输入字符是否是第一字符类型。当判断到历史输入字符不是第一字符类型时,判断历史输入字符是否是第二字符类型。其中,第一字符类型是数字型、退格型和其它字符型中的一个。第二字符类型是数字型、退格型和其它字符型中的另一个。On the basis of the above embodiment, in an optional embodiment of the present invention, the
在上述实施例的基础上,本发明的一个可选地实施例中,文本输入装置还包括第二执行模块和第三执行模块。On the basis of the foregoing embodiment, in an optional embodiment of the present invention, the text input device further includes a second execution module and a third execution module.
第二执行模块,用于当判断到当前输入字符的类型为数字型时,将当前输入字符写入文本输入框。The second execution module is configured to write the current input character into the text input box when it is determined that the type of the current input character is numeric.
第三执行模块,用于当判断到当前输入字符的类型是其它字符型时,将当前输入字符置为空值。The third execution module is configured to set the current input character to a null value when it is determined that the type of the current input character is another character type.
在上述实施例的基础上,本发明的一个可选地实施例中,文本输入装置还包括第四执行模块。第四执行模块,用于当判断到历史输入字符的类型为数字型或退格型时,删除文本输入框内最后一个显示的字符。On the basis of the foregoing embodiment, in an optional embodiment of the present invention, the text input device further includes a fourth execution module. The fourth execution module is configured to delete the last displayed character in the text input box when it is determined that the type of the historical input character is numeric or backspace.
在上述实施例的基础上,本发明的一个可选地实施例中,文本输入装置还包括初始模块。初始模块,用于当文本输入框被选中时,将历史输入字符置为空值。On the basis of the above embodiment, in an optional embodiment of the present invention, the text input device further includes an initial module. The initial module is used to set the historical input characters to null when the text input box is selected.
在上述实施例的基础上,本发明的一个可选地实施例中,文本输入装置还包括更新模块和退出模块。On the basis of the above embodiment, in an optional embodiment of the present invention, the text input device further includes an update module and an exit module.
更新模块,用于将历史输入字符更新为当前输入字符,并判断是否退出当前文本输入框。The update module is used to update the historical input characters to the current input characters, and judge whether to exit the current text input box.
退出模块,用于当判断到退出当前文本输入框时,结束当前文本输入框的输入。否则,继续接收文本输入框的当前输入字符。The exit module is used to end the input of the current text input box when it is judged to exit the current text input box. Otherwise, continue to receive the current input character of the text input box.
实施例三、Embodiment three,
本发明实施例提供了一种支持退格输入法的文本输入设备,其包括处理器、存储器,以及存储在存储器内的计算机程序。计算机程序能够被处理器执行,以实现如实施例一任意一段所说的支持退格输入法的文本输入方法。An embodiment of the present invention provides a text input device supporting a backspace input method, which includes a processor, a memory, and a computer program stored in the memory. The computer program can be executed by the processor to implement the text input method supporting the backspace input method as described in any paragraph of the first embodiment.
实施例四、Embodiment four,
本发明实施例提供了一种计算机可读存储介质,该计算机可读存储介质包括存储的计算机程序,其中,在计算机程序运行时控制计算机可读存储介质所在设备执行如实施例一任意一段所说的支持退格输入法的文本输入方法。An embodiment of the present invention provides a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, wherein, when the computer program runs, the device where the computer-readable storage medium is located is controlled to perform as described in any paragraph of the first embodiment The text input method that supports the backspace input method.
在本发明实施例所提供的几个实施例中,应该理解到,所揭露的装置和方法,也可以通过其它的方式实现。以上所描述的装置和方法实施例仅仅是示意性的,例如,附图中的流程图和框图显示了根据本发明的多个实施例的装置、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现方式中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。In the several embodiments provided by the embodiments of the present invention, it should be understood that the disclosed apparatus and method may also be implemented in other manners. The apparatus and method embodiments described above are merely illustrative, for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention, function and operation. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more functions for implementing the specified logical function(s) executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or actions , or can be implemented in a combination of dedicated hardware and computer instructions.
另外,在本发明各个实施例中的各功能模块可以集成在一起形成一个独立的部分,也可以是各个模块单独存在,也可以两个或两个以上模块集成形成一个独立的部分。In addition, each functional module in each embodiment of the present invention may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.
所述功能如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,电子设备,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, an electronic device, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes . It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210856978.2A CN115220582B (en) | 2022-07-20 | 2022-07-20 | Text input method, device, apparatus and storage medium supporting backspace input method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210856978.2A CN115220582B (en) | 2022-07-20 | 2022-07-20 | Text input method, device, apparatus and storage medium supporting backspace input method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN115220582A true CN115220582A (en) | 2022-10-21 |
| CN115220582B CN115220582B (en) | 2025-09-23 |
Family
ID=83614800
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210856978.2A Active CN115220582B (en) | 2022-07-20 | 2022-07-20 | Text input method, device, apparatus and storage medium supporting backspace input method |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115220582B (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104317780A (en) * | 2014-09-28 | 2015-01-28 | 无锡卓信信息科技有限公司 | Quick correction method of Chinese input texts |
| US9122376B1 (en) * | 2013-04-18 | 2015-09-01 | Google Inc. | System for improving autocompletion of text input |
| CN105334952A (en) * | 2014-07-11 | 2016-02-17 | 北京搜狗科技发展有限公司 | Input method and device of text information |
| US20160275070A1 (en) * | 2015-03-19 | 2016-09-22 | Nuance Communications, Inc. | Correction of previous words and other user text input errors |
-
2022
- 2022-07-20 CN CN202210856978.2A patent/CN115220582B/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9122376B1 (en) * | 2013-04-18 | 2015-09-01 | Google Inc. | System for improving autocompletion of text input |
| CN105334952A (en) * | 2014-07-11 | 2016-02-17 | 北京搜狗科技发展有限公司 | Input method and device of text information |
| CN104317780A (en) * | 2014-09-28 | 2015-01-28 | 无锡卓信信息科技有限公司 | Quick correction method of Chinese input texts |
| US20160275070A1 (en) * | 2015-03-19 | 2016-09-22 | Nuance Communications, Inc. | Correction of previous words and other user text input errors |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115220582B (en) | 2025-09-23 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7003725B2 (en) | Method and system for normalizing dirty text in a document | |
| US6654733B1 (en) | Fuzzy keyboard | |
| US7454702B2 (en) | Tool for selecting ink and other objects in an electronic document | |
| US10803241B2 (en) | System and method for text normalization in noisy channels | |
| US9280536B2 (en) | Synonym determination among n-grams | |
| CN113760839A (en) | Log data compression processing method and device, electronic equipment and storage medium | |
| WO2018032697A1 (en) | Automatic error correction method and system for handwriting | |
| US8555191B1 (en) | Method, system, and apparatus for keystroke entry without a keyboard input device | |
| JP6667452B2 (en) | Method and apparatus for inputting text information | |
| US12266364B2 (en) | Task information management | |
| CN113947082A (en) | Method, device, device and storage medium for word segmentation processing | |
| CN115220582A (en) | Text input method, equipment, device and storage medium for supporting backspace input method | |
| US6802052B1 (en) | Method, apparatus, and article of manufacture for providing automatic recognition and playback of repetitive input device patterns | |
| US8838546B1 (en) | Correcting accidental shortcut usage | |
| JP3470975B2 (en) | Kana-kanji conversion method and device for document input device | |
| CN109710898B (en) | Text duplicate checking method and device, electronic equipment and storage medium | |
| JP5888182B2 (en) | Document management apparatus and program | |
| CN113591440A (en) | Text processing method and device and electronic equipment | |
| JP5803481B2 (en) | Information processing apparatus and information processing program | |
| CN105718427B (en) | Information processing method and electronic equipment | |
| CN117892724B (en) | Text detection method, device, equipment and storage medium | |
| CN110263337A (en) | Input behavior recognition methods, device, equipment and medium | |
| CN115097950B (en) | A key sequence detection method and device | |
| CN119358551B (en) | Word stock generation method, device, equipment and medium | |
| JPS63115217A (en) | Character input device |
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 | ||
| CB02 | Change of applicant information | ||
| CB02 | Change of applicant information |
Country or region after: China Address after: 361000 room 305A, Aung Yip house, Pioneer Park, torch high tech Zone, Xiamen, Fujian Applicant after: Xiamen Hanyin Co.,Ltd. Address before: 361000 room 305A, Aung Yip house, Pioneer Park, torch high tech Zone, Xiamen, Fujian Applicant before: XIAMEN HANIN ELECTRONIC TECHNOLOGY Co.,Ltd. Country or region before: China |
|
| GR01 | Patent grant | ||
| GR01 | Patent grant |