Keyboard adjustment method and device, electronic equipment and storage medium

By adjusting the position and size of the input method keyboard area, redrawing the input view, and adjusting the clickable area of ​​the keyboard window, the problems of complex keyboard adjustment and obscuring the input box were solved, achieving a simple and quick floating effect.

CN122131957APending Publication Date: 2026-06-02CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
Filing Date
2026-02-25
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In existing technologies, adjusting the size and position of the keyboard requires modifying the keyboard window properties, which is complex and slow. Furthermore, in scenarios where input is made in a dialog pop-up window, the soft keyboard in the floating window state will obscure the input box.

Method used

By responding to keyboard adjustment commands, the position and size of the adjusted input method keyboard area are determined, the input view is redrawn, and the clickable area of ​​the keyboard window is adjusted. The received trigger events are transmitted to the lower-level application to avoid modifying the keyboard window properties.

Benefits of technology

It implements a simple and quick keyboard adjustment method that achieves a floating effect without obscuring the input box, and has a faster response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122131957A_ABST
    Figure CN122131957A_ABST
Patent Text Reader

Abstract

This application provides a keyboard adjustment method, apparatus, electronic device, and storage medium. The method, in response to a keyboard adjustment command for an input method keyboard, determines the adjusted area position and size of the input method keyboard, redraws the input view of the input method keyboard based on the adjusted area position and size, and adjusts the clickable area of ​​the keyboard window. When a trigger event is received in an area other than the clickable area of ​​the keyboard window, the trigger event is transmitted to the lower-level application. Through this method, the size and position of the input view and the clickable area of ​​the keyboard window are adjusted without modifying the window attributes to pop-up attributes, making keyboard adjustment simpler and faster. It achieves a floating effect without requiring the window attributes to be modified to pop-up attributes and does not obscure the input box.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a keyboard adjustment method, apparatus, electronic device, and storage medium. Background Technology

[0002] In recent years, soft keyboards (virtual keyboards) have become the primary tool for users to input text. In related technologies, soft keyboards are often fixed at the bottom of the screen. When the soft keyboard pops up, the system adjusts the layout of the application window to prevent the input box from being obscured, for example, placing the input box on top of the soft keyboard. When it's necessary to shrink or drag the keyboard, the overall size and properties of the keyboard window need to be modified. For example, when shrinking the keyboard, the window properties need to be changed to floating window properties first, and then the window size needs to be modified. A floating window floats above other application windows, and dragging it moves the entire window. Implementing a floating keyboard by modifying window properties is relatively complex, and in dialog input scenarios, the input box does not move adaptively with the floating window, causing the soft keyboard in floating window mode to obscure the input box. Summary of the Invention

[0003] This application provides a keyboard adjustment method, device, electronic device, and storage medium to solve the technical problems in the related art where adjusting the size and position of the keyboard requires modifying the keyboard window attributes, which is complicated, slow, and the soft keyboard in the floating window state will obscure the input box in the scenario of dialog pop-up input.

[0004] This application provides a keyboard adjustment method, the method comprising: in response to a keyboard adjustment command for an input method keyboard, determining the adjusted area position and adjusted area size of the input method keyboard; redrawing the input view of the input method keyboard according to the adjusted area position and adjusted area size; adjusting the clickable area of ​​the keyboard window of the input method keyboard according to the adjusted area position and adjusted area size; and transmitting the trigger event to the lower-level application when a trigger event is received in an area other than the adjusted clickable area of ​​the keyboard window of the input method keyboard.

[0005] In one embodiment of this application, adjusting the clickable area of ​​the keyboard window of the input method keyboard according to the adjusted area position and the adjusted area size includes: determining the target area of ​​the clickable area of ​​the keyboard window according to the adjusted area position and the adjusted area size; and adjusting the clickable area of ​​the keyboard window to be consistent with the target area.

[0006] In one embodiment of this application, the method further includes: adjusting the clickable area of ​​the keyboard window of the input method keyboard according to the adjusted area position and the adjusted area size, including: determining the current adjustment position according to the adjusted area position and a preset position adjustment rule; determining the current adjustment size according to the adjusted area size and a preset size adjustment rule; determining the target area of ​​the clickable area of ​​the keyboard window based on the current adjustment position and the current adjustment size; and adjusting the clickable area of ​​the keyboard window to be consistent with the target area.

[0007] In one embodiment of this application, the method further includes: when the keyboard adjustment instruction is received, keeping the pop-up window attribute of the keyboard window of the input method keyboard unchanged.

[0008] In one embodiment of this application, determining the adjusted region position and the adjusted region size includes: in response to a drag operation on the input view, obtaining the real-time drag position of the drag operation, the drag operation including movement control of a drag target of the input view, the drag target including a preset drag button or a preset drag response area; obtaining the initial position of the input view; and determining the adjusted region position and the adjusted region size based on the initial position and the real-time drag position.

[0009] In one embodiment of this application, the method further includes: when the drag operation ends, triggering a step of redrawing the input view of the input method keyboard according to the adjusted region position and the adjusted region size.

[0010] In one embodiment of this application, determining the adjusted region position and the adjusted region size includes: in response to a scaling operation on the input view, obtaining the coordinates of the upper left corner and the lower right corner of the input view at the end of the scaling operation, and determining the adjusted region position and the adjusted region size based on the upper left corner and the lower right corner coordinates.

