Soft keyboard invoking method, device, chip and storage medium

CN122985252APending Publication Date: 2026-10-27HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510533712.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0003]相关技术中,在平板电脑与键盘连接的情况下,用户可能手持平板电脑移动至远离键盘的位置,此时,对于用户而言,无法使用键盘输入

Benefits of technology

[0032]应当理解的是,本申请的第二方面至第五方面与本申请的第一方面的技术方案相对应,各方面及对应的可选实施例所取得的有益效果相似,不再赘述。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122985252A_ABST
    Figure CN122985252A_ABST
Patent Text Reader

Abstract

The application provides a soft keyboard invoking method, device, chip and storage medium, and relates to the technical field of terminals. In the method, an electronic device determines an actual input intention of a user by identifying a type of an input event corresponding to an operation. The electronic device can determine whether to invoke a soft keyboard according to the type of the input event. The method can cover most use scenarios, and can invoke the soft keyboard for the user when necessary, thereby improving the use experience of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to a soft keyboard activation method, device, chip, and storage medium. Background Technology

[0002] With the widespread adoption of large-screen touch devices, users' input needs are diversifying across different scenarios. Taking tablet computers as an example, as productivity tools, users typically input data using a mouse and keyboard connected to the tablet. As entertainment and leisure tools, users usually input data via the touchscreen.

[0003] In related technologies, when a tablet computer is connected to a keyboard, a user may move the tablet away from the keyboard, making keyboard input impossible. However, the electronic device is unaware that the keyboard is unavailable. When the user taps an input field via touch, the electronic device blocks the on-screen keyboard from activating because the keyboard remains connected, preventing the user from using the on-screen keyboard. Summary of the Invention

[0004] This application provides a method, device, chip, and storage medium for activating a soft keyboard, enabling the user to activate the soft keyboard when necessary and improving the user experience.

[0005] In a first aspect, embodiments of this application provide a method for activating a soft keyboard, applied to an electronic device with a display function. In this method, the electronic device displays a first interface, which includes a first control. Upon detecting an operation performed on the first control, the electronic device can activate or hide the soft keyboard based on the type of input event corresponding to the operation.

[0006] The activation of the soft keyboard by an electronic device can also be described as the electronic device launching the soft keyboard; specifically, the electronic device activates the soft keyboard by launching an input method application. The concealment of the soft keyboard by an electronic device can also be described as the electronic device not activating the soft keyboard, or the electronic device disabling the activation of the soft keyboard, or the electronic device blocking the activation of the soft keyboard.

[0007] The first interface can be a user interface provided by any application in the electronic device, which can be a system application or a third-party application; this application does not limit this. The first interface displays a first control, which can also be described as a first interface element.

[0008] The electronic device detects an operation performed on a first control on a first interface and can generate a corresponding input event based on the relevant data of the operation. This operation can be a screen touch operation, and the corresponding input event includes a screen touch event or a focus switching event. The operation can also be a mouse input event, and the corresponding input event includes a mouse input event or a focus switching event.

[0009] In the above method, the electronic device determines the user's actual input intent (whether the user wants to use the keyboard or the soft keyboard) by identifying the type of input event corresponding to the operation. The electronic device determines whether to activate the soft keyboard based on the type of input event, which can cover most usage scenarios (e.g., Figure 2 (As shown in the various scenarios), it enables the soft keyboard to be invoked for users when necessary, thereby improving the user experience.

[0010] Compared to methods that determine whether to activate the soft keyboard by detecting the keyboard connection status, the above method can avoid situations where the device still disables the soft keyboard because the keyboard is physically unavailable (i.e., the user cannot directly touch the keyboard).

[0011] In one optional embodiment of the first aspect, the first control includes an input control, and the type of input event includes screen touch event or mouse input event. The input control includes, but is not limited to, input boxes, search boxes, edit boxes, etc.

[0012] In one possible implementation, an operation on an input control is detected. If the type of the input event corresponding to the operation is a screen touch event, the electronic device determines to activate the soft keyboard.

[0013] In the above method, if the electronic device detects that the input event is a screen touch event, it can know that the user's finger is close to the screen of the electronic device, and thus determine that the user's actual input intention is more likely to be to use the soft keyboard. The electronic device can then activate the soft keyboard.

[0014] In another possible implementation, if an operation is detected that acts on an input control, and the type of the input event corresponding to the operation is a mouse input event, the electronic device determines not to invoke the soft keyboard.

[0015] In the above method, if the electronic device detects that the input event is a mouse input event, it can know that the user's finger is away from the screen of the electronic device, and thus determine that the user's actual input intention is more likely to be keyboard input, so the electronic device does not need to activate the soft keyboard.

[0016] In one optional embodiment of the first aspect, the first control includes a preset control, which is a control used to trigger focus switching. The type of input event includes a focus switching event. Upon detecting an operation applied to the preset control, if the type of the input event corresponding to the operation is a focus switching event, the electronic device determines not to invoke the soft keyboard.

[0017] For example, refer to Figure 10 The "New" control is a preset control. When the user touches the "New" control with their finger or clicks the mouse, the tablet computer can trigger the new window 1003 and switch the focus to the editing area 1004 of the new window 1003. The editing area 1004 gains focus (the editing area 1004 is activated and enters an interactive state).

[0018] In the above method, if the electronic device detects that the input event is a focus switching event, considering that it is impossible to know whether the user intends to input on the new interface element that has gained focus, the electronic device may not call up the soft keyboard to avoid unnecessary pop-up of the soft keyboard and affect the user experience.

[0019] In one optional embodiment of the first aspect, the electronic device includes an event decision module. Upon detecting an operation applied to a first control, the event decision module retrieves the type of the input event corresponding to the operation from a preset storage space. Based on the type of the input event corresponding to the operation, the event decision module determines whether to activate the soft keyboard. The preset storage space is used by the event decision module to record the type of the most recent input event.

[0020] In the above method, an event decision module is added to the electronic device. The event decision module is used to decide whether to wake up the soft keyboard based on the type of input event corresponding to the operation, thereby decoupling the event decision from the event processing and avoiding the impact on the event processing flow.

[0021] In an optional embodiment of the first aspect, the electronic device includes an event encapsulation module and an event processing module. The method further includes: detecting an operation performed on a first control; the event encapsulation module of the electronic device generating an input event; the event encapsulation module adding the input event to an event processing queue; the event processing module retrieving the input event from the event processing queue; and the event processing module controlling the execution of a response corresponding to the input event.

[0022] In one possible implementation, if the first control is an input control, the input event corresponding to the operation performed on the first control can be a screen touch event or a mouse input event. The event handling module controls the execution of the response corresponding to the input event, including: the event handling module controls the display of a cursor on the input control based on the screen touch event or mouse input event. (See also...) Figure 7 S714 of the embodiment, or Figure 8 S813 of the embodiment.

[0023] In one possible implementation, if the first control is a preset control, the input event corresponding to the operation performed on the first control can be a focus switching event. The event handling module controls the execution of the response corresponding to the input event, including: based on the focus switching event, the event handling module controls the focus to switch to a new interface element; if the new interface element is an input area or an input-type control, it can also control the display of a cursor in the input area or input-type control. (See also...) Figure 9 S909 of the embodiment.

[0024] In one optional embodiment of the first aspect, upon detecting an operation applied to the first control, the event encapsulation module of the electronic device generates an input event corresponding to the operation and sends the input event to the event decision module of the electronic device. After receiving the input event, the event decision module first clears a preset storage space and then writes the input event back into the preset storage space. In some embodiments, the preset storage space may also be described as a cache.

[0025] In the above method, the event decision module uses a write-overwrite approach to record the type of the most recent input event in a preset storage space, which is used to decide whether to wake up the soft keyboard, thereby decoupling event decision from event processing.

