Nothing Special   »   [go: up one dir, main page]

CN113157112A - Input method, input device, electronic equipment and storage medium - Google Patents

Input method, input device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113157112A
CN113157112A CN202110465470.5A CN202110465470A CN113157112A CN 113157112 A CN113157112 A CN 113157112A CN 202110465470 A CN202110465470 A CN 202110465470A CN 113157112 A CN113157112 A CN 113157112A
Authority
CN
China
Prior art keywords
input
candidate
category
box
elements
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.)
Pending
Application number
CN202110465470.5A
Other languages
Chinese (zh)
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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202110465470.5A priority Critical patent/CN113157112A/en
Publication of CN113157112A publication Critical patent/CN113157112A/en
Pending legal-status Critical Current

Links

Images

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/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements 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/0233Character input methods
    • G06F3/0236Character input methods using selection techniques to select from displayed items

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)

Abstract

The disclosure relates to an input method, an input device, an electronic device and a computer readable storage medium. The method comprises the following steps: responding to an element input event acting on the input box, and acquiring an element category corresponding to a current input element in the input box; the element category comprises an index category and an operator category; determining at least one candidate element according to the element category corresponding to the current input element; when the element category corresponding to the current input element is the index category, the candidate element is the operator category; when the element category corresponding to the current input element is an operator category, the candidate element is an index category; displaying an element frame at a position corresponding to the current input element, and displaying at least one candidate element; and in response to the selection operation of any one of the at least one candidate element in the element frame, inputting the selected candidate element behind the current input element. The method and the device can realize accurate input of the expression without description characters, thereby improving the input efficiency of the expression.

Description