[0011] This application embodiment also provides a keyboard adjustment device, which includes: a determining module, used to determine the adjusted area position and adjusted area size of the input method keyboard in response to a keyboard adjustment command for the input method keyboard; an input view adjustment module, used to redraw the input view of the input method keyboard according to the adjusted area position and adjusted area size; and a keyboard window clickable area adjustment module, used to adjust the clickable area of ​​the keyboard window of the input method keyboard according to the adjusted area position and adjusted area size, and when a trigger event is received in an area other than the adjusted keyboard window clickable area of ​​the keyboard window of the input method keyboard, the trigger event is transmitted to the lower-level application.

[0012] This application also provides an electronic device, including: a memory storing a computer program thereon; and a processor for executing the computer program in the memory to implement the steps of the method described in any of the above embodiments.

[0013] This invention also provides a computer-readable storage medium having a computer program stored thereon, the computer program being used to cause a computer to perform the method provided in any of the above embodiments.

[0014] The beneficial effects of this application are as follows: The keyboard adjustment method, apparatus, electronic device, and storage medium proposed in this application method determine the adjusted area position and size of the input method keyboard in response to a keyboard adjustment command for the input method keyboard. The method then redraws the input view of the input method keyboard based on the adjusted area position and size, and adjusts the clickable area of ​​the keyboard window based on the adjusted area position and size. When a trigger event is received in an area other than the clickable area of ​​the keyboard window, the trigger event is transmitted to the lower-level application. Through this method, the size and position of the input view and the clickable area of ​​the keyboard window are adjusted without modifying the window attributes of the input method keyboard to pop-up attributes. This makes keyboard adjustment simpler and faster, achieving a floating effect without requiring modification of the window attributes to pop-up attributes. Furthermore, the floating effect achieved in this way does not obscure the input box. Attached Figure Description

[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0016] In the attached diagram:

[0017] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application; Figure 2 This is a schematic diagram illustrating another application scenario provided by an embodiment of this application; Figure 3 A schematic diagram illustrating the implementation of a pop-up window solution provided in another related technology for the embodiments of this application; Figure 4 This is a schematic diagram illustrating another application scenario provided by an embodiment of this application; Figure 5 A schematic flowchart illustrating a keyboard adjustment method provided in one embodiment of this application; Figure 6 A schematic flowchart illustrating an input method keyboard display process according to an embodiment of this application; Figure 7 This is a schematic diagram of an input method keyboard in a portrait screen scenario according to an embodiment of the present invention; Figure 8 This is a schematic diagram of an input method keyboard in a landscape mode according to an embodiment of the present invention; Figure 9 This is another schematic diagram of an input method keyboard in a landscape mode according to an embodiment of the present invention; Figure 10 A flowchart illustrating the input method keyboard zooming and dragging process provided in an embodiment of this application; Figure 11 A schematic diagram of a keyboard adjustment device provided in an embodiment of this application; Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0018] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0019] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. The drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the shape, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0020] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the present application. However, it will be apparent to those skilled in the art that embodiments of the present application may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the present application.

[0021] In this application, the collection and processing of data such as user dragging and clicking on the interface must strictly comply with the requirements of relevant national laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.

[0022] In related technologies, the implementation of keyboard shrinking and dragging is achieved by modifying the overall size and properties of the keyboard window. When the keyboard is shrunk, the window properties are first changed to floating window properties and then the window size is modified. The floating window floats above other application windows, and the entire window moves when dragged. The implementation of the floating keyboard by modifying window properties is relatively complicated. In the scenario of dialog input, the floating window does not allow the input control to move adaptively, which may cause it to obscure the input box.

[0023] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. For example... Figure 1 As shown, there is an input box 120 at the bottom of the display interface 110. When the input box receives an input trigger operation, it will display the input focus 130. Please refer to [link / reference]. Figure 2 , Figure 2 This is a schematic diagram illustrating another application scenario provided by an embodiment of this application. For example... Figure 2 As shown, in Figure 1 Based on this, when input focus is present, the input method service is notified to display the input method keyboard, which is then displayed. In related technologies, if the size or position of the input method keyboard needs to be adjusted, the keyboard window property of the input method keyboard (soft keyboard) needs to be changed to a pop-up window property. For this, please refer to [link to relevant documentation]. Figure 3 , Figure 3 This is a schematic diagram illustrating the implementation of a pop-up window solution provided in another related technology as an embodiment of this application. For example... Figure 3 As shown, in Figure 2 Based on this, when the keyboard window properties are changed to pop-up properties, the input box 120 will return to... Figure 1 When the input method keyboard 140 is positioned in the middle, it will be placed on the top layer, which will cover the input box 120. The user needs to move the input method keyboard 140 again to display the input box 120.

