Input method, device, electronic device and storage medium
By responding to element input events in the input box and displaying candidate element boxes, the problem of low efficiency in expression input in the prior art is solved, and a more intuitive and efficient expression input process is achieved.
Patent Information
- Application Number
- CN202110465470.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-28
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2041-04-28
AI Technical Summary
In the prior art, the input efficiency of expressions is low, mainly because the user needs to rely on the explanatory text on the page to input, resulting in the input process not being intuitive and efficient enough.
By responsive to the input box element input event, obtain the element category of the current input element and display the element box in its position to display the corresponding candidate elements. The user can select the element to be entered in the element box to achieve accurate input of the expression.
This method improves the input efficiency of expressions, allowing users to achieve accurate input without relying on explanatory text, significantly improving the intuitiveness and efficiency of the input process.
Smart Images

Figure CN113157112B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of information input technology, and in particular to an input method, device, electronic device and computer-readable storage medium. Background Art
[0002] With the development of information input technology, in some scenarios, such as big data analysis scenarios, it is necessary to input multiple indicator information and connect the multiple indicator information through input symbols to obtain an expression for data analysis composed of the multiple indicator information. The existing expression input method is that the user inputs the indicator information and the input symbol for connecting the indicator information into the input box to input the expression.
[0003] In the related art, since users can enter any information in the input box at will, the input expression may not meet the expression requirements. Therefore, the current method of inputting expressions is mainly to use the instructions displayed on the page to guide the expression input, so that users can input the expression according to the instructions. However, the expressiveness of the instructions is limited, so the expression input efficiency is low. Summary of the invention
[0004] The present disclosure provides an input method, device, electronic device and computer-readable storage medium to at least solve the problem of low efficiency of expression input in the related art. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, there is provided an input method, including:
[0006] In response to an element input event acting on an input box, an element category corresponding to a current input element in the input box is obtained; the element category includes an indicator category and an operator category; the elements of the operator category are used to implement operations on the elements of the indicator category;
[0007] Determine at least one candidate element corresponding to the current input element according to the element category corresponding to the current input element; wherein, when the element category corresponding to the current input element is the indicator 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 indicator category;
[0008] 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;
[0009] In response to a selection operation on any candidate element among the at least one candidate element in the element box, the selected candidate element is acquired, and the selected candidate element is input after the current input element in the input box.
[0010] In an exemplary embodiment, displaying an element box at a position corresponding to the current input element includes: when the current input element is not the first element displayed in the input box, obtaining position offset information between the current input element and the first element displayed in the input box; and moving the element box a distance indicated by the position offset information.
[0011] In an exemplary embodiment, obtaining the position offset information between the current input element and the first element displayed in the input box includes: obtaining the input element width between the current input element and the first element input in the input box; determining whether there is a horizontal scrolling control in the input box; when the horizontal scrolling control does not exist in the input box, using the input element width as the position offset information; when the horizontal scrolling control exists in the input box, obtaining the scrolling distance of the horizontal scrolling control, and using the difference between the input element width and the scrolling distance as the position offset information.
[0012] 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 scroll control is used to control the scrolling display of multiple candidate elements; displaying the at least one candidate element through the element frame includes: determining the scroll position of the element scroll control in response to a scroll operation on the element scroll control; determining a candidate element to be displayed corresponding to the scroll position from the multiple candidate elements, and displaying the candidate element to be displayed through the element frame.
[0013] In an exemplary embodiment, when the number of the candidate elements is greater than a preset second quantity threshold, a button switch control is displayed in the element box; the button switch control is used to control the switch display of multiple candidate elements; the displaying of the at least one candidate element through the element box includes: in response to a trigger operation on the button switch control, determining the number of times the button switch control is triggered; determining the candidate elements to be displayed corresponding to the number of triggering operations from the multiple candidate elements, and displaying the candidate elements to be displayed through the element box.
[0014] In an exemplary embodiment, there are multiple candidate elements; displaying the at least one candidate element through the element frame includes: determining a display order of the multiple candidate elements; and displaying the multiple candidate elements in the element frame according to the display order.
[0015] According to a second aspect of an embodiment of the present disclosure, there is provided an input device, including:
[0016] An element category acquisition unit is configured to execute in response to an element input event acting on the input box, and acquire an element category corresponding to a current input element in the input box; the element category includes an indicator category and an operator category; the elements of the operator category are used to implement operations on the elements of the indicator category;
[0017] a candidate element determination unit, configured to determine at least one candidate element corresponding to the current input element according to the element category corresponding to the current input element; wherein, when the element category corresponding to the current input element is the indicator 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 indicator category;
[0018] 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;
[0019] The candidate element input unit is configured to execute a selection operation in response to any candidate element of the at least one candidate element in the element box, obtain the selected candidate element, and input the selected candidate element after the current input element in the input box.
[0020] In an exemplary embodiment, the candidate element display unit is further configured to obtain position offset information between the current input element and the first element displayed in the input box when the current input element is not the first element displayed in the input box; and move the element box a distance indicated by the position offset information.
[0021] In an exemplary embodiment, the candidate element display unit is further configured to execute the steps of obtaining the input element width between the current input element and the first element input in the input box; determining whether there is a horizontal scrolling control in the input box; when the horizontal scrolling control does not exist in the input box, using the input element width as the position offset information; when the horizontal scrolling control exists in the input box, obtaining the scrolling distance of the horizontal scrolling control, and using the difference between the input element width and the scrolling distance as the position offset information.
[0022] 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 scroll control is used to control the scrolling display of multiple candidate elements; the candidate element display unit is further configured to execute a scrolling position of the element scroll control in response to a scrolling operation on the element scroll control; determine the candidate element to be displayed corresponding to the scrolling position from the multiple candidate elements, and display the candidate element to be displayed through the element frame.
[0023] In an exemplary embodiment, when the number of candidate elements is greater than a preset second number threshold, a button switch control is displayed in the element frame; the button switch control is used to control the switching display of multiple candidate elements; the candidate element display unit is further configured to execute a trigger operation in response to the button switch control, determine the number of times the button switch control is triggered; determine the candidate elements to be displayed corresponding to the number of triggers from the multiple candidate elements, and display the candidate elements to be displayed through the element frame.
[0024] In an exemplary embodiment, there are multiple candidate elements; the candidate element display unit is further configured to determine a display order of the multiple candidate elements; and display the multiple candidate elements in the element frame according to the display order.
[0025] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the input method as described in any of the above embodiments.
[0026] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the input method described in any of the above embodiments.
[0027] According to a fifth aspect of an embodiment of the present disclosure, there is provided a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the input method as described in any one of the above embodiments is implemented.
[0028] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0029] By responding to an element input event acting on an input box, an element category corresponding to the current input element in the input box is obtained; the element category includes an indicator category and an operator category; the elements of the operator category are used to implement operations on the elements of the indicator category; according to the element category corresponding to the current input element, at least one candidate element corresponding to the current input element is determined; wherein, when the element category corresponding to the current input element is an indicator category, the element category corresponding to the candidate element is an 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 indicator category; an element box is displayed at a position corresponding to the current input element, and at least one candidate element is displayed through the element box; in response to a selection operation for any candidate element in at least one candidate element in the element box, the selected candidate element is obtained, and the selected candidate element is input after the current input element in the input box. The present disclosure displays an element box at a position corresponding to the current input element and displays candidate elements in the element box, so that a user can select an element to be input in the element box, and accurate input of an expression can be achieved without an explanatory text, thereby improving the input efficiency of the expression.
[0030] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0032] Figure 1 The figure is a flow chart of an input method according to an exemplary embodiment.
[0033] Figure 2 The figure is a flowchart of displaying candidate elements to be displayed according to an exemplary embodiment.
[0034] Figure 3 The flowchart of determining position offset information is shown according to an exemplary embodiment.
[0035] Figure 4 The figure is a flow chart of an input method according to an exemplary embodiment.
[0036] Figure 5 It is a schematic diagram of an interface of an input method according to an exemplary embodiment.
[0037] Figure 6 is a schematic diagram of an interface of an input method according to another exemplary embodiment.
[0038] Figure 7is a block diagram of an input device according to an exemplary embodiment.
[0039] Figure 8 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0040] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0041] It should be noted that the embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0042] Figure 1 is a flow chart of an input method according to an exemplary embodiment. Figure 1 As shown, the input method is used in a terminal and includes the following steps.
[0043] In step S101, the terminal responds to an element input event acting on the input box and obtains an element category corresponding to the current input element in the input box; the element category includes an indicator category and an operator category; the elements of the operator category are used to implement operations on the elements of the indicator category.
[0044] Among them, the terminal can be but not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, the input box is an input box for inputting elements, and the input box can be displayed in the display interface of the terminal. When the user inputs the element into the input box through the terminal, the display interface of the terminal can be displayed with the input element that has been input, the current input element is the input element that has been input, and the element category can refer to the element category of the current input element, which can be an indicator category, such as a number or a letter representing a certain amount of data, etc., which is used for element calculation, and can also be an operator category for realizing the operation of the elements of the indicator category, such as a mathematical symbol element such as addition, subtraction, multiplication, division or equal sign between two numbers or letter indicators. Specifically, when the user needs to input an element into the input box, the corresponding element input event can be triggered to the terminal, and the terminal can respond to the triggered element input event, take the input element as the current input element, and judge whether the element category of the current input element belongs to the indicator category or the operator category.
[0045] In step S102, the terminal determines at least one candidate element corresponding to the current input element based on the element category corresponding to the current input element; wherein, when the element category corresponding to the current input element is an indicator category, the element category corresponding to the candidate element is an 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 indicator category.
[0046] Among them, the candidate element refers to the next element of the terminal's current input element, and the candidate element can be determined according to the element category of the current input element. Specifically, after the terminal obtains the element category of the current input element, it can determine one or more candidate elements according to the element category of the current input element. If the current input element is an indicator category, then the terminal can select at least one element from multiple operator category elements as a candidate element, and if the current input element is an operator category element, then the terminal can find at least one indicator category element from multiple indicator categories as a candidate element.
[0047] 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;
[0048] In step S104, in response to a selection operation on any candidate element among at least one candidate element in the element box, the terminal obtains the selected candidate element and inputs the selected candidate element after the current input element in the input box.
[0049] Specifically, the element box can carry multiple candidate elements. When the terminal obtains the candidate elements, it can display the element box carrying the candidate elements corresponding to the current input element at the position corresponding to the current input element, and receive the user's selection operation on the candidate elements displayed in the element box. For example, the user can click on the candidate element displayed in the element box and select the candidate element corresponding to the click position as the selected candidate element. The user can also operate the cursor in the element box through the keyboard, change the position of the cursor through the keyboard and determine it, and use the candidate element corresponding to the determined cursor position as the selected candidate element. Finally, the terminal inputs the selected candidate element after the current input element in the input box.
[0050] In the above input method, the terminal responds to the element input event acting on the input box, and obtains the element category corresponding to the current input element in the input box; the element category includes an indicator category and an operator category; the element of the operator category is used to implement the operation of the element of the indicator category; according to the element category corresponding to the current input element, at least one candidate element corresponding to the current input element is determined; wherein, when the element category corresponding to the current input element is an indicator category, the element category corresponding to the candidate element is an 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 indicator category; an element box is displayed at a position corresponding to the current input element, and at least one candidate element is displayed through the element box; in response to the selection operation of any candidate element in at least one candidate element in the element box, the selected candidate element is obtained, and the selected candidate element is input after the current input element of the input box. The present disclosure displays the element box at the position corresponding to the current input element and displays the candidate element in the element box, so that the user can select the element to be input in the element box, and the accurate input of the expression can be realized without the need for explanatory text, thereby improving the input efficiency of the expression.
[0051] 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 obtains position offset information between the current input element and the first element displayed in the input box; and moves the element box by the distance indicated by the position offset information.
[0052] Among them, 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 current input element needs to correspond to the element position of the current input element, when the position of the current input element changes, the position of the input box may also change accordingly. Therefore, in this embodiment, if the current input element is not the first element displayed in the input box, then the position of the element box corresponding to the current input element can be changed by moving the position of the input box. The position offset information refers to the offset information between the current input element and the first element displayed in the input box, which can be the offset distance between the current input element and the first element displayed in the input box, or it can be the offset character number between the previous input element and the first element displayed in the input box.
[0053] Specifically, the terminal can pre-set the position of the element box corresponding to the first element displayed in the input box, and after obtaining the position offset information of the element box corresponding to the current input element and the first element displayed in the input box, the terminal can use the distance represented by the position offset information to move the position of the element box corresponding to the current input element accordingly according to the offset distance.
[0054] In this embodiment, the position of the element box can also be changed according to the position of the current input element, which facilitates the user's selection of candidate elements, saves selection time, and thus improves the efficiency of element input.
[0055] Furthermore, if Figure 2 As shown, the terminal obtains the position offset information between the current input element and the first element displayed in the input box, which may further include:
[0056] In step S201 , the terminal obtains the input element width between the current input element and the first element input into the input box.
[0057] The first element entered in the input box refers to the first element entered into the input box by the terminal. Since the number of input elements may exceed the length of the pre-designed input box when the number is large, in this embodiment, a part of the expression with more input elements can be hidden by setting a horizontal scroll control in the input box, so that the user can change the input elements displayed in the input box in a similar way to changing the position of the horizontal scroll control of the element box. The terminal can determine the input element width between the current input element and the first element entered in the input box. For example, the terminal can use the two-dimensional context function of the canvas to read the font between the first input element to the current input element from the input box, and obtain the font width of the font as the input element width between the current input element and the first element entered in the input box.
[0058] In step S202, the terminal determines whether there is a horizontal scroll control in the input box;
[0059] In step S203, when there is no horizontal scroll control in the input box, the terminal uses the input element width as position offset information;
[0060] In step S204, when there is a horizontal scroll control in the input box, the terminal obtains the scroll distance of the scroll control, and uses the difference between the input element width and the scroll distance as position offset information.
[0061] Afterwards, the terminal can determine whether there is a horizontal scrolling control in the input box. If there is no horizontal scrolling control in the input box, it means that there is no hidden input element in the input box. Therefore, the terminal can directly use the obtained input element width as the position offset information between the current input element and the first element displayed in the input box. If there is a horizontal scrolling control in the input box, it means that there is an input element hidden in the input box. Therefore, the terminal needs to first determine the width of the input element hidden in the input box. By obtaining the scrolling distance of the horizontal scrolling control, the width of the hidden input element can be represented by the scrolling distance. After that, the terminal can subtract the above-mentioned scrolling distance, that is, the element width of the input element hidden in the input box, from the input element width obtained in step S301, that is, the element width of all input elements contained in the input box. The difference obtained is the element width of the input element displayed in the input box, which is used as the position offset information.
[0062] Furthermore, in this embodiment, the position of the candidate element can be determined by judging the input element width between the current input element and the first element input in the input box, and whether there is a horizontal scroll control in the input box, which can further ensure the accuracy of the obtained position offset information.
[0063] 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 scroll control is used to control the scroll display of multiple candidate elements; Figure 3 As shown, step S103 may further include:
[0064] In step S301, the terminal determines a scroll position of the element scroll control in response to a scroll operation on the element scroll control.
[0065] Among them, the element scroll control can be a control for changing the candidate elements displayed in the element frame by scrolling, for example, it can be a scroll bar, and the first quantity threshold can be the maximum number of candidate elements that can be displayed in the element frame preset by the user. When the number of candidate elements is greater than the first quantity threshold, that is, when all candidate elements cannot be displayed in the display frame, the element scroll control can be set and displayed in the element frame, and the candidate elements currently displayed in the element frame, that is, the candidate elements to be displayed, can be changed while adjusting the position of the displayed element scroll control. The way of changing can be that the user changes the scroll by clicking the element scroll control and dragging, or by using the direction control key of the keyboard to change the candidate element selected by the cursor. In the process of changing the candidate element selected by the cursor, if the candidate element selected by the cursor exceeds the range displayed by the current element frame, the corresponding scroll operation can also be triggered, thereby changing the scroll position of the element scroll control to change the candidate elements displayed in the element frame. Specifically, the user can initiate a scroll operation for the element scroll control to the terminal by clicking or operating the direction control key of the keyboard, and the terminal can respond to the scroll operation initiated by the user, and determine the current scroll position of the element scroll control while changing the scroll position of the element scroll control.
[0066] In step S302, the terminal determines a candidate element to be displayed corresponding to the scroll position from a plurality of candidate elements, and displays the candidate element to be displayed in an element frame.
[0067] Afterwards, the terminal may determine, according to the scrolling position of the current element scrolling control, a candidate element corresponding to the scrolling position of the current element scrolling control from among multiple candidate elements as a candidate element to be displayed, and display the candidate element to be displayed in the element frame.
[0068] In the above embodiment, the terminal can scroll and display the candidate elements in the element box through the element scroll control, and use different scroll positions to display different candidate elements to be displayed, which can save the space of the element box and accommodate more candidate elements, thereby improving the convenience of element input.
[0069] In another exemplary embodiment, when the number of candidate elements is greater than a preset second number threshold, a button switch control is displayed in the element box; the button switch control is used to control the switching display of multiple candidate elements; step S103 may further include: the terminal determines the number of times the button switch control is triggered in response to the trigger operation on the button switch control; determines the candidate elements to be displayed corresponding to the number of triggering times from multiple candidate elements, and displays the candidate elements to be displayed through the element box.
[0070] The key switch control can be a control that changes the candidate elements displayed in the element frame by triggering, for example, it can be some arrow controls displayed in the element frame, and the user can trigger the key switch control by clicking, and the terminal can change the candidate elements currently displayed in the element frame, that is, the display of the candidate elements to be displayed, according to the user's triggering operation on the key switch control. The second quantity threshold can also be the maximum number of candidate elements that can be displayed in the element frame preset by the user, and the threshold can be set to be the same as the first quantity threshold, or it can be set to be different from the first quantity threshold. Specifically, when the candidate elements displayed in the element frame are greater than the preset second quantity threshold, the terminal can display the key switch control in the element frame. If the user triggers the trigger operation for the key switch control by, for example, clicking the mouse, the terminal can count the number of triggers of the key switch control, such as the number of clicks by the user, and determine the candidate element to be displayed corresponding to the trigger number from multiple candidate elements, and display it through the element frame.
[0071] In this embodiment, the terminal can also switch and display the candidate elements in the element box through a button switching control, and use different switching times for the button switching control to display different candidate elements to be displayed, which can also save the space of the element box and accommodate more candidate elements, thereby improving the convenience of element input.
[0072] In addition, there are multiple candidate elements; step S103 may further include: the terminal determines a display order of the multiple candidate elements; and displays the multiple candidate elements in the element box according to the display order.
[0073] The display order refers to the display order of multiple candidate elements in the element box. The terminal can display multiple candidate elements in the element box according to the above display order. The display order can be set according to the user's habits. The terminal can count the input frequency of the user for each candidate element, and there can be a better display order for the candidate elements with high input frequency, so that the user can select some candidate elements with high input frequency more quickly. The terminal can also display the corresponding candidate elements according to a certain pre-set element order, such as alphabetical order or numerical order, etc., that is, if the current input element is an operator category element, the next input indicator type candidate element can be displayed in the input box in the alphabetical order of a, b, c, d.
[0074] In the above embodiment, the terminal may display multiple elements in order according to the display order, and may have a better display order for elements with a higher probability of being selected among the candidate elements, thereby further improving the input efficiency of the elements.
[0075] Figure 4is a flow chart of an input method according to an exemplary embodiment. Figure 4 As shown, the input method is used in a terminal and includes the following steps.
[0076] In step S401, the terminal obtains the element category corresponding to the current input element in the input box in response to the element input event acting on the input box; the element category includes the indicator category and the operator category; the element of the operator category is used to implement the operation on the element of the indicator category;
[0077] 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; wherein, when the element category corresponding to the current input element is the indicator 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 indicator category;
[0078] In step S403, when the current input element is not the first element displayed in the input box, the terminal obtains the input element width between the current input element and the first element input in the input box; determines whether there is a scroll control in the input box;
[0079] In step S404, the terminal obtains the input element width between the current input element and the first element input in the input box;
[0080] In step S405, when there is no horizontal scroll control in the input box, the terminal uses the input element width as position offset information;
[0081] In step S406, when there is a horizontal scroll control in the input box, the terminal obtains the scroll distance of the horizontal scroll control, and uses the difference between the input element width and the scroll distance as the position offset information;
[0082] In step S407, the terminal moves the element frame by the distance indicated by the position offset information;
[0083] In step S408, the terminal determines a display order of the plurality of candidate elements; and displays the plurality of candidate elements in the element frame according to the display order;
[0084] In step S409, the terminal determines the scroll position of the element scroll control in response to the scroll operation on the element scroll control; determines the candidate element to be displayed corresponding to the scroll position from the multiple candidate elements, and displays the candidate element to be displayed through the element frame;
[0085] In step S410, the terminal determines the triggering times of the key switch control in response to the triggering operation on the key switch control; determines the candidate elements to be displayed corresponding to the triggering times from multiple candidate elements, and displays the candidate elements to be displayed through the element box;
[0086] In step S411, in response to a selection operation on any candidate element among at least one candidate element in the element box, the terminal obtains the selected candidate element and inputs the selected candidate element after the current input element in the input box.
[0087] In the above embodiment, the terminal displays the element box at the position corresponding to the current input element and displays the candidate elements in the element box, so that the user can select the element to be input in the element box, and the accurate input of the expression can be realized without the need for explanatory text, thereby improving the input efficiency of the expression. At the same time, the position of the element box can also be changed according to the position of the current input element, which is also convenient for the user to select the candidate element, saving the selection time, thereby improving the efficiency of element input. In addition, the position of the candidate element can be determined by judging the input element width between the current input element in the input box and the first element input in the input box, and whether there is a horizontal scrolling control in the input box, which can further ensure the accuracy of the obtained position offset information. In addition, the terminal can scroll and display the candidate elements in the element box through the display control, and display different candidate elements to be displayed by using different scrolling positions, or switch and display the candidate elements in the element box through the key switching control, and display different candidate elements to be displayed by using different switching times for the key switching control, which can save the space occupied by the element box and accommodate more candidate elements, thereby improving the convenience of element input. In addition, the terminal may also display multiple elements in order according to the display order, and may have a better display order for elements with a higher probability of being selected among the candidate elements, thereby further improving the input efficiency of the elements.
[0088] In an exemplary embodiment, an input method is also provided. The method adds a function selected from a drop-down box when operating a composite indicator by pulling down candidate items, and provides certain guidance and completion functions for the user's composite indicator operation, so that the user can correctly and clearly understand the use and combine the correct composite indicator. The specific effect can be as follows:
[0089] (1) In the input element box on the page, users can type any element. Therefore, when users combine composite indicators, they need to be given certain prompts and completions. A drop-down box is designed to provide prompts when typing indicators. When users enter valid indicators such as ABC in the input box, and the previous cursor position is a valid indicator, the drop-down box displays the corresponding optional operators +-* / , etc., such as Figure 5 shown.
[0090] (2) If the previous cursor position is a valid operator such as +-* / , the corresponding optional operation displayed in the drop-down box is the current optional valid indicator, such as Figure 6 shown.
[0091] By combining the drop-down selection box with the input box, when the user enters content, the position of the drop-down box should also move with the cursor position. This can provide guidance and completion functions for the user's composite indicator combination operation.
[0092] In order to realize the above functions, the following key technical points are needed for support:
[0093] (1) Create a drop-down input box template
[0094] Use HTML+CSS technology to create a drop-down box input panel. Note that a scroll bar is added to it. If there are too many candidate words, the candidate words will be displayed in the scroll bar.
[0095] (2) Get the width of the typed text
[0096] The purpose of getting the text width is to calculate the offset position of the current drop-down box panel. As the text is input, the position of the drop-down box panel should be offset with the position of the text. Here, canvas can be used to calculate the text width. First, create a 2D canvas context to get the font of the rendered text, that is, the text from the input box to the position selected by the cursor, and pass the font to the canvas context.
[0097] For web page elements, we need to monitor its input, click, mouse leave, keyboard events and other events. In these events, each event operation must obtain the element's information such as the leftmost element and rightmost element in the selection area, whether there is a scroll bar, and the distance of the scroll bar from the left. After that, call the canvas's calculate text length method to obtain the length of the selected text, and determine the offset position of the current drop-down box panel based on whether there is a scroll bar in the input box. 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 box is the selected text length minus the scroll bar distance from the left.
[0098] (3) Listening for keyboard events
[0099] The drop-down candidate box supports the use of the keyboard to control the selection. By listening to the keyboard events of the input element, the currently activated option is selected. If there are many options, if the distance exceeds the scroll bar, the displacement of the scroll bar is also controlled by calculation to the currently activated element.
[0100] In the above embodiment, a tab similar to the operating system input method drop-down box can be simulated through a canvas and a customized drop-down box element. The tab moves with the cursor position and displays different candidate contents with different input characters. When the user enters a combined composite indicator, certain completion and guidance are performed.
[0101] It should be understood that although Figure 1-4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-4 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0102] Figure 7 is a block diagram of an input device according to an exemplary embodiment. Figure 7 The device 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.
[0103] The element category acquisition unit 701 is configured to execute in response to the element input event acting on the input box, and acquire the element category corresponding to the current input element in the input box; the element category includes the indicator category and the operator category; the element of the operator category is used to implement the operation on the element of the indicator category;
[0104] The candidate element determination unit 702 is configured to determine at least one candidate element corresponding to the current input element according to the element category corresponding to the current input element; wherein, when the element category corresponding to the current input element is the indicator 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 indicator category;
[0105] The candidate element display unit 703 is configured to display an element frame at a position corresponding to the current input element, and display at least one candidate element through the element frame;
[0106] The candidate element input unit 704 is configured to execute a selection operation in response to any candidate element of at least one candidate element in the element box, obtain the selected candidate element, and input the selected candidate element after the current input element of the input box.
[0107] In an exemplary embodiment, the candidate element display unit 703 is further configured to obtain position offset information between the current input element and the first element displayed in the input box when the current input element is not the first element displayed in the input box; and move the element box by the distance indicated by the position offset information.
[0108] In an exemplary embodiment, the candidate element display unit 703 is further configured to execute the steps of obtaining the input element width between the current input element and the first element input in the input box; determining whether there is a horizontal scrolling control in the input box; when there is no horizontal scrolling control in the input box, using the input element width as the position offset information; when there is a horizontal scrolling control in the input box, obtaining the scrolling distance of the horizontal scrolling control, and using the difference between the input element width and the scrolling distance as the position offset information.
[0109] 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 scroll control is used to control the scrolling display of multiple candidate elements; the candidate element display unit 703 is further configured to execute a scrolling operation in response to the element scrolling control, determine the scrolling position of the element scrolling control; determine the candidate elements to be displayed corresponding to the scrolling position from the multiple candidate elements, and display the candidate elements to be displayed through the element box.
[0110] In an exemplary embodiment, when the number of candidate elements is greater than a preset second quantity threshold, a key switch control is displayed in the element box; the key switch control is used to control the switching display of multiple candidate elements; the candidate element display unit 703 is further configured to execute a trigger operation in response to the key switch control, determine the number of times the key switch control is triggered; determine the candidate elements to be displayed corresponding to the number of triggers from multiple candidate elements, and display the candidate elements to be displayed through the element box.
[0111] In an exemplary embodiment, there are multiple candidate elements; the candidate element display unit 703 is further configured to determine the display order of the multiple candidate elements; and display the multiple candidate elements in the element box according to the display order.
[0112] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0113] Figure 8 8 is a block diagram of a device 800 for input according to an exemplary embodiment. For example, the device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0114] Reference Figure 8 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0115] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0116] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, 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 disk, or optical disk.
[0117] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0118] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the 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 input signals from the 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 boundaries of the 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 camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0119] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0120] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0121] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects 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.
[0122] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, a carrier 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 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0123] 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, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0124] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of the device 800 to perform the above method. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0125] In an exemplary embodiment, a computer program product is further provided, comprising a computer program, wherein the computer program implements the input method as described in any of the above embodiments when executed by a processor.
[0126] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0127] It should be understood that the present disclosure is not limited to the exact structures that have been 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
1. An input method, characterized in that: include: In response to an element input event acting on an input box, an element category corresponding to a current input element in the input box is obtained; the element category includes an indicator category and an operator category; the elements of the operator category are used to implement operations on the elements of the indicator category; Determine at least one candidate element corresponding to the current input element according to the element category corresponding to the current input element; wherein, when the element category corresponding to the current input element is the indicator 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 indicator category; Displaying an element frame at a position corresponding to the current input element, wherein, when the current input element is not the first element displayed in the input frame, obtaining position offset information between the current input element and the first element displayed in the input frame, wherein the position offset is determined according to an offset distance and / or a number of offset characters, and moving the element frame by a distance indicated by the position offset information; and displaying the at least one candidate element through the element frame; In response to a selection operation on any candidate element among the at least one candidate element in the element box, the selected candidate element is acquired, and the selected candidate element is input after the current input element in the input box.
2. The method according to claim 1, characterized in that The obtaining of the position offset information between the current input element and the first element displayed in the input box includes: Get the input element width between the current input element and the first element entered in the input box; Determine whether there is a horizontal scroll control in the input box; When the horizontal scroll control does not exist in the input box, the input element width is used as the position offset information; When the horizontal scroll control exists in the input box, the scroll distance of the horizontal scroll control is obtained, and the difference between the input element width and the scroll distance is used as the position offset information.
3. The method according to any one of claims 1 to 2, characterized in that: When the number of the candidate elements is greater than a preset first number threshold, an element scroll control is displayed in the element frame; The element scrolling control is used to control the scrolling display of multiple candidate elements; The displaying the at least one candidate element by the element frame includes: In response to a scrolling operation on the element scrolling control, determining a scrolling position of the element scrolling control; A candidate element to be displayed corresponding to the scroll position is determined from the multiple candidate elements, and the candidate element to be displayed is displayed through the element frame.
4. The method according to any one of claims 1 to 2, characterized in that: When the number of the candidate elements is greater than a preset second number threshold, a button switching control is displayed in the element frame; the button switching control is used to control the switching display of multiple candidate elements; The displaying the at least one candidate element by the element frame includes: In response to a trigger operation on the key switch control, determining a triggering number of the key switch control; Determine a candidate element to be displayed corresponding to the triggering number from the multiple candidate elements, and display the candidate element to be displayed through the element frame.
5. The method according to claim 1, characterized in that The number of the candidate elements is multiple; and the displaying of the at least one candidate element by the element frame includes: Determining a display order of the plurality of candidate elements; The plurality of candidate elements are displayed in the element frame according to the display order.
6. An input device, characterized in that: include: An element category acquisition unit, configured to execute in response to an element input event acting on the input box, and acquire an element category corresponding to a current input element in the input box; The element category includes an indicator category and an operator category; the elements of the operator category are used to implement operations on the elements of the indicator category; a candidate element determination unit, configured to determine at least one candidate element corresponding to the current input element according to the element category corresponding to the current input element; wherein, when the element category corresponding to the current input element is the indicator 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 indicator category; A candidate element display unit is configured to display an element frame at a position corresponding to the current input element, wherein when the current input element is not the first element displayed in the input frame, obtain position offset information between the current input element and the first element displayed in the input frame, the position offset is determined according to an offset distance and / or an offset character number, and move the element frame by a distance indicated by the position offset information; and display the at least one candidate element through the element frame; The candidate element input unit is configured to execute a selection operation in response to any candidate element of the at least one candidate element in the element box, obtain the selected candidate element, and input the selected candidate element after the current input element in the input box.
7. The device according to claim 6, characterized in that The candidate element display unit is further configured to execute the steps of obtaining the input element width between the current input element and the first element input in the input box; determining whether there is a horizontal scrolling control in the input box; when there is no horizontal scrolling control in the input box, using the input element width as the position offset information; when there is a horizontal scrolling control in the input box, obtaining the scrolling distance of the horizontal scrolling control, and using the difference between the input element width and the scrolling distance as the position offset information.
8. The device according to any one of claims 6 to 7, characterized in that When the number of the candidate elements is greater than a preset first number threshold, an element scroll control is displayed in the element frame; the element scroll control is used to control the scroll display of multiple candidate elements; the candidate element display unit is further configured to execute a scrolling operation in response to the element scrolling control, determine the scrolling position of the element scrolling control; determine the candidate element to be displayed corresponding to the scrolling position from the multiple candidate elements, and display the candidate element to be displayed through the element frame.
9. The device according to any one of claims 6 to 7, characterized in that When the number of the candidate elements is greater than a preset second number threshold, a key switch control is displayed in the element frame; the key switch control is used to control the switching display of multiple candidate elements; the candidate element display unit is further configured to execute a trigger operation in response to the key switch control, and determine the triggering number of the key switch control; Determine a candidate element to be displayed corresponding to the triggering number from the multiple candidate elements, and display the candidate element to be displayed through the element frame.
10. The device according to claim 6, characterized in that The number of the candidate elements is multiple; the candidate element display unit is further configured to determine the display order of the multiple candidate elements; and display the multiple candidate elements in the element frame according to the display order.
11. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the input method as claimed in any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the input method as claimed in any one of claims 1 to 5.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the input method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Input prompting method and device, electronic equipment and readable storage medium
CN111078026A
Input element insertion method and device, storage medium and processor
CN111124143A