[0026] In one optional embodiment of the first aspect, upon detecting an operation applied to the first control, the event handling module of the electronic device obtains the decision result of the event decision module for the input event by invoking the event decision module of the electronic device. The decision result is used to indicate whether to activate the soft keyboard. The event handling module activates or hides the soft keyboard according to the decision result indicated by the event decision module.

[0027] In one possible implementation, the event handling module can send an event decision request to the event decision module. The event decision module retrieves the type of the most recent input event from a preset storage space based on the event decision request, and determines whether to activate the soft keyboard based on the type of the most recent input event. The event decision module returns an event decision response to the event handling module, indicating whether to activate the soft keyboard. See [link to relevant documentation] for details. Figure 7 , Figure 8 and Figure 9 Example.

[0028] In a second aspect, embodiments of this application provide an electronic device, including: one or more processors and a memory; the memory is coupled to one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the method as described in the first aspect or any optional embodiment of the first aspect.

[0029] Thirdly, embodiments of this application provide a chip or chip system applied to an electronic device. The chip or chip system includes one or more processors, which are used to invoke computer instructions to cause the electronic device to perform a method as described in the first aspect or any optional embodiment of the first aspect.

[0030] Fourthly, embodiments of this application provide a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in the first aspect or any optional embodiment of the first aspect.

[0031] Fifthly, embodiments of this application provide a computer program product, which includes computer program code that, when run on an electronic device, causes the electronic device to perform the method as described in the first aspect or any optional embodiment of the first aspect.

[0032] It should be understood that the second to fifth aspects of this application correspond to the technical solutions of the first aspect of this application, and the beneficial effects achieved by each aspect and the corresponding optional embodiments are similar, and will not be described again. Attached Figure Description

[0033] Figure 1 A scenario illustration of the soft keyboard activation method provided in the embodiments of this application. Figure 1 ;

[0034] Figure 2 A scenario illustration of the soft keyboard activation method provided in the embodiments of this application. Figure 2 ;

[0035] Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;

[0036] Figure 4 Software architecture of the electronic device provided in the embodiments of this application Figure 1 ;

[0037] Figure 5 A flowchart illustrating the soft keyboard activation method provided in this application embodiment. Figure 1 ;

[0038] Figure 6 Software architecture of the electronic device provided in the embodiments of this application Figure 2 ;

[0039] Figure 7 A flowchart illustrating the soft keyboard activation method provided in this application embodiment. Figure 2 ;

[0040] Figure 8A flowchart illustrating the soft keyboard activation method provided in this application embodiment. Figure 3 ;

[0041] Figure 9 A flowchart illustrating the soft keyboard activation method provided in this application embodiment. Figure 4 ;

[0042] Figure 10 A schematic diagram illustrating interface changes of the electronic device provided in this application embodiment;

[0043] Figure 11 A flowchart illustrating the soft keyboard activation method provided in this application embodiment. Figure 5 ;

[0044] Figure 12 The software architecture diagram of the HarmonyOS system provided in the embodiments of this application is shown. Detailed Implementation

[0045] To facilitate understanding, the relevant concepts involved in the embodiments of this application will be explained below.

[0046] 1) User interface and interface elements

[0047] Electronic devices can display a user interface (UI) that includes one or more interface elements on a screen.

[0048] Interface elements include any appropriate element or object in the user interface. Interface elements are categorized by function type as follows: input elements (e.g., text boxes, drop-down menus, search boxes, dialog boxes, check boxes, sliders, etc.), navigation elements (e.g., buttons, tab bars, etc.), container elements (e.g., windows, panels, lists, etc.), feedback elements (e.g., progress bars, icon animations, etc.), basic visual elements (e.g., charts, text, images, etc.), and composite components (e.g., cards, charts, etc.).

[0049] This application relates to input controls, whose main function is to receive user input data. Their interactive behaviors include, but are not limited to, cursor display, soft keyboard activation, and text editing.

[0050] 2) Focus and the UI element in focus state

[0051] The focus indicator is the interface element currently selected to receive input. The interface element with focus means that the element has received focus, or in other words, the element is in a focused state. Specifically, the interface element with focus, the element that has received focus, and the element in a focused state all indicate that the interface element is currently selected and can receive input. For example, when a search box receives focus, it can receive text entered by the user.

[0052] User interface elements can include focused elements and non-focused elements. A focused element is one that has received focus and can be selected and input received. A non-focused element is one that does not currently have focus.

[0053] A focused interface element has visual cues that distinguish it from other unfocused interface elements. Non-limiting examples of these visual cues include highlighting, adding a background, or thickening the border. Visual cues can also be used to process the content of an interface element (e.g., text or images), such as enlarging the content, changing its color, or changing its font. This application does not limit the scope of the visual cues described.

[0054] 3) Focus switching events and focus focusing events

[0055] Focus switching events are behaviors triggered when a UI element (or UI control) changes its focus state due to user interaction or program logic. Focus switching events include two core types: focus out and focus in events. A focus out event means the control exits its active state and stops receiving user input. A focus in event means the control is activated and enters an interactive state.

[0056] User actions triggering focus switching include clicking different controls (e.g., when a user clicks input box B, the focus switches from input box A to input box B), and using the keyboard / Tab key to switch the focus control. Program logic triggering focus switching includes the program automatically switching focus (e.g., returning to the original input box after form validation fails), and changes in view hierarchy (e.g., forcibly shifting focus when a pop-up appears).

[0057] 4) Virtual mouse events

[0058] Virtual mouse events refer to mouse interaction behaviors triggered by program code rather than physical devices, used to simulate user operations (e.g., clicking, hovering, dragging) or to implement special interaction logic.

[0059] 5) Keyboard and on-screen keyboard

[0060] A keyboard refers to a physical keyboard, where users trigger electronic signals using physical keys or a touchpad to input commands or data into a computer or electronic device. Keyboards can connect to computers or electronic devices via wired connections or wireless connections (e.g., Bluetooth).

[0061] A soft keyboard, also known as a virtual keyboard, is an on-screen control simulated by software. It presents keyboard functions in a graphical interface, allowing users to complete input operations by clicking or touching the soft keyboard on the screen.

[0062] 6) Electronic equipment

[0063] The electronic devices in this application embodiment may include handheld devices with display functions, vehicle-mounted devices, etc. In some embodiments, the electronic device may be referred to as user equipment (UE), terminal, etc. The electronic device may be a mobile phone, tablet, foldable electronic device, handheld device, computing device, vehicle-mounted device, or wearable device, virtual reality (VR) terminal device, augmented reality (AR) terminal device, wireless terminal in industrial control, wireless terminal in smart home, etc. The form of the electronic device is not specifically limited in this application embodiment.

[0064] In this embodiment of the application, the electronic device can be connected to an external device, which includes, but is not limited to, a mouse, keyboard, remote control, etc. Users can perform input operations by touching the screen of the electronic device or by using an external device.

[0065] With the increasing prevalence of large-screen touch devices (such as tablets), users have different input needs for these devices in different scenarios. Taking tablets as an example, in office settings, tablets serve as productivity tools, and users typically connect them to a keyboard and mouse for efficient text input, such as writing reports or coding. In leisure settings, tablets serve as entertainment tools, and users usually interact with the interface via touchscreen. Therefore, it's clear that users have input needs using keyboard and mouse in office settings and touchscreen in leisure settings.

[0066] In some embodiments, when the electronic device is connected to a keyboard, an operation on an input control in the user interface is detected, the input control gains focus, and the electronic device can display an input cursor in the input control. The operation on the input control can be a tap on the screen with a finger, a click with a mouse, or a tap on the touchpad of the keyboard. In this embodiment, because the electronic device is connected to the keyboard, the soft keyboard is not activated when an operation on the input control is detected; the user can input text using the keyboard.