[0024] Please see Figure 4 , Figure 4 This is a schematic diagram illustrating another application scenario provided by an embodiment of this application. For example... Figure 4 As shown, after using the keyboard adjustment method provided in this embodiment, in Figure 2Building upon this, when a keyboard hovering effect is needed, it's not necessary to modify the keyboard window properties to hover. Instead, the hovering effect is achieved by adjusting the keyboard input view and the clickable area of ​​the keyboard window. At this point, as shown... Figure 4 As shown, to more clearly display the boundaries of each area, some lines and areas are represented by color. When a keyboard adjustment command is received for the input method keyboard 140, the position and size of the adjusted area can be determined based on the keyboard adjustment command. Taking the keyboard adjustment command as a shrink command as an example, after executing the shrink command, the input view 141 of the input method keyboard shrinks to [size missing]. Figure 4 The area shown includes a section with keyboard buttons; the clickable area 142 of the keyboard window is reduced to... Figure 4 The green area shown here is an example where both areas are the same; the keyboard window 143 remains unchanged. Figure 2 The displayed position remains unchanged. The keyboard window's properties have not been modified to pop-up properties. When the input method keyboard's window area, excluding the clickable area of ​​the adjusted keyboard window, receives a triggered event, that is... Figure 4 When the white area within the keyboard window (the area inside the red border) receives a trigger event, the input method keyboard stops responding; instead, the underlying application corresponding to the triggering event takes over. When the input view's area is smaller than the keyboard window's area, the area outside the adjusted clickable area of ​​the keyboard window (the non-clickable area) is transparent, allowing users to easily view the application interface and other information of the underlying application corresponding to the non-clickable area of ​​the keyboard window.

[0025] It should be noted that, Figure 4 This is just one specific embodiment as an example. The specific display content in the input view, keyboard layout, etc., can be set by those skilled in the art as needed.

[0026] It should be noted that, Figure 4 The keyboard window's position shown here is merely an example; as another example, the keyboard window can also fill the entire display screen. The specific implementation method is similar to the description above and will not be repeated here.

[0027] As an example, this method can be applied to adjusting the input method keyboard on the display interface of an in-vehicle infotainment system. This method can also be applied to adjusting the input method keyboard on the display interface of a mobile terminal.

[0028] It should be noted that the above scenario is only an example of an application scenario provided by the embodiments of this application. The method can also be applied to other scenarios according to the user's needs. The embodiments of this application do not limit the actual form of various devices, components, etc. included in the scenario. In the specific application of the solution, it can be set according to actual needs.

[0029] Please see Figure 5 , Figure 5 A schematic flowchart illustrating a keyboard adjustment method provided in one embodiment of this application is shown below. Figure 5 As shown, the method includes the following steps: Step S510: In response to the keyboard adjustment command for the input method keyboard, determine the adjusted area position and adjusted area size of the input method keyboard.

[0030] In one embodiment, before determining the adjusted area position and size of the input method keyboard in response to a keyboard adjustment instruction for the input method keyboard, the method includes: displaying the original input method keyboard in response to a user's click operation on a pop-up window.

[0031] As an example, a pop-up window can be an input control such as an input box.

[0032] The input method keyboard can be activated and displayed by using the input method keyboard activation function, thus achieving the effect of displaying the input method keyboard.

[0033] Please see Figure 6 , Figure 6 A schematic flowchart illustrating an input method keyboard display process according to an embodiment of this application is shown below. Figure 6 As shown, an exemplary input method keyboard display process is as follows: Clicking the input box (EditText) gives the input box input focus. The keyboard is displayed through the InputMethodManager.startInput method (the method to start input in the input box) and the InputMethodManager.showSoftInput method (the method to notify the input method service to display the keyboard). The InputMethodService service class (the input method service class) creates the keyboard UI through the onCreateInputView method (constructs and returns the view of the "keyboard" on the input method interface). When the setInputView method is executed, the keyboard's width and height attributes (size) and position are set through resetInputViewSize() (a function used to reset or adjust the size of the input method view (input view)) and the keyboard is added to the window. Finally, the keyboard is displayed through the show method. The input keyboard is displayed at the bottom of the screen by default, with the width consistent with the screen width and a fixed height. When the device is displayed in landscape mode, the keyboard width is still consistent with the screen width by default, resulting in the keyboard occupying a large space and obscuring part of the interface. By shrinking the keyboard and dragging the keyboard (input view), more content can be displayed on the screen.

[0034] The size and position of the input method keyboard are adjusted by resizing and repositioning the input view. The `resetInputViewSize()` method retrieves the current layout parameters (size, position, etc.) of the input view. The `getLayoutParams()` method calculates the adjusted keyboard width. `lp.width`, `lp.height`, and `lp.gravity` represent the keyboard width, height, and alignment, respectively, including `Gravity.BOTTOM` (aligning the keyboard to the bottom of the parent container, such as a window). The `inputView.setLayoutParams(lp)` method triggers a re-layout of the input view, applying the new size and alignment.

[0035] The keyboard's input view is translated horizontally along the X-axis using `setTranslationX(SPUtils.getFloat(“TRANSLATION_X”, 0))`, with the X-axis offset read from SharedPreferences. Similarly, the keyboard's input view is translated vertically along the Y-axis using `setTranslationY(SPUtils.getFloat(“TRANSLATION_Y”, 0))`, again read from SharedPreferences. This allows the keyboard's input view to move vertically, creating a floating keyboard effect that can be placed anywhere on the screen. The parameter 0 is the default value; it returns 0 if the key does not exist. The new size is dynamically calculated based on the current device screen, configuration, or user settings. Upon receiving the new parameters, the keyboard's input view is redrawn, and its size changes accordingly. An example code example is shown below: public void resetInputViewSize() { FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams)inputView.getLayoutParams(); lp.width = getInputViewWidth(); lp.height = getInputViewHeight(); lp.gravity = Gravity.BOTTOM; inputView.setLayoutParams(lp); setTranslationX(SPUtils.getFloat(“TRANSLATION_X”, 0)); setTranslationY(SPUtils.getFloat(“TRANSLATION_Y”, 0)); } The adjustment instructions include changes to the position and size of the input method keyboard area. These instructions can be obtained through a combination of methods such as voice interaction, user touch input, swipe input, and click input. This allows the determination of the adjusted area's position and size; for example, the top-left and bottom-right corners can be used as the adjusted area's position and size information, while the length and width can be used as the adjusted area's size information.