Input method, input device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of information input technologies, and in particular, to an input method, an input device, an electronic device, and a computer-readable storage medium.
Background
With the development of information input technology, in some scenarios, such as a big data analysis scenario, it is necessary to input a plurality of index information, and connect the plurality of index information by an input symbol or the like to obtain an expression for data analysis composed of the plurality of index information. The existing expression input method is that a user inputs index information and an input character for connecting the index information into an input box, so that the input of an expression is realized.
In the related art, because a user can input any information in an input box at will, the input expression may not meet the requirement of the expression, and therefore, the current input method for the expression mainly uses explanatory characters displayed on a page for guiding the input of the expression, so that the user can input the expression according to the explanatory characters. However, the expression of the explanatory characters is limited, and thus the input efficiency of the expression is low.
Disclosure of Invention
The present disclosure provides an input method, an input device, an electronic device, and a computer-readable storage medium, to at least solve the problem of low input efficiency of expressions in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of embodiments of the present disclosure, there is provided an input method, including:
responding to an element input event acting on the input box, and acquiring an element category corresponding to a current input element in the input box; the element categories comprise an index category and an operator category; the elements of the operator category are used for realizing the operation on the elements of the index category;
determining at least one candidate element corresponding to the current input element according to the element category corresponding to the current input element; when the element category corresponding to the current input element is the index category, the element category corresponding to the candidate element is the operator category; when the element category corresponding to the current input element is the operator category, the element category corresponding to the candidate element is the index category;
displaying an element frame at a position corresponding to the current input element, and displaying the at least one candidate element through the element frame;
in response to a selection operation for any one of the at least one candidate element in the element box, a selected candidate element is obtained and entered after the current input element of the input box.
In an exemplary embodiment, the presenting an element box in a position corresponding to the current input element includes: when the current input element is not the first element displayed in the input box, acquiring position offset information between the current input element and the first element displayed in the input box; and moving the element frame by the distance shown by the position offset information.
In an exemplary embodiment, the obtaining of the position offset information between the current input element and the first element displayed in the input box includes: acquiring the width of an input element between the current input element and a first element input in the input box; determining whether a lateral scroll control is present in the input box; when the horizontal scroll control does not exist in the input box, taking the width of the input element as the position offset information; and when the horizontal scroll control exists in the input box, acquiring the scroll distance of the horizontal scroll control, and taking the difference between the width of the input element and the scroll distance as the position offset information.
In an exemplary embodiment, when the number of candidate elements is greater than a preset first number threshold, an element scroll control is displayed in the element frame; the element rolling control is used for controlling rolling display of a plurality of candidate elements; the displaying the at least one candidate element through the element box includes: determining a scroll position of the element scroll control in response to a scroll operation for the element scroll control; and determining a candidate element to be shown corresponding to the rolling position from the plurality of candidate elements, and displaying the candidate element to be shown through the element frame.
In an exemplary embodiment, when the number of the candidate elements is greater than a preset second number threshold, a key switching control is displayed in the element frame; the key switching control is used for controlling the switching display of a plurality of candidate elements; the displaying the at least one candidate element through the element box includes: responding to the triggering operation aiming at the key switching control, and determining the triggering times of the key switching control; and determining candidate elements to be displayed corresponding to the triggering times from the candidate elements, and displaying the candidate elements to be displayed through the element frame.
In an exemplary embodiment, the number of the candidate elements is multiple; the displaying the at least one candidate element through the element box includes: determining a display order of the plurality of candidate elements; displaying the plurality of candidate elements in the element frame in the display order.
According to a second aspect of the embodiments of the present disclosure, there is provided an input device including:
an element category acquisition unit configured to perform acquisition of an element category corresponding to a currently input element in an input box in response to an element input event acting on the input box; the element categories comprise an index category and an operator category; the elements of the operator category are used for realizing the operation on the elements of the index category;
a candidate element determination unit configured to perform determining at least one candidate element corresponding to the current input element according to an element category corresponding to the current input element; when the element category corresponding to the current input element is the index category, the element category corresponding to the candidate element is the operator category; when the element category corresponding to the current input element is the operator category, the element category corresponding to the candidate element is the index category;
a candidate element display unit configured to display an element frame at a position corresponding to the current input element, and display the at least one candidate element through the element frame;
a candidate element input unit configured to perform a selection operation in response to any one of the at least one candidate element in the element frame, acquire a selected candidate element, and input the selected candidate element behind the current input element of the input frame.
In an exemplary embodiment, the candidate element display unit is further configured to perform, when the current input element is not the first element displayed in the input box, acquiring positional offset information between the current input element and the first element displayed in the input box; and moving the element frame by the distance shown by the position offset information.
In an exemplary embodiment, the candidate element display unit is further configured to perform acquiring an input element width between the current input element and a first element input in the input box; determining whether a lateral scroll control is present in the input box; when the horizontal scroll control does not exist in the input box, taking the width of the input element as the position offset information; and when the horizontal scroll control exists in the input box, acquiring the scroll distance of the horizontal scroll control, and taking the difference between the width of the input element and the scroll distance as the position offset information.
In an exemplary embodiment, when the number of candidate elements is greater than a preset first number threshold, an element scroll control is displayed in the element frame; the element rolling control is used for controlling rolling display of a plurality of candidate elements; the candidate element display unit is further configured to execute the step of determining the scroll position of the element scroll control in response to the scroll operation for the element scroll control; and determining a candidate element to be shown corresponding to the rolling position from the plurality of candidate elements, and displaying the candidate element to be shown through the element frame.
In an exemplary embodiment, when the number of the candidate elements is greater than a preset second number threshold, a key switching control is displayed in the element frame; the key switching control is used for controlling the switching display of a plurality of candidate elements; the candidate element display unit is further configured to execute triggering operation responding to the key switching control, and determine the triggering times of the key switching control; and determining candidate elements to be displayed corresponding to the triggering times from the candidate elements, and displaying the candidate elements to be displayed through the element frame.
In an exemplary embodiment, the number of the candidate elements is multiple; the candidate element display unit further configured to perform determining a display order of the plurality of candidate elements; displaying the plurality of candidate elements in the element frame in the display order.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the input method as described in any of the above embodiments.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, wherein instructions, when executed by a processor of an electronic device, enable the electronic device to perform an input method as described in any one of the above embodiments.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the input method as described in any one of the embodiments above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
acquiring an element category corresponding to a current input element in an input box by responding to an element input event acting on the input box; the element category comprises an index category and an operator category; the elements of the operator category are used for realizing the operation on the elements of the index category; determining at least one candidate element corresponding to the current input element according to the element category corresponding to the current input element; when the element category corresponding to the current input element is the index category, the element category corresponding to the candidate element is the operator category; when the element category corresponding to the current input element is an operator category, the element category corresponding to the candidate element is an index category; displaying an element frame at a position corresponding to the current input element, and displaying at least one candidate element through the element frame; and responding to the selection operation of any candidate element in at least one candidate element in the element frame, acquiring the selected candidate element, and inputting the selected candidate element behind the current input element of the input frame. According to the method and the device, the element frame is displayed at the position corresponding to the current input element, and the candidate elements are displayed in the element frame, so that a user can select the elements needing to be input in the element frame, accurate input of the expression can be achieved without description characters, and the input efficiency of the expression is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow chart illustrating an input method according to an exemplary embodiment.
FIG. 2 is a flow diagram illustrating displaying candidate elements to be presented according to an example embodiment.
Fig. 3 is a flow diagram illustrating the determination of position offset information according to an example embodiment.
FIG. 4 is a flow chart illustrating an input method according to an exemplary embodiment.
FIG. 5 is an interface diagram illustrating an input method according to an exemplary embodiment.
FIG. 6 is an interface diagram illustrating an input method according to another exemplary embodiment.
FIG. 7 is a block diagram illustrating an input device according to an exemplary embodiment.
FIG. 8 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating an input method according to an exemplary embodiment, where the input method is used in a terminal as shown in fig. 1, and includes the following steps.
In step S101, the terminal responds to an element input event acting on the input box, and acquires an element category corresponding to a current input element in the input box; the element category comprises an index category and an operator category; the elements of the operator category are used to implement operations on the elements of the index category.
Wherein, the terminal can be but not limited to various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices, the input box is an input box for inputting elements, the input box can be displayed in the display interface of the terminal, when the user inputs the elements into the input box through the terminal, the display interface of the terminal can display the input elements carrying the input elements which are already input, the current input element is the input element for which the input has been currently completed, the element category may refer to the element category of the current input element, may be an index class, such as a number or a letter representing a data amount, etc., for element calculation, may be an operator class for implementing operations on elements of the index class, for example, mathematical symbol elements such as addition, subtraction, multiplication, division, or equal sign used to connect two numeric or alphabetical indices. Specifically, when a user needs to input an element into the input box, a corresponding element input event may be triggered to the terminal, and the terminal may respond to the triggered element input event, take the input element as a current input element, and determine whether an element category of the current input element belongs to an index category or an operator category.
In step S102, the terminal determines at least one candidate element corresponding to the current input element according to the element category corresponding to the current input element; when the element category corresponding to the current input element is the index category, the element category corresponding to the candidate element is the operator category; and when the element category corresponding to the current input element is an operator category, the element category corresponding to the candidate element is an index category.
The candidate element is the next element of the current input element of the terminal, and the candidate element can be determined according to the element category of the current input element. Specifically, after obtaining the element category of the current input element, the terminal may determine one or more candidate elements according to the element category of the current input element, if the current input element is an index category, the terminal may select at least one element from elements of multiple operator categories as the candidate element, and if the current input element is an element of an operator category, the terminal may find the element of at least one index category from the multiple index categories as the candidate element.
In step S103, the terminal displays an element frame at a position corresponding to the current input element, and displays at least one candidate element through the element frame;
in step S104, the terminal acquires a selected candidate element in response to a selection operation for any one of at least one candidate element in the element frame, and inputs the selected candidate element behind a current input element of the input frame.
Specifically, the element frame may carry a plurality of candidate elements, after the terminal obtains the candidate elements, the element frame carrying the candidate elements corresponding to the current input element may be displayed at a position corresponding to the current input element, and a selection operation of the user on the candidate elements displayed in the element frame is received, for example, the user may select the candidate elements corresponding to the click position as the selected candidate elements in a manner of clicking the candidate elements displayed in the element frame, or may select the candidate elements corresponding to the determined cursor position as the selected candidate elements by the user operating a cursor in the element frame through a keyboard, changing the position of the cursor through the keyboard and performing determination processing, and finally, the terminal inputs the selected candidate elements to the input frame after the current input element.
In the input method, the element type corresponding to the current input element in the input box is obtained by responding to the element input event acting on the input box through the terminal; the element category comprises an index category and an operator category; the elements of the operator category are used for realizing the operation on the elements of the index category; determining at least one candidate element corresponding to the current input element according to the element category corresponding to the current input element; when the element category corresponding to the current input element is the index category, the element category corresponding to the candidate element is the operator category; when the element category corresponding to the current input element is an operator category, the element category corresponding to the candidate element is an index category; displaying an element frame at a position corresponding to the current input element, and displaying at least one candidate element through the element frame; and responding to the selection operation of any candidate element in at least one candidate element in the element frame, acquiring the selected candidate element, and inputting the selected candidate element behind the current input element of the input frame. According to the method and the device, the element frame is displayed at the position corresponding to the current input element, and the candidate elements are displayed in the element frame, so that a user can select the elements needing to be input in the element frame, accurate input of the expression can be achieved without description characters, and the input efficiency of the expression is improved.
In an exemplary embodiment, step S103 may further include: when the current input element is not the first element displayed in the input box, the terminal acquires position offset information between the current input element and the first element displayed in the input box; the element frame is moved by the distance indicated by the positional offset information.
Wherein the first element displayed in the input box refers to the first element currently displayed in the input box, since the position of the element box corresponding to the currently input element needs to correspond to the element position of the currently input element, thus, when the position of the current input element is changed, the position of the input box can be changed accordingly, so in this embodiment, if the current input element is not the first element displayed in the input box, the position of the element box corresponding to the current input element can be changed by moving the position of the input box, and the position offset information refers to the offset information of the current input element and the first element displayed in the input box, the offset distance of the current input element from the first element displayed in the input box or the offset character number of the previous input element from the first element displayed in the input box.
Specifically, the terminal may preset a position of an element frame corresponding to a first element displayed in the input frame, and after obtaining the current input element and position offset information of the element frame corresponding to the first element displayed in the input frame, may perform corresponding movement on the position of the element frame corresponding to the current input element according to the offset distance by using a distance represented by the position offset information.
In the embodiment, the position of the element frame can be changed according to the position of the current input element, so that the selection of the candidate element by the user is facilitated, the selection time is saved, and the element input efficiency is improved.
Further, as shown in fig. 2, the acquiring, by the terminal, the position offset information of the current input element and the first element displayed in the input box may further include:
in step S201, the terminal acquires an input element width between the current input element and the first element input in the input box.
The first element input in the input box refers to the first element input in the input box by the terminal, and because the number of input elements is large and may exceed the length of the input box designed in advance, in this embodiment, a part of the expression with many input elements may be hidden in a manner of also setting a horizontal scroll control in the input box, so that a user may change the input elements displayed in the input box in a similar manner of changing the position of the horizontal scroll control of the element box. The terminal may determine an input element width between the current input element and the first input element in the input box, e.g., the terminal may read a font from the first input element to the current input element using the two-dimensional context function of the canvas and obtain the font width of the font as the input element width between the current input element and the first input element in the input box.
In step S202, the terminal determines whether a horizontal scroll control exists in the input box;
in step S203, when the horizontal scroll control does not exist in the input box, the terminal uses the width of the input element as the position offset information;
in step S204, when the horizontal scroll control exists in the input box, the terminal obtains a scroll distance of the scroll control, and uses a difference between the width of the input element and the scroll distance as the position offset information.
Then, the terminal may determine whether a horizontal scroll control exists in the input box, if the horizontal scroll control does not exist in the input box, it indicates that a hidden input element does not exist in the input box, and therefore, the terminal may directly use the obtained width of the input element as the position offset information of the current input element and the first element displayed in the input box, and if the horizontal scroll control exists in the input box, it indicates that the input element exists in the input box and is hidden, and therefore, the terminal needs to determine the width of the hidden input element in the input box first, and by obtaining the scroll distance of the horizontal scroll control, the width of the hidden input element may be represented by the scroll distance, and then the terminal may subtract the scroll distance, that is, the element width of the hidden input element from the input box, the element width of all the input elements included in the input box, by the scroll distance, that is, the element width of the hidden input element in the input box, the obtained difference is the element width of the input element displayed in the input box as the positional shift information.
Further, in this embodiment, the position of the candidate element may be determined by determining an input element width between a current input element in the input box and a first element input in the input box, and whether the input box has a horizontal scroll control, so as to further ensure accuracy of the obtained position offset information.
In an exemplary embodiment, when the number of candidate elements is greater than a preset first number threshold, an element scroll control is displayed in the element box; the element rolling control is used for controlling rolling display of a plurality of candidate elements; as shown in fig. 3, step S103 may further include:
in step S301, the terminal determines a scroll position of the element scroll control in response to a scroll operation for the element scroll control.
The element scroll control may be a control for changing candidate elements displayed in the element frame by scrolling, for example, a scroll bar, the first number threshold may be a maximum number of candidate elements displayable in the element frame preset by a user, when the number of candidate elements is greater than the first number threshold, that is, when all candidate elements cannot be displayed in the display frame, the candidate elements currently displayed in the element frame, that is, the candidate elements to be displayed, may be changed by setting the element scroll control and displaying in the element frame while adjusting the position of the displayed element scroll control. The change mode can be that the user changes the rolling by clicking the element rolling control and dragging, or can change the candidate element selected by the cursor by the direction control key of the keyboard, and in the process of changing the candidate element selected by the cursor, if the candidate element selected by the cursor exceeds the display range of the current element frame, the corresponding rolling operation can be triggered, so that the rolling position of the element rolling control is changed, and the candidate element displayed by the element frame is changed. Specifically, a user may initiate a scroll operation for the element scroll control to the terminal by means of a similar click or operation of a keyboard direction control key, and the terminal may respond to the scroll operation initiated by the user, and determine a current scroll position of the element scroll control while changing the scroll position of the element scroll control.
In step S302, the terminal determines a candidate element to be presented corresponding to the scroll position from among the plurality of candidate elements, and displays the candidate element to be presented through the element frame.
And then, the terminal can determine a candidate element corresponding to the rolling position of the current element rolling control from the plurality of candidate elements as a candidate element to be displayed according to the rolling position of the current element rolling control, and display the candidate element to be displayed in the element frame.
In the above embodiment, the terminal may perform scroll display on the candidate elements in the element frame through the element scroll control, and display different candidate elements to be displayed by using different scroll positions, so that the occupation of the element frame may be saved and more candidate elements may be accommodated, thereby improving convenience in element input.
In another exemplary embodiment, when the number of candidate elements is greater than a preset second number threshold, a key switching control is displayed in the element frame; the key switching control is used for controlling the switching display of a plurality of candidate elements; step S103 may further include: the terminal responds to the triggering operation aiming at the key switching control and determines the triggering times of the key switching control; and determining candidate elements to be displayed corresponding to the triggering times from the plurality of candidate elements, and displaying the candidate elements to be displayed through the element frame.
The key switching control may be a control that changes candidate elements displayed in the element frame in a triggering manner, for example, may be some arrow controls displayed in the element frame, the user may trigger the key switching control in a clicking manner, and the terminal may change the candidate elements currently displayed in the element frame, that is, the display of the candidate elements to be displayed, according to the triggering operation of the user on the key switching control. The second number threshold may be the maximum number of candidate elements displayable in an element frame set in advance by the user, and may be set to be the same as the first number threshold or may be set to be different from the first number threshold. Specifically, when the candidate elements displayed in the element frame are greater than a preset second number threshold, the terminal may display a key switching control in the element frame, and if the user triggers a trigger operation for the key switching control by, for example, clicking with a mouse, the terminal may count the number of times of triggering the key switching control, for example, the number of times of clicking by the user, and determine, from the plurality of candidate elements, a candidate element to be displayed corresponding to the number of times of triggering, and display the candidate element through the element frame.
In this embodiment, the terminal may further perform switching display on the candidate elements in the element frame through the key switching control, and display different candidate elements to be displayed by using different switching times for the key switching control, so that the occupation of the element frame may be saved and more candidate elements may be accommodated, thereby improving convenience in element input.
In addition, the number of the candidate elements is multiple; step S103 may further include: the terminal determines the display sequence of a plurality of candidate elements; the plurality of candidate elements are displayed in the element frame in the display order.
The display sequence refers to a display sequence of a plurality of candidate elements in the element frame, the terminal can display the plurality of candidate elements in the element frame according to the display sequence, the display sequence can be set according to habits of a user, the terminal can count input frequencies of the operating user for the candidate elements, and the terminal can have a better display sequence for the candidate elements with high input frequencies, so that the user can select some candidate elements with high input frequencies more quickly. The terminal may also display corresponding candidate elements according to a certain preset element order, such as an alphabetical order or a numerical order, that is, if the current input element is an operator category element, the candidate element of the next input index type may be displayed in the input box according to the alphabetical order of the order a, b, c, d.
In the above embodiment, the terminal may display the plurality of elements in sequence according to the display order, and may have a better display order for the element with a higher probability of being selected among the candidate elements, thereby further improving the input efficiency of the element.
Fig. 4 is a flowchart illustrating an input method, according to an exemplary embodiment, for use in a terminal, as shown in fig. 4, including the following steps.
In step S401, the terminal responds to an element input event acting on the input box, and acquires an element category corresponding to a current input element in the input box; the element category comprises an index category and an operator category; the elements of the operator category are used for realizing the operation on the elements of the index category;
in step S402, the terminal determines at least one candidate element corresponding to the current input element according to the element category corresponding to the current input element; when the element category corresponding to the current input element is the index category, the element category corresponding to the candidate element is the operator category; when the element category corresponding to the current input element is an operator category, the element category corresponding to the candidate element is an index category;
in step S403, when the current input element is not the first element displayed in the input box, the terminal acquires an input element width between the current input element and the first element input in the input box; determining whether a scroll control exists in the input box;
in step S404, the terminal obtains an input element width between the current input element and the first element input in the input box;
in step S405, when the horizontal scroll control does not exist in the input box, the terminal uses the width of the input element as the position offset information;
in step S406, when the horizontal scroll control exists in the input box, the terminal obtains a scroll distance of the horizontal scroll control, and uses a difference between the width of the input element and the scroll distance as position offset information;
in step S407, the terminal moves the element frame by the distance indicated by the positional offset information;
in step S408, the terminal determines the display order of the plurality of candidate elements; displaying a plurality of candidate elements in the element frame in a display order;
in step S409, the terminal determines a scroll position of the element scroll control in response to a scroll operation for the element scroll control; determining candidate elements to be displayed corresponding to the rolling position from the plurality of candidate elements, and displaying the candidate elements to be displayed through the element frame;
in step S410, the terminal determines the number of times of triggering the key switching control in response to the triggering operation for the key switching control; determining candidate elements to be displayed corresponding to the triggering times from the plurality of candidate elements, and displaying the candidate elements to be displayed through an element frame;
in step S411, the terminal acquires a selected candidate element in response to a selection operation for any one of at least one candidate element in the element frame, and inputs the selected candidate element behind a current input element of the input frame.
In the embodiment, the terminal displays the element frame at the position corresponding to the current input element and displays the candidate elements in the element frame, so that the user can select the element to be input in the element frame, the accurate input of the expression can be realized without description characters, and the input efficiency of the expression is improved. In addition, the position of the candidate element can be determined by judging the width of the input element between the current input element in the input frame and the first element input in the input frame and judging whether the input frame has a transverse rolling control, so that the accuracy of the obtained position offset information can be further ensured. In addition, the terminal can display the candidate elements in the element frame in a rolling mode through the display control, different candidate elements to be displayed are displayed by using different rolling positions, or the candidate elements in the element frame are displayed in a switching mode through the key switching control, different candidate elements to be displayed are displayed by using different switching times aiming at the key switching control, occupation of the element frame can be saved, more candidate elements can be contained, and convenience in element input is improved. In addition, the terminal can also display the plurality of elements according to the display sequence, and the elements with higher selection probability in the candidate elements can have a better display sequence, so that the input efficiency of the elements is further improved.
In an exemplary embodiment, an input method is further provided, where the method adds a function selected from a drop-down box during a composite indicator operation by dropping down a candidate item, so as to provide a certain guiding and completing function for the composite indicator operation of a user, so that the user can understand and use the composite indicator correctly and clearly, and combine the correct composite indicator, where the specific effects may be as follows:
(1) in an input element frame in a page, a user can type any element, so when the user performs composite index combination, a certain prompt and completion need to be given, a drop-down frame capable of prompting when the user types an index is designed, and when the user inputs an effective index such as ABC in the input frame and the position of a previous cursor is the effective index, a corresponding optional operator + -/and the like are displayed in the drop-down frame, as shown in FIG. 5.
(2) If the previous cursor position is + -/equal valid operator, the corresponding selectable operation displayed in the drop-down box is the current selectable valid indicator, as shown in fig. 6.
By combining the drop-down selection box with the input box, when the user inputs content, the position of the drop-down box should also move along with the position of the cursor. The method can provide guiding and completing functions for the combined operation of the composite indexes of the user.
In order to realize the functions, the following key technical points are needed for support:
(1) template for making pull-down input frame
The drop-down box input panel is made using HTML + CSS techniques, noting that a scroll bar is added to it, if there are too many candidate words to display in the scroll bar.
(2) Obtaining the width of typed characters
The purpose of obtaining the text width is to calculate the offset position of the current drop-down frame panel, and the position of the drop-down frame panel should be offset according to the position of the text along with the input of the text. Here, canvas may be used to achieve the effect of calculating the width of a word by first creating a 2d canvas context to obtain the font of the rendered word, i.e., the word starting from the input box to the position selected by the cursor, and passing the font into the canvas context.
For a web page element, we need to monitor its input, click, mouse-off, keyboard events, etc., and in these events, each event operation needs to obtain information of the element, such as the leftmost element in the selection area, the rightmost element, whether there is a scroll bar, and the distance between the scroll bar and the left. And then, calling a method for calculating the length of the characters of the canvas to acquire the length of the selected characters, and determining the offset position of the current drop-down box panel according to whether the input box has a scroll bar or not. If there is no horizontal scroll bar in the input box, the position of the drop-down candidate box is the currently calculated text length, and if there is a horizontal scroll bar, the position of the drop-down candidate box is the selected text length — the left length of the scroll bar.
(3) Monitoring keyboard events
The drop-down candidate supports the use of keyboard up-down control selection, which controls the selection of currently active options by listening to keyboard events for input elements. If the options are more, the displacement of the scroll bar to the currently activated element is controlled by calculation for the case that the distance of the scroll bar is exceeded.
In the above embodiment, a tab similar to a drop-down box of an operating system input method may be simulated by a canvas and a custom drop-down box element, the tab moves along with a cursor position and displays different candidate contents along with different input characters, and a user performs certain completion and guidance when inputting a combined composite index.
It should be understood that although the various steps in the flow charts of fig. 1-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1-4 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
FIG. 7 is a block diagram illustrating an input device according to an exemplary embodiment. Referring to fig. 7, the apparatus includes an element category acquisition unit 701, a candidate element determination unit 702, a candidate element display unit 703, and a candidate element input unit 704.
An element category acquisition unit 701 configured to perform acquisition of an element category corresponding to a currently input element in an input box in response to an element input event acting on the input box; the element category comprises an index category and an operator category; the elements of the operator category are used for realizing the operation on the elements of the index category;
a candidate element determination unit 702 configured to perform determining at least one candidate element corresponding to the current input element according to the element category corresponding to the current input element; when the element category corresponding to the current input element is the index category, the element category corresponding to the candidate element is the operator category; when the element category corresponding to the current input element is an operator category, the element category corresponding to the candidate element is an index category;
a candidate element display unit 703 configured to display an element frame at a position corresponding to a current input element, and display at least one candidate element through the element frame;
a candidate element input unit 704 configured to perform, in response to a selection operation for any one of the at least one candidate element in the element box, acquiring a selected candidate element, and inputting the selected candidate element behind a current input element of the input box.
In an exemplary embodiment, the candidate element display unit 703 is further configured to perform, when the current input element is not the first element displayed in the input box, acquiring positional offset information between the current input element and the first element displayed in the input box; the element frame is moved by the distance indicated by the positional offset information.
In an exemplary embodiment, the candidate element display unit 703 is further configured to perform acquiring an input element width between the current input element and the first element input in the input box; determining whether a lateral scrolling control exists in the input box; when the horizontal scroll control does not exist in the input box, taking the width of the input element as the position offset information; and when the input box has a transverse scroll control, acquiring the scroll distance of the transverse scroll control, and taking the difference between the width of the input element and the scroll distance as position offset information.
In an exemplary embodiment, when the number of candidate elements is greater than a preset first number threshold, an element scroll control is displayed in the element box; the element rolling control is used for controlling rolling display of a plurality of candidate elements; a candidate element display unit 703 further configured to perform determining a scroll position of the element scroll control in response to a scroll operation for the element scroll control; and determining candidate elements to be displayed corresponding to the rolling position from the plurality of candidate elements, and displaying the candidate elements to be displayed through the element frame.
In an exemplary embodiment, when the number of candidate elements is greater than a preset second number threshold, a key switching control is displayed in an element frame; the key switching control is used for controlling the switching display of a plurality of candidate elements; a candidate element display unit 703 further configured to perform, in response to a trigger operation for the key switch control, determining the number of times of triggering the key switch control; and determining candidate elements to be displayed corresponding to the triggering times from the plurality of candidate elements, and displaying the candidate elements to be displayed through the element frame.
In an exemplary embodiment, the number of candidate elements is multiple; a candidate element display unit 703 further configured to perform determining a display order of the plurality of candidate elements; the plurality of candidate elements are displayed in the element frame in the display order.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 8 is a block diagram illustrating a device 800 for input according to an example embodiment. For example, the device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a gaming console, a tablet device, a medical device, a fitness device, a personal digital assistant, and so forth.
Referring to fig. 8, device 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the device 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile storage devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power component 806 provides power to the various components of the device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed state of the device 800, the relative positioning of components, such as a display and keypad of the device 800, the sensor assembly 814 may also detect a change in the position of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, orientation or acceleration/deceleration of the device 800, and a change in the temperature of the device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
Communications component 816 is configured to facilitate communications between device 800 and other devices in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as WiFi, an operator network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the device 800 to perform the above-described method is also provided. For example, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, comprising a computer program, characterized in that the computer program, when executed by a processor, implements the input method as described in any of the above embodiments.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. An input method, comprising:
responding to an element input event acting on the input box, and acquiring an element category corresponding to a current input element in the input box; the element categories comprise an index category and an operator category; the elements of the operator category are used for realizing the operation on the elements of the index category;
determining at least one candidate element corresponding to the current input element according to the element category corresponding to the current input element; when the element category corresponding to the current input element is the index category, the element category corresponding to the candidate element is the operator category; when the element category corresponding to the current input element is the operator category, the element category corresponding to the candidate element is the index category;
displaying an element frame at a position corresponding to the current input element, and displaying the at least one candidate element through the element frame;
in response to a selection operation for any one of the at least one candidate element in the element box, a selected candidate element is obtained and entered after the current input element of the input box.
2. The method of claim 1, wherein the presenting an element box in a position corresponding to the current input element comprises:
when the current input element is not the first element displayed in the input box, acquiring position offset information between the current input element and the first element displayed in the input box;
and moving the element frame by the distance shown by the position offset information.
3. The method of claim 2, wherein obtaining positional offset information between the current input element and the first element displayed in the input box comprises:
acquiring the width of an input element between the current input element and a first element input in the input box;
determining whether a lateral scroll control is present in the input box;
when the horizontal scroll control does not exist in the input box, taking the width of the input element as the position offset information;
and when the horizontal scroll control exists in the input box, acquiring the scroll distance of the horizontal scroll control, and taking the difference between the width of the input element and the scroll distance as the position offset information.
4. The method according to any one of claims 1 to 3, wherein when the number of candidate elements is greater than a preset first number threshold, an element scroll control is displayed in the element box; the element rolling control is used for controlling rolling display of a plurality of candidate elements;
the displaying the at least one candidate element through the element box includes:
determining a scroll position of the element scroll control in response to a scroll operation for the element scroll control;
and determining a candidate element to be shown corresponding to the rolling position from the plurality of candidate elements, and displaying the candidate element to be shown through the element frame.
5. The method according to any one of claims 1 to 3, wherein when the number of candidate elements is greater than a preset second number threshold, a key toggle control is displayed in the element box; the key switching control is used for controlling the switching display of a plurality of candidate elements;
the displaying the at least one candidate element through the element box includes:
responding to the triggering operation aiming at the key switching control, and determining the triggering times of the key switching control;
and determining candidate elements to be displayed corresponding to the triggering times from the candidate elements, and displaying the candidate elements to be displayed through the element frame.
6. The method of claim 1, wherein the number of candidate elements is plural; the displaying the at least one candidate element through the element box includes:
determining a display order of the plurality of candidate elements;
displaying the plurality of candidate elements in the element frame in the display order.
7. An input device, comprising:
an element category acquisition unit configured to perform acquisition of an element category corresponding to a currently input element in an input box in response to an element input event acting on the input box; the element categories comprise an index category and an operator category; the elements of the operator category are used for realizing the operation on the elements of the index category;
a candidate element determination unit configured to perform determining at least one candidate element corresponding to the current input element according to an element category corresponding to the current input element; when the element category corresponding to the current input element is the index category, the element category corresponding to the candidate element is the operator category; when the element category corresponding to the current input element is the operator category, the element category corresponding to the candidate element is the index category;
a candidate element display unit configured to display an element frame at a position corresponding to the current input element, and display the at least one candidate element through the element frame;
a candidate element input unit configured to perform a selection operation in response to any one of the at least one candidate element in the element frame, acquire a selected candidate element, and input the selected candidate element behind the current input element of the input frame.
8. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the input method of any one of claims 1 to 6.
9. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the input method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program realizes the input method of any of claims 1-6 when executed by a processor.
CN202110465470.5A 2021-04-28 2021-04-28 Input method, input device, electronic equipment and storage medium Pending CN113157112A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110465470.5A CN113157112A (en) 2021-04-28 2021-04-28 Input method, input device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110465470.5A CN113157112A (en) 2021-04-28 2021-04-28 Input method, input device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113157112A true CN113157112A (en) 2021-07-23