[0067] For example, refer to Figure 1 In example (a), a tablet computer is connected to a keyboard via Bluetooth. The tablet computer displays an interface 101 of a certain application. The interface 101 includes an input box 1011. When an operation is detected on the input box 1011 (e.g., clicking the input box 1011 with a mouse), the tablet computer displays a special effect on the border of the input box 1011 (e.g., displaying a light strip on the border) to indicate that the input box 1011 has gained focus. At the same time, the input box 1011 displays a blinking cursor 1012. The user inputs text using the keyboard.

[0068] In some embodiments, when the electronic device is not connected to a keyboard, upon detecting an operation on an input control in the user interface, the input control gains focus, and the electronic device can display an input cursor in the input control and a soft keyboard on the user interface. The operation on the input control can be a tap on the screen with a finger; if the electronic device is connected to a mouse, the operation can also be a click. In this embodiment, since the electronic device is not connected to a keyboard, when an operation on the input control is detected, the electronic device activates the soft keyboard, allowing the user to input text.

[0069] For example, refer to Figure 1 In (b), with Figure 1 Unlike in (a), the tablet computer is not connected to a keyboard. When an operation is detected on the input box 1011 (e.g., clicking the input box 1011 with a mouse), the tablet computer displays a special effect on the border of the input box 1011, and the input box 1011 displays an input cursor 1012. At the same time, the interface 101 displays a soft keyboard 1013, and the user inputs text using the soft keyboard 1013.

[0070] In the soft keyboard activation method shown in the foregoing embodiment (referred to as Scheme 1), the electronic device detects an operation (including finger touch on the screen, mouse click, etc.) on an input control (e.g., an input box EditText) applied to the user interface. First, it detects whether a keyboard is connected to the electronic device, and then determines whether to activate the soft keyboard based on the keyboard's connection status.

[0071] In one possible scenario, if at least one keyboard is detected to be connected, the electronic device may forcibly hide the soft keyboard (e.g., by calling InputMethodManager.hideSoftInputFromWindow()).

[0072] Another possible scenario is that if no keyboard is detected as connected, the electronic device triggers the soft keyboard to be brought up (for example, the electronic device calls InputMethodManager.showSoftInput()).

[0073] The soft keyboard activation method shown in the foregoing embodiments may have the following problems:

[0074] Question 1: If the user switches scenes, the electronic device may not be able to wake up the soft keyboard because the keyboard is still connected, causing the input process to be interrupted. In this case, the user needs to click the input control multiple times to force the electronic device to display the soft keyboard, which affects the user experience.

[0075] The following example uses a tablet computer as an example to illustrate the above issues through several scene switching examples.

[0076] One possible example is in an office setting, such as... Figure 2 As shown in (a), the user places a tablet computer on a desk, which is connected to both a keyboard and a mouse. The user can input text using the keyboard and mouse. When the user picks up the tablet and moves it away from the desk, and the distance between the keyboard and the tablet does not exceed the preset communication range (i.e., the keyboard and tablet remain connected), a scene switch can be considered to have occurred, changing from an office scene to an office communication scene, as shown in (a). Figure 2 As shown in (b), if a user needs to temporarily input text while holding the tablet, the tablet will forcibly hide the on-screen keyboard because the keyboard is still connected, and the user cannot directly access the on-screen keyboard via touch.

[0077] One possible example is in a work-from-home scenario, such as Figure 2 As shown in (a), the user places the tablet on a desk in the study, connecting it to a keyboard and mouse, allowing for text input. When the user moves the tablet to the living room, and the distance between the keyboard and the tablet does not exceed the preset communication range, a scene switch occurs, transitioning from a home office scenario to a home leisure scenario, as shown in (a). Figure 2 As shown in (c). If a user needs to input data while holding the tablet, such as logging in, searching, or replying to text messages, the tablet will forcibly hide the on-screen keyboard because the keyboard is still connected. The user cannot directly access the on-screen keyboard via touch.

[0078] One possible example is in a commuting scenario, such as Figure 2As shown in (d), the user holds a tablet computer, which is connected to a keyboard. The user places the keyboard in a backpack. If the user needs to input, the tablet computer forcibly hides the on-screen keyboard because the keyboard is already connected, and the user cannot directly access the on-screen keyboard via touch.

[0079] Based on the aforementioned examples, in office communication scenarios, home leisure scenarios, or commuting scenarios, when an operation on a screen input control is detected, the tablet cannot directly invoke the soft keyboard because the keyboard is already connected. The user needs to perform additional operations, such as manually clicking the input control multiple times, to invoke the soft keyboard, resulting in the user being unable to directly use the soft keyboard after the scenario changes.

[0080] Question 2: In an office setting, there's a possible scenario where an electronic device is connected to a mouse but not yet connected to a keyboard (the user plans to connect the keyboard). If the user accidentally clicks the input box, the on-screen keyboard will be activated because the keyboard isn't connected. Since the user doesn't need to input text at this time, they need to perform an additional action, such as manually clicking to close the on-screen keyboard.

[0081] Question 3: When the focus is switched to an input control (i.e., the focus switch event is detected), if the electronic device is not connected to a keyboard, the electronic device will activate the soft keyboard by default. If the user does not need to input anything at this time, the user needs to perform an additional operation to close the soft keyboard.

[0082] Question 4: Due to signal interference, low-power sleep / wake-up, and changes in communication distance, the keyboard is in an intermittent connection state. Since electronic devices do not currently support monitoring the stability of the keyboard connection, in scenarios where the keyboard connection status fluctuates, when an operation on screen input controls is detected, the electronic device sometimes wakes up the soft keyboard and sometimes does not, affecting the user experience.

[0083] For example, taking a tablet computer as an example, at time t, if the user touches the screen input control and the keyboard is detected as connected, the tablet computer does not activate the on-screen keyboard. At time t+1, if the user touches the screen input control again and the keyboard is detected as disconnected, the tablet computer activates the on-screen keyboard.

[0084] In view of the above problems, this application provides a method for activating a soft keyboard (hereinafter referred to as Scheme 2). This method is executed by an electronic device. When an input event is detected, the electronic device first determines whether the input event is an event acting on an input control. If so, the electronic device obtains the type of the input event (including screen touch, mouse click, focus switching, etc.). The electronic device can determine whether to activate the soft keyboard based on the type of the input event. This method identifies the type of input event to determine the user's actual input intention, enabling the soft keyboard to be activated when necessary, thus improving the user experience.

[0085] For example, Table 1 shows a comparison of the execution results of Scheme 1 and Scheme 2 regarding whether the soft keyboard is invoked.

[0086] Serial Number Keyboard connection status Types of input events Execution result of scheme 1 Execution result of scheme 2 1 Connected Touchscreen Do not invoke the soft keyboard Activate the on-screen keyboard 2 Connected Mouse input Do not invoke the soft keyboard Do not invoke the soft keyboard 3 Connected Focus switching Do not invoke the soft keyboard Do not invoke the soft keyboard 4 Not connected Touchscreen Activate the on-screen keyboard Activate the on-screen keyboard 5 Not connected Mouse input (may be accidentally clicked) Activate the on-screen keyboard Do not invoke the soft keyboard 6 Not connected Focus switching Activate the on-screen keyboard Do not invoke the soft keyboard 7 Fluctuating (intermittent connection) Touchscreen To activate or deactivate the on-screen keyboard Invoke the on-screen keyboard (stable invocation)