[0036] As an example, if the keyboard adjustment command is to drag the input view, which only changes its position and not its size, then the size of the adjusted area is the same as the original size, but its position is different. If the keyboard adjustment command is to zoom in or out of the input view, then the size of the adjusted area will be different from the original size. If the keyboard adjustment command zooms in or out of the input view, and the adjusted area position includes the positions of the top-left and bottom-right vertices of the input view, taking a left-aligned layout as an example, then the position of one top-left vertex will remain unchanged, while the position of the other bottom-right vertex will change. If the input view is centered within the keyboard window area, then the positions of all areas will change after adjustment. The above is just one example of how the adjusted area position can be represented; those skilled in the art can also set other representations, such as the coordinates of the bottom-left and top-right vertices.

[0037] The shape of the input view is only an example of a rectangle, and the specific shape is not limited to a rectangle. Other shapes required by those skilled in the art can also be used. Step S520: Redraw the input view of the input method keyboard according to the adjusted area position and adjusted area size.

[0038] Once the adjusted region position and size are obtained, the input view of the input method keyboard before adjustment needs to be hidden. Then, the input view of the input method keyboard is redrawn based on the adjusted region position and size. The specific redrawing method can be implemented in a way known to those skilled in the art, and will not be elaborated here. It can be understood that as the new input view is displayed, the old input view is adaptively eliminated, and only one input view exists at any given time.

[0039] In one embodiment, the input view displays keyboard content, such as keyboard keys and input method adjustment controls.

[0040] Step S530: Adjust the clickable area of ​​the keyboard window of the input method keyboard according to the adjusted area position and adjusted area size.

[0041] The clickable area of ​​the keyboard window can be understood as an area where any event triggered by the input method keyboard will be responded to. These events are not limited to clicks; they can also include long presses, swipes, and other operations.

[0042] In one embodiment, adjusting the clickable area of ​​the keyboard window of the input method keyboard according to the adjusted area position and the adjusted area size includes: determining the target area of ​​the clickable area of ​​the keyboard window according to the adjusted area position and the adjusted area size; and adjusting the clickable area of ​​the keyboard window to be consistent with the target area.

[0043] It is understandable that the clickable area of ​​the keyboard window and the area where the input view is located overlap at this time.

[0044] In another embodiment, adjusting the clickable area of ​​the keyboard window of the input method keyboard according to the adjusted area position and the adjusted area size includes: determining the current adjustment position according to the adjusted area position and a preset position adjustment rule; determining the current adjustment size according to the adjusted area size and a preset size adjustment rule; determining the target area of ​​the clickable area of ​​the keyboard window based on the current adjustment position and the current adjustment size; and adjusting the clickable area of ​​the keyboard window to match the target area. Depending on the setting of the preset position adjustment rule and the preset size adjustment rule, the clickable area of ​​the keyboard window may be located inside the area where the input view is located, or the clickable area of ​​the keyboard window may include the area where the input view is located, but be slightly larger than the area where the input view is located. As an example, it is necessary to ensure that the clickable area of ​​the keyboard window covers the display area of ​​all input buttons and other icons in the input view that can respond to user operations, to avoid the problem that the input method keyboard does not respond when the user clicks the input button due to an unreasonable setting of the clickable area of ​​the keyboard window.

[0045] As an example, the preset position adjustment rules include, but are not limited to, any of the following: Maintaining the adjusted area position, meaning the adjusted area position is not changed and the user's adjustment command prevails; determining whether the adjusted area position falls within the edge area (a preset area near the screen border). For touchscreens, since the edge area is relatively difficult to operate and prone to accidental touches or misidentification, in this case, if the adjusted area position overlaps with the edge area, and the overlapping area is smaller than the preset area size, it indicates that the user likely did not intentionally adjust the keyboard interface to the screen edge. The preset position adjustment rule is to adjust the adjusted area position so that it does not overlap with the edge area, for example, adjusting the boundary of the adjusted area to be close to the edge area boundary. This can provide a better user experience with a smaller adjustment range; if the overlapping area is larger than the preset area size, it indicates that the user likely intentionally adjusted the keyboard interface to the screen edge. The preset position adjustment rule is to maintain the adjusted area position, which is more conducive to improving the user experience.