Family

ID=76871774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110465470.5A Pending CN113157112A (en) 2021-04-28 2021-04-28 Input method, input device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113157112A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108475157A (en) * 2016-03-25 2018-08-31 华为技术有限公司 Characters input method, device and terminal
CN110765735A (en) * 2019-09-25 2020-02-07 联想(北京)有限公司 Mathematical expression input method and device and electronic equipment
CN111078026A (en) * 2019-11-15 2020-04-28 北京乐我无限科技有限责任公司 Input prompting method and device, electronic equipment and readable storage medium
CN111124143A (en) * 2018-10-31 2020-05-08 北京国双科技有限公司 Method and device for inserting input element, storage medium and processor
CN111767691A (en) * 2020-06-30 2020-10-13 北京百度网讯科技有限公司 Calculation method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108475157A (en) * 2016-03-25 2018-08-31 华为技术有限公司 Characters input method, device and terminal
CN111124143A (en) * 2018-10-31 2020-05-08 北京国双科技有限公司 Method and device for inserting input element, storage medium and processor
CN110765735A (en) * 2019-09-25 2020-02-07 联想(北京)有限公司 Mathematical expression input method and device and electronic equipment
CN111078026A (en) * 2019-11-15 2020-04-28 北京乐我无限科技有限责任公司 Input prompting method and device, electronic equipment and readable storage medium
CN111767691A (en) * 2020-06-30 2020-10-13 北京百度网讯科技有限公司 Calculation method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
EP3454192B1 (en) Method and device for displaying page
CN107908351B (en) Application interface display method and device and storage medium
US11086482B2 (en) Method and device for displaying history pages in application program and computer-readable medium
US20180046336A1 (en) Instant Message Processing Method and Apparatus, and Storage Medium
CN114201133A (en) Split screen display method and device
CN105487805B (en) Object operation method and device
CN105138259A (en) Operation execution method and operation execution device
US10078422B2 (en) Method and device for updating a list
CN104133623B (en) Page zoom-in and zoom-out method and apparatus
CN104679599A (en) Application program duplicating method and device
CN112905103B (en) False touch processing method and device and storage medium
CN105786944B (en) Method and device for processing automatic page turning of browser
CN109358788B (en) Interface display method and device and terminal
CN115935099A (en) Information display method and device, electronic equipment and storage medium
CN113126843B (en) Method, device and storage medium for exchanging application icon positions
CN106325712B (en) Terminal display control method and device and terminal
CN106919302B (en) Operation control method and device of mobile terminal
CN106445376B (en) Webpage operation method and device
CN105955637B (en) Method and device for processing text input box
CN106020694B (en) Electronic equipment, and method and device for dynamically adjusting selected area
CN106126050A (en) Menu display method and device
CN106569697B (en) Picture viewing method and device and terminal
CN113157112A (en) Input method, input device, electronic equipment and storage medium
CN109213556B (en) Display method and device
CN113360051A (en) Search prompting method and device, mobile terminal and storage medium

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