[0087] Referring to Table 1, when the electronic device executes Scheme 1, if the keyboard is connected to the electronic device, the electronic device will not activate the soft keyboard regardless of whether the input event is screen touch, mouse input, or focus switching, which may lead to the aforementioned problem 1. If the keyboard is not connected to the electronic device, the electronic device will activate the soft keyboard regardless of whether the input event is screen touch, mouse input, or focus switching, which may lead to the aforementioned problems 2 and 3. If the connection status between the keyboard and the electronic device is unstable, if the electronic device detects that the keyboard is connected at a certain moment, it will activate the soft keyboard; if it detects that the keyboard is not connected at the next moment, it will not activate the soft keyboard, leading to the aforementioned problem 4.

[0088] Referring to Table 1, when the electronic device executes Scheme 2, if the input event type is screen touch, the electronic device will activate the soft keyboard regardless of whether the keyboard is connected, thus avoiding problems 1 and 4 mentioned above. If the input event type is mouse input or focus switching, the electronic device will not activate the soft keyboard regardless of whether the keyboard is connected, thus avoiding problems 2 and 3 mentioned above.

[0089] In some embodiments, mouse input may also be described as a mouse click.

[0090] The hardware structure and software architecture of the electronic device provided in the embodiments of this application will be introduced first below.

[0091] Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, with reference to... Figure 3The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100.

[0092] The processor 110 can be used to execute the various steps of the soft keyboard wake-up method shown in this application, and to control whether the soft keyboard is activated.

[0093] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1. Display screen 194 may include a touch panel and other input devices. In some embodiments, the display screen may also be referred to as a touch screen or a screen.

[0094] Sensor 180 may include a pressure sensor for sensing pressure signals and converting them into electrical signals. In some embodiments, the pressure sensor may be located on the display screen 194; for example, the electronic device can use the pressure sensor to detect the force applied by the user pressing the screen. When force is applied to the pressure sensor, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation is applied to the display screen 194, the electronic device 100 detects the intensity of the touch operation based on the pressure sensor. The electronic device 100 may also calculate the location of the touch based on the detection signal from the pressure sensor.

[0095] In some embodiments, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0096] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses a layered architecture as an example to illustrate the software structure of the electronic device.

[0097] Figure 4 Software architecture of the electronic device provided in the embodiments of this application Figure 1 A layered architecture divides the software system of an electronic device into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, refer to... Figure 4 Electronic devices may include an application layer and an operating system layer, with the application layer located above the operating system.

[0098] It is understood that the software structure division of the electronic device in this application embodiment is just an example. This application embodiment does not limit the hierarchical division method in the software system of the electronic device. The modules in each level in the following embodiments are the modules involved in the embodiments of this application. Each level may also include more or fewer modules than shown in the figure, or combine some modules, or split some modules.

[0099] The application layer can include a series of application packages. The application layer accesses underlying functions by calling the application programming interface (API) provided by the operating system.

[0100] In this embodiment, the application layer includes, but is not limited to, applications such as browsers, office software, and input methods. Taking a browser as an example, the user interface provided by the browser includes controls such as input boxes. When a click on an input box is detected, the electronic device can invoke the soft keyboard so that the user can enter a website address into the input box using the soft keyboard. An input method application can provide a soft keyboard, and the invocation or activation of the soft keyboard by the electronic device can also be described as the electronic device invoking or activating the soft keyboard provided by the input method application.

[0101] The application layer can also include third-party UI frameworks. Third-party UI frameworks are predefined component libraries or toolkits provided by third-party developers or teams for quickly building user interfaces. By encapsulating common functionalities, standardizing design specifications, and providing reusable components, third-party UI frameworks help developers reduce repetitive development costs and improve interface development efficiency. It should be noted that third-party UI frameworks differ from... Figure 12 The ArkUI framework shown is a third-party UI framework that supports cross-platform compatibility, making it easy for developers to port the various functional modules in the third-party UI framework to different platforms or operating systems.

[0102] In this embodiment, the third-party UI framework may include an event encapsulation module and an event processing module. The event encapsulation module can be used to encapsulate input events from the operating system and add the encapsulated input events to an event processing queue, which is used to temporarily store input events to be processed. The event processing module can be used to sequentially read the input events to be processed from the event processing queue based on a first-in-first-out sorting rule, and control the execution of the operation or response corresponding to each input event.

[0103] In this embodiment, the operating system layer may include an input management module, a peripheral connection status monitoring module, etc. The input management module can be used to monitor user-triggered input operations and generate raw input events based on these operations. Input operations include, for example, screen touch operations, mouse click operations, and keyboard input operations. For example, taking a screen touch operation as an example, the raw input event may include touch point coordinates and a timestamp of the touch operation. The input management module is also used to send the raw input events to the event encapsulation module of a third-party UI framework, so that the event encapsulation module can encapsulate the raw input events from the operating system.

[0104] The peripheral device connection status monitoring module can be used to monitor the connection status of external devices and electronic devices based on queries or periodicity. These external devices include, but are not limited to, keyboards, mice, and remote controls. For example, the event handling module of a third-party UI framework can call the peripheral device connection status monitoring module to obtain the keyboard's connection status in order to determine whether to activate the soft keyboard.

[0105] based on Figure 4The software framework of the electronic device shown herein includes a method for activating a soft keyboard, corresponding to the aforementioned scheme 1. This method involves an input management module, a peripheral connection status monitoring module, an event encapsulation module, an event processing module, and the interaction of an input method application within the electronic device. The following describes... Figure 5 The embodiments provide a detailed description of the soft keyboard activation method.

[0106] Figure 5 A flowchart illustrating the soft keyboard activation method provided in this application embodiment. Figure 1 .like Figure 5 As shown, the soft keyboard activation method includes:

[0107] S501, the input management module of the operating system monitors input operations.

[0108] S502, after the input management module detects an input operation, it obtains the relevant data of the input operation.

[0109] When an input operation is received (e.g., screen touch, mouse input, etc.), the input management module can obtain relevant data about the input operation from the operating system kernel.

[0110] For example, if the input operation is a screen touch operation, the relevant data of the screen touch operation may include the coordinate position of the touch point on the screen and data such as timestamp.