[0046] As an example, taking a rectangular keyboard screen as an example, the preset size adjustment rule could be to proportionally increase the length of the adjusted area by a preset first adjustment ratio, and / or proportionally increase the width of the adjusted area by a preset first adjustment ratio. As another example, taking a rectangular keyboard screen as an example, the preset size adjustment rule could be to proportionally decrease the length of the adjusted area by a preset second adjustment ratio, and / or proportionally decrease the width of the adjusted area by a preset second adjustment ratio. The values ​​of the preset first and preset second adjustment ratios can be set by those skilled in the art as needed, but it is necessary to ensure that the clickable area of ​​the keyboard window covers the display area of ​​all input buttons and other icons in the input view that can respond to user operations, to avoid the problem of the input method keyboard not responding when the user clicks the input button due to an unreasonable setting of the clickable area of ​​the keyboard window.

[0047] In another embodiment, the method further includes obtaining the region boundary information of the area where the current input view is located, and adjusting the clickable area of ​​the keyboard window to be consistent with the area where the input view is located based on the region boundary information.

[0048] In another embodiment, adjusting the clickable area of ​​the input method keyboard window based on the adjusted area position and size includes: calling the onComputeInsets() method to reset the clickable area of ​​the keyboard window. The position of the input view is adjusted by modifying the adjusted area position and size to obtain the adjusted input view position, and then the clickable area of ​​the keyboard window is reset based on the adjusted input view position.

[0049] Step S540: When a trigger event is received in the area of ​​the keyboard window of the input method keyboard, excluding the clickable area of ​​the adjusted keyboard window, the trigger event is transmitted to the lower-level application.

[0050] See also Figure 4 , Figure 4 The white area inside the red border of the keyboard window represents the area outside the clickable area of ​​the keyboard window, also known as the non-clickable area. This non-clickable area is transparent or has a transparency greater than a preset threshold, allowing the underlying application interface to be displayed. When this non-clickable area receives a trigger event, the input method keyboard stops responding; instead, the underlying application responds. The non-clickable area can be configured to pass received click, swipe, or other operation commands to other applications displayed below the input method keyboard window. Setting this area to transparent prevents it from obscuring the underlying application interface.

[0051] Taking the application of this method to a rectangular display interface as an example, please refer to [link to relevant documentation]. Figure 7 , Figure 7 This is a schematic diagram of an input method keyboard in a portrait screen scenario according to an embodiment of the present invention, as shown below. Figure 7 As shown, in portrait mode, the bottom of the input method keyboard is aligned with the bottom of the display screen and has the same width as the display screen. The keyboard window area is the area with the red border. Please refer to [link / reference]. Figure 8 , Figure 8 This is a schematic diagram of an input method keyboard in a landscape mode according to an embodiment of the present invention, as shown below. Figure 8 As shown, in landscape mode, the bottom of the input method keyboard remains aligned with the bottom of the display interface, matching the current width of the display interface. At this time, the keyboard window fills the display interface, indicated by a red border. To avoid obscuring the input box while still allowing the input method keyboard to be scaled and moved, the method provided in this embodiment can be used to adjust the clickable area of ​​the input view and keyboard window through software code. Please refer to... Figure 9 , Figure 9 This is another schematic diagram of an input method keyboard in a landscape mode according to an embodiment of the present invention, as shown below. Figure 9 As shown, when the input view is minimized and moved, the clickable area of ​​the keyboard window is correspondingly adjusted to match the area of ​​the input view. (See also...) Figure 9 The area indicated by the green border. As an example, you can reset the clickable area of ​​the keyboard window by calling the onComputeInsets() method to ensure that the clickable area of ​​the keyboard window is consistent with the size and position of the input view. This ensures that click events outside the clickable area of ​​the keyboard window can penetrate to the underlying application interface and be responded to by the underlying interface.

[0052] The floating effect can be achieved by using the onComputeInsets() method. This method does not require modifying the keyboard window property to the floating property, and it is simple to implement. It solves the problem of the floating keyboard obscuring the input box in the context of dialog input.

[0053] In one embodiment, the method further includes: maintaining the pop-up window attribute of the input method keyboard window unchanged when a keyboard adjustment command is received. It can be understood that during the overall adjustment process, the window attributes of the keyboard window are not modified; neither the window size nor position needs to be changed, nor is it necessary to first change the window to a floating window attribute and then modify the window size, making the implementation simpler. Throughout the process, the keyboard window does not become a floating window; instead, the floating effect is achieved through the method provided in this embodiment.

[0054] As an example, the clickable areas of the input view and keyboard window are both located inside the area where the keyboard window is located.

[0055] In one embodiment, determining the adjusted region position and adjusted region size includes: in response to a drag operation on the input view, obtaining the real-time drag position of the drag operation, the drag operation including moving a drag target of the input view, the drag target including a preset drag button or a preset drag response area; obtaining the initial position of the input view; and determining the adjusted region position and adjusted region size based on the initial position and the real-time drag position.

[0056] The clickable areas of the input view and keyboard window can be moved by dragging.

[0057] A preset drag button can be set in advance, and the user can move the object by pressing and holding the button. Alternatively, a preset drag response area can be defined in advance, and the user can drag the object by pressing and holding within that area. The above-mentioned press-and-drag is only one specific example of a drag operation, and those skilled in the art can set other drag operation methods as needed.

[0058] In one embodiment, before responding to a drag operation on the input method keyboard, the method also needs to determine whether the size of the input view area is smaller than the size of the keyboard window area. If so, the step of obtaining the real-time drag position in response to the drag operation on the input method keyboard is executed; otherwise, the process ends. If the input view fills the keyboard window, it cannot be moved; otherwise, it can. The zoom operation is similar; if the input view fills the keyboard window, it cannot be zoomed in, and since the input view has reached its minimum size, it cannot be zoomed out.

[0059] The initial position is the position at the end of the last drag / zoom operation. For example, when a user drags the keyboard from point A to point B, completing a drag operation, point A is the position where the user's finger touches the screen during the drag operation, i.e., the initial position. Point B is a position after dragging for a preset time or a preset distance, i.e., the real-time drag position. The drag position is then obtained based on the coordinates of point B and point A, and the keyboard (input view) position is updated in real-time using the `setTranslationX()` and `setTranslationY()` methods. As an example, this drag operation is not the entire process from the finger touching the touchscreen to leaving it. If it were the entire process, the keyboard movement would appear lag-like, resulting in a poor user experience. By moving the input view at preset intervals or detecting that the object of the drag operation (such as the user's finger or other dragging action object, such as the preset initial contact position of the drag button, the left vertex, etc.) has moved a preset distance, the "follow-up" of the input method keyboard is improved, showcasing the drag effect. As the dragging process continues, from point B to point C, and then the user lifts their hand, completing the drag process. At this point, point B becomes the new initial position, and point C becomes the new real-time drag position, allowing the input view to be moved.

[0060] When moving the input method keyboard, the above method can be used to display the moved keyboard in real time, allowing the keyboard to "follow" the user's actions and improving the user experience. This method does not require modifying window properties; it updates the keyboard position in real time using the setTranslationX() and setTranslationY() methods to achieve the dragging effect, resulting in less latency and a better user experience.

[0061] Following the above embodiments, the method further includes: when the drag operation ends, triggering a step of redrawing the input view of the input method keyboard according to the adjusted area position and adjusted area size. As an example, the clickable area of ​​the input method keyboard window could be adjusted to match the area of ​​the adjusted input view after each drag operation. However, during the dragging process, it is generally not necessary to input content or click on other parts of the interface. Therefore, the step of adjusting the clickable area of ​​the input method keyboard window to match the area of ​​the adjusted input view can be triggered after a dragging process (e.g., from the moment the object touches the touchscreen to the moment it leaves the touchscreen, or other processes defined by those skilled in the art) ends. Adjusting the clickable area of ​​the input method keyboard window to match the area of ​​the adjusted input view can save computational resources.

[0062] It should be noted that the above example uses the method implemented on a touch screen as an example, and does not limit the method to only being applied to touch screens. It can also be applied to ordinary display interfaces, using a mouse, capacitive pen, etc. as the execution object to drag and zoom (zoom out or zoom in) the input method keyboard.

[0063] In one embodiment, determining the adjusted region position and the adjusted region size includes: in response to a zoom operation on the input view, obtaining the coordinates of the top-left corner and the bottom-right corner of the input view at the end of the zoom operation, and determining the adjusted region position and the adjusted region size based on the top-left corner and the bottom-right corner coordinates.

[0064] Zooming operations include zooming out or zooming in. Similar to the aforementioned dragging operations, to improve the user experience, multiple zooming out and / or zooming in operations can be combined into a single zooming process. This process is initiated when the user begins the first zooming operation and ends when the user finishes the last zooming operation. Upon completion of the zooming process, a step is triggered to adjust the clickable area of ​​the input method keyboard window to match the adjusted input view area. This zooming process includes one or more zooming operations.

[0065] As an example, adjusting the area of ​​the input view based on the coordinates of the top left and bottom right corners can adjust the top left corner of the input view to the position of the top left corner coordinates, adjust the bottom right corner of the input view to the position of the bottom right corner coordinates, and adaptively adjust the other vertices to obtain the adjusted position of the input view.

[0066] As an example, the drag and zoom operations described above can be triggered by one or more methods, such as corresponding gestures, long presses, double-tap selection, or single-tap selection. Drag and zoom operations can also be triggered by clicking (or other triggering operations) a preset position on the input method keyboard. This preset position can be set differently for drag and zoom operations.

[0067] In the above embodiments, when the input view of the input method keyboard fills the area of ​​the keyboard window, the input view needs to be shrunk before it can be moved. If the input view does not fill the area of ​​the keyboard window, the order of the scaling and moving operations is not limited and can be selected as needed.

[0068] The execution order of steps S520 and S530 in the above embodiments can be set according to the needs of those skilled in the art, and the above step sequence is not a limitation on its execution order.

[0069] Taking the original keyboard as the input method keyboard as an example, please refer to [link / reference]. Figure 10 , Figure 10 A flowchart illustrating the input method keyboard zoom-out and dragging process provided in an embodiment of this application is shown below. Figure 10 As shown, during the scaling phase, taking shrinking as an example, clicking the scaling button shrinks the keyboard. The width and height of the InputView (the visual interface of the soft keyboard, the input view) are reset and the keyboard UI is redrawn using setLayoutParams (which specifies how a view should be laid out in its parent container). The coordinates of the last time the keyboard was displayed are obtained, and the keyboard is moved to its last displayed position using the setTranslationX method (a method to move the keyboard horizontally) and the setTranslationY method (a method to move the keyboard vertically). Finally, the clickable area of ​​the keyboard window is reset using the onComputeInsets method (which determines "how much screen space the keyboard actually occupies" and "where the content should be drawn"). This ensures that the clickable area of ​​the keyboard window is consistent with the width, height, and position of the keyboard (the area where the input view is located), guaranteeing that click events in areas outside the keyboard (areas outside the clickable area of ​​the keyboard window) can penetrate to the lower-level application interface and be responded to by the lower-level interface.