[0111] For example, if the input operation is a mouse input operation, the relevant data of the mouse input operation may include key states (e.g., the pressed and released states of the left, right, and middle buttons (scroll wheel press), or the states of extended function keys (such as side buttons), scroll wheel data (such as scroll wheel steps), the coordinate position of the touch point on the screen, and timestamps, etc.

[0112] S503, the input management module generates the first input event based on the relevant data of the input operation.

[0113] The input management module processes the relevant data of the input operation and encapsulates it into a system-level event, which is the first input event.

[0114] S504, The input management module sends notification message 1 to the event encapsulation module of the third-party UI framework.

[0115] Notification message 1 is used to indicate that there is a first input event.

[0116] S505, the event encapsulation module obtains relevant data of the first input event from the input management module, and generates the second input event based on the relevant data of the first input event.

[0117] After receiving notification message 1, the event encapsulation module retrieves relevant data for the first input event from the input management module by calling the system interface. This data includes information about the input operation corresponding to the first input event. The event encapsulation module then processes this data and encapsulates it into a second input event.

[0118] The data related to the second input event may include the event type of the second input event and the data related to the corresponding input operation. The event type includes, but is not limited to, screen touch events and mouse input (such as mouse click) events. The data related to the input operation corresponding to the second input event includes the coordinates of the touch point on the screen and a timestamp.

[0119] S506, the event encapsulation module adds the second input event to the event processing queue.

[0120] An event processing queue is used to store input events to be processed, and it usually follows a first-in-first-out (FIFO) sorting rule.

[0121] S507, the event handling module of the third-party UI framework retrieves the second input event from the event handling queue.

[0122] The event handling module can process input events in the event handling queue sequentially according to the first-in-first-out (FIFO) sorting rule.

[0123] S508, the event handling module determines whether the type of the second input event is a single-point touch event.

[0124] If the second input event is determined to be a single-point touch event, execute S509.

[0125] S509, the event handling module generates a focus event based on the second input event.

[0126] If the second input event is a single-point screen touch event, the event handling module will trigger the focus to be placed on the interface element corresponding to the input operation based on the second input event. Interface elements include, for example, input controls, navigation controls, etc.

[0127] S510, the event handling module determines the type of the interface element corresponding to the input operation based on the second input event.

[0128] S511, if the type of the interface element is an input control, the event handling module controls the display of the cursor on the input control.

[0129] Input controls include, but are not limited to, input boxes, search boxes, and edit boxes.

[0130] S512, the event handling module obtains the keyboard connection status from the peripheral connection status monitoring module.

[0131] S513, the event handling module determines whether to wake up the soft keyboard based on the keyboard's connection status.

[0132] If the keyboard is not connected, execute S514. If the keyboard is connected, the process can end.

[0133] S514, the event handling module sends notification message 2 to the input method application through the input management module. Notification message 2 is used to instruct the soft keyboard to be activated.

[0134] The event handling module determines that the keyboard is not connected to the electronic device and can send notification message 2 to the input management module by calling the system interface. Subsequently, the input management module sends notification message 2 to the input method application so that the input method application can wake up the soft keyboard based on notification message 2.

[0135] Using the above-described soft keyboard activation method, the event handling module of the electronic device determines that the interface element corresponding to the input operation is an input control. The event handling module can query the keyboard's connection status and determine whether to activate the soft keyboard based on the keyboard's connection status. If the keyboard is not connected, the event handling module can notify the input method application to activate the soft keyboard through the input management module. This soft keyboard activation method suffers from the aforementioned problems 1 to 4.

[0136] Figure 6 Software architecture of the electronic device provided in the embodiments of this application Figure 2 .like Figure 6 As shown, with Figure 4 Unlike other third-party UI frameworks, third-party UI frameworks can also include an event decision module. This module records the type of the most recent input event and determines whether to activate the soft keyboard based on that type. The event handling module can then call the event decision module to obtain the decision result regarding whether to activate the soft keyboard and control that key is on or off based on that decision.

[0137] based on Figure 6 The illustrated software framework diagram of the electronic device shows a method for activating a soft keyboard, which corresponds to the aforementioned scheme 2. This method involves an input management module, an event encapsulation module, an event processing module, an event decision module, an input method application, and interaction with a first application within the electronic device. The first application is the application displayed on the screen before the electronic device receives an input operation, and the input operation can be an operation performed on the user interface provided by the first application.

[0138] The following are three specific embodiments ( Figure 7 , Figure 8 and Figure 9 The illustrated embodiment provides a detailed description of the soft keyboard activation method.

[0139] (1) Taking screen touch as an example of input events

[0140] Figure 7 A flowchart illustrating the soft keyboard activation method provided in this application embodiment. Figure 2 .like Figure 7 As shown, the soft keyboard invocation method includes:

[0141] S701, the operating system's input management module monitors screen touch operations.

[0142] S702, the input management module obtains relevant data for screen touch operations. The relevant data for screen touch operations can be found in the example in S502.

[0143] S703, the input management module generates the first screen touch event based on the relevant data of the screen touch operation.

[0144] After processing the relevant data of the screen touch operation, the input management module encapsulates it into a system-level first screen touch event.

[0145] S704, The input management module sends a notification message 3 to the event encapsulation module of the third-party UI framework.

[0146] Notification message 3 is used to indicate that there is a first screen touch event.

[0147] S705, the event encapsulation module obtains relevant data of the first screen touch event from the input management module, and generates the second screen touch event based on the relevant data of the first screen touch event.

[0148] After receiving notification message 3, the event encapsulation module retrieves relevant data of the first screen touch event from the input management module by calling the system interface. This data includes information about the screen touch operation corresponding to the first screen touch event. The event encapsulation module then processes this data and encapsulates it into a second screen touch event.

[0149] The relevant data for the second screen touch event may include the event type (screen touch) and the relevant data of the screen touch operation corresponding to the second screen touch event (e.g., the coordinates of the touch point on the screen).

[0150] S706, the event encapsulation module sends the second screen touch event to the event decision module of the third-party UI framework.

[0151] S707, the event decision module writes the second screen touch events into the preset storage space.

[0152] The preset storage space is used to store the most recent input event. If the preset storage space is not empty, the event decision module first clears the preset storage space and then writes the second screen touch event into the preset storage space. That is to say, the preset storage space can store at most one input event.

[0153] In this embodiment, S706 and S707 are new steps. By adding an event decision module to the third-party UI framework of the electronic device, the event decision module records the event type of the most recent input event separately and determines whether to wake up the soft keyboard based on the event type of the most recent input event. This decouples event decision from event processing and avoids affecting the processing flow of the event processing module.

[0154] S706 can be executed simultaneously with S708.

[0155] S708, the event encapsulation module adds the second screen touch event to the event processing queue.

[0156] S709, the event handling module of the third-party UI framework retrieves the second screen touch events from the event handling queue.

[0157] S710, the event handling module determines whether the second screen touch event is a single-point touch event.

[0158] If the second screen touch event is determined to be a single-point touch event, execute S711.

[0159] S711, the event handling module generates virtual mouse events based on the second screen touch events.

[0160] The event handling module converts second-screen touch events into virtual mouse events.

[0161] S712, the event handling module generates focus events based on virtual mouse events.

[0162] The event handling module is based on virtual mouse events, which triggers the focus to the interface element corresponding to the screen touch operation.

[0163] S713, the event handling module determines the type of the interface element corresponding to the screen touch operation based on the virtual mouse event.

[0164] S714, if the interface element corresponding to the screen touch operation is an input control, the event handling module controls the display of the cursor on the input control.

[0165] S713 and S714 can be seen as the processing flow corresponding to the focus event of S712.

[0166] S715, the event handling module sends event decision request 1 to the event decision module.

[0167] S716, the event decision module, based on event decision request 1, retrieves the type of the most recent input event from the preset storage space as screen touch, and determines to wake up the soft keyboard.

[0168] The event decision module pre-stores the correspondence between input event types and decision results (whether to activate or not activate the soft keyboard), as shown in columns 3 and 5 of Table 1. After obtaining that the most recent input event type is screen touch, the event decision module can determine the decision result as activating the soft keyboard by querying the correspondence between the input event type and the decision result.

[0169] S717, the event decision module sends event decision response 1 to the event processing module. Event decision response 1 is used to instruct the soft keyboard to be invoked.

[0170] In this embodiment, steps S715 to S717 are newly added steps, and... Figure 5 The difference in this embodiment is that the electronic device delegates the decision-making task of whether to activate the soft keyboard to the event decision module. The event processing module obtains the decision result by calling the event decision module, thereby decoupling the event decision from the event processing and avoiding the impact on the processing flow of the event processing module.

[0171] S718, the event handling module sends notification message 2 to the input method application through the input management module. Notification message 2 is used to instruct the soft keyboard to be activated.

[0172] Using the aforementioned soft keyboard activation method, after the event handling module of the electronic device determines that the interface element corresponding to the screen touch operation is an input control, the event handling module calls the event decision module to obtain the decision result for the screen touch operation, which is to activate the soft keyboard. Specifically, the event decision module determines to activate the soft keyboard based on the most recent input event type being screen touch. The event handling module then activates the soft keyboard based on the decision result returned by the event decision module.

[0173] (2) Taking mouse click as an example of input event

[0174] Figure 8 A flowchart illustrating the soft keyboard activation method provided in this application embodiment. Figure 3 .like Figure 8 As shown, the soft keyboard invocation method includes:

[0175] S801 is the operating system's input management module that monitors mouse input operations.

[0176] S802, the input management module obtains relevant data for mouse input operations. The relevant data for mouse input operations can be found in the example in S502.

[0177] S803, the input management module generates the first mouse event based on the relevant data of mouse input operations.

[0178] After processing the data related to mouse input operations, the input management module encapsulates it into a system-level first mouse event. In some embodiments, the first mouse event can also be described as a first mouse input event.

[0179] S804, The input management module sends a notification message 4 to the event encapsulation module of the third-party UI framework.

[0180] Notification message 4 is used to indicate that a first mouse event has occurred.

[0181] S805, the event encapsulation module obtains relevant data of the first mouse event from the input management module, and generates the second mouse event based on the relevant data of the first mouse event.

[0182] After receiving notification message 4, the event encapsulation module retrieves relevant data for the first mouse event from the input management module by calling the system interface. This data includes information about the mouse input operation corresponding to the first mouse event. The event encapsulation module then processes this data and encapsulates it into a second mouse event.

[0183] In some embodiments, the second mouse event may also be described as a second mouse input event.

[0184] The second mouse event may include the event type (mouse input) and related data of the mouse input operation corresponding to the second mouse event (e.g., the coordinates of the touch point on the screen).

[0185] S806, the event encapsulation module sends a second mouse event to the event decision module of the third-party UI framework.

[0186] S807, the event decision module writes the second mouse event to the preset storage space.

[0187] If the preset storage space is not empty, the event decision module first clears the preset storage space and then writes the second mouse event into the preset storage space.

[0188] In this embodiment, S806 and S807 are newly added steps, and their technical effects can be referred to S706 and S707.

[0189] S808 can be executed simultaneously with S806.

[0190] S808, the event encapsulation module adds the second mouse event to the event processing queue.

[0191] S809, the event handling module of the third-party UI framework retrieves the second mouse event from the event handling queue.

[0192] S810, the event handling module determines whether the second mouse event is a single-point touch event.

[0193] If the second mouse event is determined to be a single-point touch event, execute S811.

[0194] S811, the event handling module generates a focus event based on the second mouse event.

[0195] The event handling module triggers the second mouse event to focus the attention on the interface element corresponding to the mouse input operation.

[0196] S812, the event handling module determines the type of the interface element corresponding to the mouse input operation based on the second mouse event.

[0197] S813, if the interface element corresponding to the mouse input operation is an input control, the event handling module controls the display of the cursor on the input control.

[0198] S812 and S813 can be seen as the processing flow corresponding to the focus event of S811.

[0199] S814, the event handling module sends event decision request 2 to the event decision module.

[0200] S815, the event decision module, based on event decision request 2, retrieves the type of the most recent input event from the preset storage space as mouse input, and determines not to invoke the soft keyboard.

[0201] S816, the event decision module sends event decision response 2 to the event handling module. Event decision response 2 is used to indicate that the soft keyboard should not be invoked.

[0202] After receiving event decision response 2, the event handling module can terminate the process.

[0203] In this embodiment, steps S814 to S816 are newly added steps, and their technical effects can be referred to S715 to S717.

[0204] Using the aforementioned method for activating the soft keyboard, after the event handling module of the electronic device determines that the interface element corresponding to the mouse click operation is an input control, the event handling module calls the event decision module to obtain the decision result for the mouse click operation and determines not to activate the soft keyboard. Specifically, the event decision module determines not to activate the soft keyboard based on the most recent input event type being mouse input.

[0205] (3) Taking input event as the focus switching example

[0206] Figure 9 A flowchart illustrating the soft keyboard activation method provided in this application embodiment. Figure 4 .like Figure 9 As shown above, in the aforementioned Figure 7 Following S701 to S713 of the illustrated embodiment, or, in the foregoing Figure 8 After steps S801 to S812 of the illustrated embodiment, the soft keyboard activating method may further include:

[0207] S901, if the type of the interface element corresponding to the input operation is a preset control, the event handling module sends a notification message 5 to the first application. The notification message 5 is used to indicate that the interface element corresponding to the input operation is a preset control.

[0208] In this embodiment, the preset control refers to a control that can trigger focus switching. Input operations include touch screen operations or mouse input operations, etc.

[0209] S902, the first application, based on notification message 5, switches the focus from the interface element corresponding to the input operation to the preset input area.

[0210] After receiving notification message 5, the first application switches the focus from the interface element corresponding to the input operation to the preset input area according to the preset control indicated in notification message 5. The preset input area can be the input area on the new window created by the first application (see [reference]). Figure 10 The editing area 1004 shown can also be the input area on the interface provided by the first application, excluding the interface elements corresponding to the input operation.

[0211] For example, Figure 10 This is a schematic diagram illustrating the interface changes of an electronic device provided in an embodiment of this application. Taking a tablet computer as an example and office software as the first application, as shown below... Figure 10 As shown in (a), the tablet computer's display screen shows an interface 1000 provided by the office software. The interface 1000 includes a menu bar 1001. When the user clicks on the "File" control in the menu bar 1001, the tablet computer pops up a menu window 1002. The menu window 1002 includes controls such as "New", "Open", and "Save".

[0212] Upon detecting a user's click on the "New" control in menu window 1002, the tablet displays a new document window 1003 and switches the focus from the "New" control to the edit box 1004 of window 1003. Figure 10 As shown in (b), the tablet computer displays a blinking cursor 1005 in the edit box 1004 to indicate that the edit box 1004 has focus.

[0213] For example, a tablet computer displays an interface that includes an information bar with a "Claim Now" button. When the user clicks the "Claim Now" button, the tablet computer switches the focus to the phone number input box in the information bar, and the phone number input box gains focus.

[0214] S903, the first application sends notification message 6 to the event encapsulation module. Notification message 6 is used to indicate relevant data for focus switching.

[0215] The data related to focus switching may include the position of the preset input area for obtaining focus.

[0216] S904, the event encapsulation module generates a focus switching event based on notification message 6.

[0217] After receiving notification message 6, the event encapsulation module processes the relevant data indicating the focus switch in notification message 6 and encapsulates it into a focus switch event.

[0218] S905, the event encapsulation module sends a focus switching event to the event decision module.

[0219] S906, the event decision module writes the focus switching event to the preset storage space.

[0220] If the preset storage space is not empty, the event decision module first clears the preset storage space, and then writes the focus switching event into the preset storage space.

[0221] In this embodiment, S905 and S906 are newly added steps, and their technical effects can be referred to S706 and S707.

[0222] S907 can be executed simultaneously with S905.

[0223] S907, the event encapsulation module adds focus switching events to the event processing queue.

[0224] S908, the event handling module retrieves the focus switching event from the event handling queue.

[0225] S909, the event handling module controls the switching of focus to a preset input area based on the focus switching event, and displays the cursor in the preset input area.

[0226] S910, the event handling module sends an event decision request 3 to the event decision module.

[0227] S911, the event decision module, based on event decision request 3, retrieves the type of the most recent input event from the preset storage space as focus switching, and determines not to wake up the soft keyboard.

[0228] S912, the event decision module sends event decision response 3 to the event processing module. Event decision response 3 is used to indicate that the soft keyboard should not be invoked.

[0229] After the event handling module receives event decision response 3, it can end the process.

[0230] In this embodiment, steps S910 to S912 are newly added steps, and their technical effects can be referred to S715 to S717.

[0231] Using the aforementioned soft keyboard activation method, after the event handling module of the electronic device determines that the interface element corresponding to the input operation (which is an input operation applied to the interface provided by the first application) is a preset control, the event handling module notifies the first application. The first application then triggers the event encapsulation module to generate a focus switching event, which is then executed by the event handling module. Furthermore, the event handling module also calls the event decision module to obtain the decision result for the focus switching event, determining not to activate the soft keyboard. Specifically, the event decision module determines not to activate the soft keyboard based on the most recent input event type being focus switching.

[0232] Based on the foregoing embodiments, this application provides a soft keyboard activation method that can be applied to electronic devices with display functions. Figure 11 A flowchart illustrating the soft keyboard activation method provided in this application embodiment. Figure 4 .like Figure 11 As shown, the method includes:

[0233] S1101, the electronic device displays a first interface, the first interface including a first control.

[0234] S1102, An operation applied to the first control is detected, and the electronic device obtains the type of the input event corresponding to the operation.

[0235] S1103, the electronic device wakes up or hides the soft keyboard according to the type of input event corresponding to the operation.

[0236] The activation of the soft keyboard by an electronic device can also be described as the electronic device launching the soft keyboard; specifically, the electronic device activates the soft keyboard by launching an input method application. The concealment of the soft keyboard by an electronic device can also be described as the electronic device not activating the soft keyboard, or the electronic device disabling the activation of the soft keyboard, or the electronic device blocking the activation of the soft keyboard.

[0237] The first interface can be a user interface provided by any application in the electronic device, which can be a system application or a third-party application; this application does not limit this. The first interface displays a first control, which can also be described as a first interface element.

[0238] The electronic device detects an operation performed on a first control on a first interface and can generate a corresponding input event based on the relevant data of that operation. This operation can be a screen touch operation, and the corresponding input event includes a screen touch event or a focus switching event. Alternatively, the operation can be a mouse input event, and the corresponding input event includes a mouse input event or a focus switching event.

[0239] In this embodiment, the electronic device determines the user's actual input intent (whether the user wants to use the keyboard or the soft keyboard) by identifying the type of input event corresponding to the operation. The electronic device determines whether to activate the soft keyboard based on the type of input event, which can cover most usage scenarios (e.g., Figure 2 As shown in the various scenarios, this approach enables the on-screen keyboard to be activated for the user when necessary, improving the user experience. Compared to solutions that determine whether to activate the on-screen keyboard by detecting the keyboard connection status, the above solution avoids situations where the on-screen keyboard is disabled even when the keyboard is physically unavailable (i.e., the user cannot directly touch the keyboard).

[0240] In one optional embodiment, the first control includes an input control, and the type of input event includes screen touch events or mouse input events. Input controls include, but are not limited to, input boxes, search boxes, and edit boxes.

[0241] In one possible implementation, an operation on an input control is detected. If the type of the input event corresponding to the operation is a screen touch event, the electronic device determines to activate the soft keyboard.

[0242] In another possible implementation, if an operation is detected that acts on an input control, and the type of the input event corresponding to the operation is a mouse input event, the electronic device determines not to invoke the soft keyboard.

[0243] In one optional embodiment, the first control includes a preset control, which is a control used to trigger focus switching. The type of input event includes a focus switching event. If an operation is detected acting on the preset control, and the type of the input event corresponding to the operation is a focus switching event, the electronic device determines not to invoke the soft keyboard.

[0244] In one optional embodiment, the electronic device includes an event decision module. Upon detecting an operation applied to a first control, the event decision module retrieves the type of the input event corresponding to the operation from a preset storage space. Based on the type of the input event corresponding to the operation, the event decision module determines whether to activate the soft keyboard. The preset storage space is used by the event decision module to record the type of the most recent input event.

[0245] In one optional embodiment, the electronic device includes an event encapsulation module and an event processing module. The method further includes: detecting an operation performed on a first control; the event encapsulation module of the electronic device generating an input event; the event encapsulation module adding the input event to an event processing queue; the event processing module retrieving the input event from the event processing queue; and the event processing module controlling the execution of a response corresponding to the input event. The response can be referred to... Figure 7 S714 of the embodiment, or Figure 8 S813 of the embodiment, or Figure 9 S909 of the embodiment.

[0246] In one optional embodiment, upon detecting an operation applied to the first control, the event encapsulation module of the electronic device generates an input event corresponding to the operation and sends the input event to the event decision module of the electronic device. After receiving the input event, the event decision module first clears the preset storage space and then writes the input event back into the preset storage space. In some embodiments, the preset storage space can also be described as a cache.

[0247] The event decision module uses a write-overwrite method to record the type of the most recent input event in a preset storage space, which is used to decide whether to wake up the soft keyboard, thereby decoupling event decision-making from event processing.

[0248] In one optional embodiment, upon detecting an operation applied to the first control, the event handling module of the electronic device calls the event decision module of the electronic device to obtain the decision result of the event decision module for the input event. The decision result is used to indicate whether to activate the soft keyboard. The event handling module activates or hides the soft keyboard according to the decision result indicated by the event decision module.

[0249] The event handling module can send an event decision request to the event decision module. Based on the event decision request, the event decision module retrieves the type of the most recent input event from a preset storage space. The event decision module then determines whether to activate the soft keyboard based on the type of the most recent input event. The event decision module returns an event decision response to the event handling module, indicating whether to activate the soft keyboard.

[0250] The operating system (OS) running on the electronic device provided in this application embodiment can be various operating systems used in the industry, such as operating systems developed based on OpenHarmony, such as HarmonyOS; or other operating systems such as Android™, iOS mobile operating system; it can also be various open-source operating systems or their derivatives, such as Linux OS, and other embedded operating systems; or it can be a new type of operating system in the future, such as an operating system based on artificial intelligence (AI). An operating system is a set of interrelated system software programs that manage and control the operation of electronic devices, utilize and run hardware and software resources, and provide public services to organize user interaction. In electronic devices, the operating system connects downwards to the physical devices at the hardware layer and provides a runtime environment for application software upwards.

[0251] An operating system typically includes a kernel layer, a middleware layer, and an application layer. The application layer includes applications, which can include system applications and third-party applications. The middleware layer includes a suite of software providing various services to application developers, or frameworks providing services such as databases, multimedia, and graphics, or capabilities such as distributed scheduling and system scaling. For example, the middleware layer may include a framework layer and / or a system service layer. The framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The system service layer includes the system's core capabilities, providing services to applications through the framework layer. The kernel layer is the layer between hardware and software. The kernel layer may include hardware drivers and the operating system kernel. In addition to providing hardware drivers, the kernel layer also supports functions such as memory management and system process management.

[0252] In daily life, users encounter a wide variety of electronic devices in different forms and applications. Therefore, based on the different forms and functions of electronic devices, different application scenarios, and different user needs, the operating systems used in these devices may also differ. The basic functions implemented by the electronic device provided in this application can be implemented using a general-purpose operating system or a dedicated operating system. To more clearly illustrate the implementation of the embodiments of this application under a specific operating system, Figure 12 The software architecture of HarmonyOS is illustrated, and those skilled in the art can deduce the implementation of the embodiments of this application under other specific operating systems, such as the implementation under Android™.

[0253] Reference Figure 12The software architecture of electronic devices can be divided into several layers. In some embodiments, from bottom to top, these layers are: kernel layer, system service layer, framework layer, and application layer. Layers communicate with each other through software interfaces. System functions can be tailored, added, or combined at the subsystem level depending on the deployment scenario of different device forms. Each subsystem can also be tailored, added, or combined at the functional level.

[0254] kernel layer

[0255] The Kernel Abstraction Layer (KAL) provides basic kernel capabilities to upper layers by shielding the differences between multiple kernels, including but not limited to process / thread management, memory management, file system, network management, and peripheral device management.

[0256] Kernel Subsystem: Supports the selection of a suitable OS kernel for different resource-constrained devices, including but not limited to Linux kernel, HarmonyOS kernel, LiteOS (Lite Operating System), etc.

[0257] Driver Subsystem: The driver framework is the foundation for the open system hardware ecosystem, providing unified peripheral access capabilities and a framework for driver development and management. The driver framework includes: display drivers, camera drivers, audio drivers, Bluetooth drivers, sensor drivers, etc.

[0258] System service layer

[0259] The system service layer comprises the core capabilities of the system, providing services to applications through the framework layer. This layer includes, but is not limited to, the following subsystems:

[0260] The system's basic capability subsystem set provides fundamental capabilities for the operation, scheduling, and migration of distributed applications across multiple devices. This set may include distributed soft bus, distributed data management, distributed task scheduling, and Ark multi-language runtime; it may also include multi-modal input subsystem, graphics subsystem, security subsystem, and AI subsystem.

[0261] The functions of the multi-mode input subsystem can be corresponding to Figure 4 or Figure 6 The input management module shown.

[0262] Basic software service subsystem set: provides public and general software services; the basic software service subsystem set may include event notification subsystem, telephone service subsystem, multimedia subsystem, etc.

[0263] Enhanced Software Service Subsystem Set: Provides differentiated enhanced software services for different devices; the enhanced software service subsystem set may include proprietary business subsystems for smart screens, proprietary business subsystems for wearables, proprietary business subsystems for the Internet of Things (IoT), etc.

[0264] Hardware service subsystem set: Provides hardware services; the hardware service subsystem set may include location service subsystem, unified identity and access management (IAM) subsystem, wearable proprietary hardware service subsystem, biometric identification, IoT proprietary hardware service, and other subsystems.

[0265] Distributed task scheduling enables distributed service management (discovery, synchronization, registration, and invocation), supporting remote startup, remote invocation, remote connection, and migration of applications across devices.

[0266] Distributed data management enables data synchronization, data storage, data sharing, and data access across all scenarios and devices.

[0267] The distributed soft bus provides communication-related capabilities for seamless interconnection between multiple devices, including: WLAN service capabilities, Bluetooth service capabilities, soft bus, inter-process communication RPC (Remote Procedure Call), and StarFlash communication capabilities.

[0268] Ark Multilingual Runtime is a unified compilation runtime platform designed to support the joint compilation and execution of multiple programming languages ​​and multiple chip platforms.

[0269] Framework layer

[0270] The framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The framework layer includes: the ArkUI framework (which provides a complete infrastructure for UI development of system applications, including UI functions such as components, layouts, animations, and interactive events, as well as a real-time interface preview tool), the user application framework, and the Ability framework (an Ability is a lightweight application; the Ability framework schedules and manages the operation and lifecycle of Abilities). Different devices may have different operating systems, and the APIs they support may also differ.

[0271] The HarmonyOS API is a series of open capabilities provided to support HarmonyOS application development. The HarmonyOS API can be set at the framework layer or independently of the framework layer. The HarmonyOS API includes the Audio API (audio service), Push API (push service), and Account API (account service), among others.

[0272] Application layer

[0273] Applications can include system applications and extended / third-party applications. System applications can include the desktop, app store, control bar, settings, contacts, phone, camera, etc., while extended / third-party applications can include social applications, travel applications, browser applications, office software, input method applications, etc. In this embodiment, the application layer may also include a third-party UI framework, the functionality of which is as described in the foregoing embodiments.

[0274] This application provides an electronic device, including: one or more processors and a memory; the memory is coupled to one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the method as described in any of the above embodiments.

[0275] This application provides a chip or chip system applied to an electronic device. The chip or chip system includes one or more processors, which are used to invoke computer instructions to cause the electronic device to perform the methods as described in any of the above embodiments.

[0276] This application provides a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the method of any of the above embodiments.

[0277] The methods described in the above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. If implemented in software, the functionality can be stored as one or more instructions or code on or transmitted on a computer-readable medium. A computer-readable medium can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. A storage medium can be any target medium accessible by a computer.

[0278] In one possible implementation, a computer-readable medium may include random access memory (RAM), read-only memory (ROM), compact discread-only memory (CD-ROM) or other optical disc storage, magnetic disk storage or other magnetic storage devices, or any other medium intended to carry or store the required program code in the form of instructions or data structures, and accessible by a computer. Furthermore, any connection is appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Magnetic disks typically reproduce data magnetically, while optical disks optically reproduce data using lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0279] This application provides a computer program product, which includes computer program code. When the computer program code is run on an electronic device, it causes the computer to perform the method of any of the above embodiments.

[0280] It should be noted that the modules or components described in the above embodiments can be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs), etc. Furthermore, when a module is implemented through processing element scheduler code, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processors capable of calling program code, such as a controller. Additionally, these modules can be integrated together to implement a system-on-a-chip (SOC).