[0070] The left, top, right, and bottom boundaries of the current visual display area can be obtained using `getInputViewLeft()`, `getInputViewTop()`, `getInputViewWidth() + touchLeft`, and `getInputViewBottom()`, respectively. The right boundary can be obtained by adding the left boundary to the width. An example code implementation is as follows: public void onComputeInsets(Insets outInsets) { super.onComputeInsets(outInsets); final int touchLeft = getInputViewLeft(); final int touchTop = getInputViewTop(); final int touchRight = getInputViewWidth() + touchLeft; final int touchBottom = getInputViewBottom(); outInsets.touchableInsets = Insets.TOUCHABLE_INSETS_REGION; outInsets.touchableRegion.set(touchLeft, touchTop, touchRight, touchBottom); outInsets.contentTopInsets = touchTop; outInsets.visibleTopInsets = touchTop; mInsetsUpdater.setInsets(outInsets); } Please continue reading Figure 10 Here's an example of how the keyboard drag function works: After the keyboard is minimized, you can drag it freely up, down, left, and right on the screen by touching the drag button at the top of the keyboard. When you touch the screen, the starting coordinates are recorded. When you drag, the real-time coordinates are obtained and the initial coordinates are subtracted to calculate the drag position. The keyboard position is updated in real time using the setTranslationX() and setTranslationY() methods to achieve the drag effect. After you lift your hand, the onComputeInsets() method needs to be called to update the clickable area of ​​the keyboard window to ensure that the size and position of the clickable area of ​​the keyboard window are consistent with the area where the input view is located.

[0071] Taking position adjustment via touch operation as an example, touch events are listened to using `dragView.setOnTouchListener((v, event)` (to listen for and handle view touch events), and different operations are performed based on the touch event type. When a press event occurs: dragging begins, the initial position of the finger pressed (absolute screen coordinates), the X coordinate of the press, and the Y coordinate of the press are recorded. Then, dragging is executed, the distance the finger moves is calculated, and the current coordinates (real-time coordinates) are subtracted from the previously recorded coordinates (initial coordinates) to obtain the displacement increment, resulting in the X-direction displacement (dragX) and the Y-direction displacement (dragY). The new position of the input view is then calculated. This new position is then used as the new initial position, waiting for the next drag operation. When a release event occurs, the dragging process ends. After dragging, the insertion area is recalculated, a new `Insets` object is created, and the `onComputeInsets` method is called to update the layout.

[0072] An example code implementation is as follows: dragView.setOnTouchListener((v, event) ->{ switch (event.getAction()) { case MotionEvent.ACTION_DOWN: dragX = (int) event.getRawX(); dragY = (int) event.getRawY(); break case MotionEvent.ACTION_MOVE: dragX = (int) event.getRawX() - dragX; dragY = (int) event.getRawY() - dragY; float mTranslationX = inputView.getTranslationX() + dragX; float mTranslationY = inputView.getTranslationY() + dragY; inputView.setTranslationX(mTranslationX); inputView.setTranslationY(mTranslationY); dragX = (int) event.getRawX(); dragY = (int) event.getRawY(); break case MotionEvent.ACTION_UP: onComputeInsets (new Insets()); break } return true; }); The above method allows for adjustments to the size and position of the input view without modifying the window properties to a pop-up window, making the adjustment simpler and more timely.

[0073] The keyboard adjustment method provided in the above embodiments determines the adjusted area position and size of the input method keyboard in response to a keyboard adjustment command for the input method keyboard. It then redraws the input view of the input method keyboard based on the adjusted area position and size, and adjusts the clickable area of ​​the keyboard window based on the adjusted area position and size. When a trigger event is received in an area other than the clickable area of ​​the keyboard window, the trigger event is transmitted to the lower-level application. In this way, the size and position of the input view and the clickable area of ​​the keyboard window are adjusted without modifying the input method keyboard window attributes to pop-up attributes. This makes keyboard adjustment simpler and faster, achieving a floating effect without requiring modification of the window attributes to pop-up attributes. Furthermore, the floating effect achieved in this way does not obscure the input box.

[0074] The shrinking function is achieved by modifying the size of the keyboard inputView within the keyboard window. When dragging, only the inputView is dragged. The clickable area of ​​the keyboard window is updated through the onComputeInsets method, thus achieving a floating effect. This method is simpler than modifying the keyboard window properties to be a floating window, and it solves the problem of the floating keyboard obscuring the input box in dialog input scenarios.

[0075] In one embodiment, a keyboard adjustment device is provided for performing the keyboard adjustment method provided in any of the above embodiments. See also... Figure 11 , Figure 11 A schematic diagram of a keyboard adjustment device provided in an embodiment of this application is shown below. Figure 11 As shown, the keyboard adjustment device 1100 includes: a determination module 1110, used to determine the adjusted area position and size of the input method keyboard in response to a keyboard adjustment command for the input method keyboard; an input view adjustment module 1120, used to redraw the input view of the input method keyboard according to the adjusted area position and size; and a keyboard window clickable area adjustment module 1130, used to adjust the clickable area of ​​the keyboard window of the input method keyboard according to the adjusted area position and size, and when a trigger event is received in an area other than the adjusted clickable area of ​​the keyboard window of the input method keyboard, the trigger event is transmitted to the lower-level application.