[0281] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)).

[0282] The term "multiple" in this document refers to two or more. The term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Furthermore, the character " / " in this document generally indicates an "or" relationship between the preceding and following related objects; in formulas, " / " indicates a "division" relationship. Additionally, it should be understood that in the description of this application, words such as "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or order.

[0283] It is understood that the various numerical designations used in the embodiments of this application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of this application.

[0284] It is understood that, in the embodiments of this application, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

Claims

1. A method for activating a soft keyboard, characterized in that, Applied to electronic devices with display functions, the method includes: The electronic device displays a first interface, which includes a first control. Upon detecting an operation applied to the first control, the electronic device obtains the type of the input event corresponding to the operation; The electronic device determines whether to activate the soft keyboard based on the type of the input event; The electronic device can activate or hide the soft keyboard.

2. The method according to claim 1, characterized in that, The first control includes an input control, and the type of input event includes screen touch event or mouse input event; The electronic device determines whether to activate the soft keyboard based on the type of the input event, including: If the type of the input event is a screen touch event, the electronic device determines to activate the soft keyboard; or, If the type of the input event is a mouse input event, the electronic device determines not to invoke the soft keyboard.

3. The method according to claim 1, characterized in that, The first control includes a preset control, which is a control used to trigger focus switching; the type of the input event includes a focus switching event; The electronic device determines whether to activate the soft keyboard based on the type of the input event, including: If the type of the input event is a focus switching event, the electronic device determines not to wake up the soft keyboard.