[0076] For specific limitations regarding the keyboard adjustment device, please refer to the limitations on the keyboard adjustment method above, which will not be repeated here. Each module in the aforementioned keyboard adjustment device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the electronic device in hardware form or independently of it, or stored in the memory of the electronic device in software form, so that the processor can call and execute the corresponding operations of each module.

[0077] In this embodiment, the keyboard adjustment device is essentially equipped with multiple modules to execute the keyboard adjustment method in any of the above embodiments. The specific functions and technical effects can be referred to in the above embodiments, and will not be repeated here.

[0078] See Figure 12 , Figure 12 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown below. Figure 12 As shown, this embodiment of the invention also provides an electronic device 1200, including a processor 1201, a memory 1202, and a communication bus 1203; the communication bus 1203 is used to connect the processor 1201 and the memory 1202; the processor 1201 is used to execute a computer program stored in the memory 1202 to implement the method described in any of the above embodiments. As an example, the electronic device may be a vehicle infotainment system, a mobile terminal, or other similar devices.

[0079] This invention also provides a computer-readable storage medium having a computer program stored thereon, the computer program being used to cause a computer to perform the method provided in any of the above embodiments.

[0080] This application also provides a non-volatile readable storage medium storing one or more modules (programs) that, when applied to a device, enable the device to execute the instructions included in the steps provided in this application.

[0081] This application also provides a computer program product, including a computer program that, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.

[0082] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0083] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0084] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0085] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0086] It should be understood that the terms "first," "second," etc., used in this application are used to distinguish similar objects and do not necessarily indicate a specific order or sequence. The technical features to which these terms are used can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown in the figures or text.

[0087] It should be understood that although the flowcharts provided in the embodiments of this application indicate the various steps with arrows, the order indicated by the arrows does not necessarily limit the implementation order of these steps. Those skilled in the art can perform these steps in other orders according to different implementation scenarios and requirements.

[0088] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.

Claims

1. A keyboard adjustment method, characterized in that, The method includes: In response to a keyboard adjustment command for the input method keyboard, determine the adjusted area position and adjusted area size of the input method keyboard; The input view of the input method keyboard is redrawn based on the adjusted area position and adjusted area size; Adjust the clickable area of ​​the keyboard window of the input method keyboard according to the adjusted area position and adjusted area size; When a trigger event is received in an area outside the clickable area of ​​the keyboard window of the input method keyboard, the trigger event is transmitted to the lower-level application.

2. The keyboard adjustment method as described in claim 1, characterized in that, The clickable area of ​​the keyboard window of the input method keyboard is adjusted according to the adjusted area position and adjusted area size, including: The target area of ​​the clickable area of ​​the keyboard window is determined based on the adjusted area position and the adjusted area size; Adjust the clickable area of ​​the keyboard window to match the target area.

3. The keyboard adjustment method as described in claim 1, characterized in that, The method further includes: adjusting the clickable area of ​​the keyboard window of the input method keyboard according to the adjusted area position and the adjusted area size, including: determining the current adjustment position according to the adjusted area position and the preset position adjustment rule; The current adjustment size is determined based on the adjusted region size and the preset size adjustment rules; The target area of ​​the clickable region of the keyboard window is determined based on the current adjustment position and the current adjustment size. Adjust the clickable area of ​​the keyboard window to match the target area.

4. The keyboard adjustment method as described in claim 1, characterized in that, The method further includes: when receiving the keyboard adjustment instruction, keeping the pop-up window properties of the keyboard window of the input method keyboard unchanged.

5. The keyboard adjustment method according to any one of claims 1-4, characterized in that, Determine the location and size of the adjusted area, including: In response to a drag operation on the input view, the real-time drag position of the drag operation is obtained in real time. The drag operation includes movement control of the drag target of the input view. The drag target includes a preset drag button or a preset drag response area. Obtain the initial position of the input view; The adjusted region position and size are determined based on the initial position and the real-time drag position.

6. The keyboard adjustment method as described in claim 5, characterized in that, The method further includes: when the drag operation ends, triggering a step of redrawing the input view of the input method keyboard according to the adjusted region position and adjusted region size.

7. The keyboard adjustment method according to any one of claims 1-4, characterized in that, Determine the location and size of the adjusted area, including: In response to a zoom operation on the input view, the coordinates of the top-left corner and the bottom-right corner of the input view are obtained when the zoom operation ends, and the position and size of the adjusted region are determined based on the coordinates of the top-left corner and the bottom-right corner.

8. A keyboard adjustment device, characterized in that, The device includes: A determining module is used to determine the position and size of the adjusted area of ​​the input method keyboard in response to a keyboard adjustment command for the input method keyboard. The input view adjustment module is used to redraw the input view of the input method keyboard according to the adjusted area position and the adjusted area size; The keyboard window clickable area adjustment module is used to adjust the clickable area of ​​the input method keyboard window according to the adjusted area position and adjusted area size. When a trigger event is received in an area other than the adjusted keyboard window clickable area of ​​the input method keyboard window, the trigger event is transmitted to the lower layer application.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.