4. The method according to any one of claims 1 to 3, characterized in that, The electronic device includes an event decision module. Upon detecting an operation applied to the first control, the electronic device acquires the type of the input event corresponding to the operation, including: Upon detecting an operation applied to the first control, the event decision module retrieves the type of the input event corresponding to the operation from a preset storage space; the preset storage space is used by the event decision module to record the type of the most recent input event. The electronic device determines whether to activate the soft keyboard based on the type of the input event, including: The event decision module determines whether to activate the soft keyboard based on the type of input event corresponding to the operation.

5. The method according to any one of claims 1 to 4, characterized in that, The electronic device includes an event encapsulation module and an event processing module, and the method further includes: Upon detecting an operation applied to the first control, the event encapsulation module generates the input event; The event encapsulation module adds the input event to the event processing queue; The event processing module retrieves the input event from the event processing queue; The event handling module controls the execution of the response corresponding to the input event.

6. The method according to claim 5, characterized in that, The method further includes: After generating the input event, the event encapsulation module sends the input event to the event decision module of the electronic device; After the event decision module clears the preset storage space, it writes the input event into the preset storage space.

7. The method according to claim 5 or 6, characterized in that, The method further includes: The event handling module obtains the decision result of the event decision module for the input event by calling the event decision module of the electronic device; the decision result is used to indicate whether to wake up the soft keyboard. The electronic device activating or hiding the soft keyboard includes: The event handling module activates or hides the soft keyboard based on the decision result.

8. An electronic device, characterized in that, The electronic device includes: one or more processors and memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 7.

9. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the one or more processors being used to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 7.

11. A computer program product, characterized in that, The computer program product includes computer program code that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1 to 7.