WO2023124141A1 - Input method calling method and related device - Google Patents

Input method calling method and related device Download PDF

Info

Publication number
WO2023124141A1
WO2023124141A1 PCT/CN2022/114289 CN2022114289W WO2023124141A1 WO 2023124141 A1 WO2023124141 A1 WO 2023124141A1 CN 2022114289 W CN2022114289 W CN 2022114289W WO 2023124141 A1 WO2023124141 A1 WO 2023124141A1
Authority
WO
WIPO (PCT)
Prior art keywords
input
input method
device type
event
management service
Prior art date
Application number
PCT/CN2022/114289
Other languages
French (fr)
Chinese (zh)
Other versions
WO2023124141A9 (en
Inventor
贾宇刚
Original Assignee
荣耀终端有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 荣耀终端有限公司 filed Critical 荣耀终端有限公司
Publication of WO2023124141A1 publication Critical patent/WO2023124141A1/en
Publication of WO2023124141A9 publication Critical patent/WO2023124141A9/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0233Character input methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04847Interaction techniques to control parameter settings, e.g. interaction with sliders or dials

Definitions

  • the present application relates to the technical field of terminals, and in particular to an input method calling method and related equipment.
  • terminal devices such as mobile phones and tablet computers are developing more and more rapidly.
  • user needs are also constantly changing, gradually developing from the final basic communication needs to multi-dimensional communication and entertainment needs such as vision, hearing and touch. Therefore, more and more terminal equipment manufacturers are increasingly Pay attention to human-computer interaction.
  • some manufacturers have begun to develop some equipment used in conjunction with the terminal equipment. For example, stylus, keyboard, etc. Users can use these input devices to better realize their own input needs. It can be understood that, due to the differences in input methods of users through these input devices (for example, touch input and keyboard input), the applicable input modes of different input devices may be different. For example, stylus input may be applicable to handwriting input method, and keyboard input may be applicable to keyboard input method.
  • the input interface displayed first is often the default input interface set by the user. If the input device changes, the user needs to manually switch the input method, which affects the user experience.
  • the present application provides an input method calling method and related equipment, which can determine the input device type according to the generated input event, find the input method corresponding to the input device type in the input method calling rules, and then call the input method.
  • the input method can be adaptively invoked according to the input device used by the user, without the need for the user to manually switch the input method, which reduces the redundant operation of the user and improves the user experience.
  • the present application provides a method for invoking an input method.
  • the method can be applied to electronic devices.
  • the method may include: receiving a first operation, and displaying a first interface in response to the first operation; the first operation is an input operation performed through a first input method; the first interface displays a first input method ;
  • the first input method is an input method corresponding to the first input method; receiving a second operation, and displaying a second interface in response to the second operation; the second operation is performed through the second input method input operation; the second interface displays a second input method;
  • the second input method is an input method corresponding to the second input method; wherein, the first input method is different from the second input method Law.
  • the electronic device may receive an input operation performed by the user through a first input method, and in response to the input operation, the electronic device may display a first interface including the first input method.
  • the electronic device may receive an input operation performed by the user through the second input method, and in response to the input operation, the electronic device may display a second interface including the second input method.
  • the first input method corresponds to the first input method
  • the second input method corresponds to the second input method. That is to say, the electronic device can determine the input method to be invoked according to the user's input method, and display the input method on the user interface.
  • the input method called and displayed by the electronic device can be determined according to the user's input method, and not every input method called is the default input method or the historical input method. In this case, the user does not need to manually switch to an input method that is more suitable for the current input method, which fully considers the user's experience and improves the user experience.
  • the first input mode may be a finger touch mode, a stylus touch mode, or a keyboard input mode.
  • the corresponding first operation may be a finger touch operation, a stylus touch operation, and a keyboard tapping operation.
  • the second input method may also be a finger touch method, a stylus touch method, or a keyboard input method.
  • the corresponding second operation may be a finger touch operation, a stylus touch operation, and a keyboard tapping operation.
  • the first input method may be a finger touch method
  • the second input method may be a stylus touch method.
  • the user first performs input on the electronic device through a finger touch operation, and the electronic device invokes a pinyin input method and displays a soft keyboard on the user interface for the user to input. Then, the user turns to use a stylus for input, and the electronic device detects that the current input device used by the user is a touch screen-stylus, and the electronic device invokes the handwriting input method and displays a handwriting area on the user interface for the user to input.
  • the first input method is an input method using a first input device; the second input method is an input method using a second input device method; the first input method is an input method corresponding to the first input method, specifically including: the first input method is an input method corresponding to the first device type; the first device type is the input method The device type corresponding to the first input device; the second input method is an input method corresponding to the second input method, specifically including: the second input method is an input method corresponding to the second device type; The second device type is a device type corresponding to the second input device.
  • the first input method may be an input method using a first input device
  • the second input method may be an input method using a second input device.
  • the electronic device includes the corresponding relationship between the device type of the input device and the input method. After receiving the user's input operation, the electronic device can find the corresponding input method according to the input device used by the input operation, and invoke and display the input method. That is to say, the electronic device can determine the input method to be invoked according to the device type of the input device. In other words, the user does not need to manually switch to an input method that is more suitable for the current input device, which fully considers the user's experience and improves the user experience.
  • the electronic device may determine the input device based on the input method, and then determine the input method that needs to be invoked.
  • the first input mode is a keyboard input mode
  • the first input device is a keyboard
  • the electronic device may determine that the first device type is a keyboard based on the first input device.
  • the first input mode is a finger touch mode
  • the first input device is a finger
  • the electronic device may determine that the first device type is a finger.
  • the first input mode is a stylus touch mode
  • the first input device is a stylus
  • the electronic device may determine that the first device type is a stylus.
  • the electronic device may also determine the input method to be invoked according to the input method and the input device. For example, when the user uses a finger touch method and a stylus touch method for input, the input device is a touch screen, but due to different operations on the touch screen (different input methods), different input events are generated. In this case, the electronic device can combine the input method and the input device to determine the device type of the input device, so as to determine the input method that needs to be invoked.
  • the first input mode is a finger touch mode
  • the first input device is a touch screen
  • the electronic device may determine that the first device type is a touch screen-finger based on the first input mode and the first input device.
  • the first input mode is a stylus touch mode
  • the first input device is a touch screen
  • the electronic device may determine that the first device type is a touch screen-stylus based on the first input mode and the first input device.
  • the method before displaying the first interface in response to the first operation, the method further includes: using an input method application in the electronic device based on the first An interface sends a registration monitoring request to the input method management service in the electronic device; the registration monitoring request is used to request the input method management service to monitor the input device; send the electronic device through the input method management service The input management service in sends a first message; the first message is used to request the input management service to monitor the input device.
  • the electronic device needs to monitor the input device, so as to call the input method according to the input device.
  • the input method application in the electronic device may send a registration monitoring request to the input method management service in the electronic device based on the first interface, and the input method management service then sends a first message to the input management service to request monitoring of the input device.
  • the input management service monitors input devices by monitoring input events. That is to say, the input management service can determine the input device through the input event reported by the input distributor.
  • the input management service can pass the changed input device type to the input method management service, and then call back to the input method application, and then the input method determines the input method that needs to be switched.
  • the monitoring input device mentioned in the above process is the premise of calling the input method according to the type of the input device, and is an indispensable step to realize the adaptive calling of the input method.
  • the input method application does not need to send a registration monitoring request to the input method management service every time the input method is invoked.
  • the input method application can call or switch the input method without sending a registration monitoring request.
  • the user can manually switch the input method application used.
  • the switched input method application needs to send a monitoring request to the input method management service again.
  • the first interface is a custom interface and is used to send a registration monitoring request.
  • the first interface is a custom interface and is used to send a registration monitoring request.
  • the displaying the first interface in response to the first operation specifically includes: generating a first input event in response to the first operation;
  • the first input event is an input event generated for the first input device; based on the first input event, the first input method is invoked, and the first interface is displayed; in response to the second operation, displaying
  • the second interface specifically includes: generating a second input event in response to the second operation; the second input event is an input event generated for the second input device; calling the second input event based on the second input event The second input method is selected, and the second interface is displayed.
  • the electronic device in response to a user's input operation, can generate an input event.
  • the electronic device can determine the type of the input device according to the input event, so as to determine the input method that needs to be invoked.
  • the input event dispatcher in the electronic device can report the generated input event to the input management service, and the input management service can determine the input device type according to the input event, and pass the input device type to the input method management service, and finally to the The input method is applied, thereby calling the corresponding input method.
  • the user does not need to manually switch to an input method that is more suitable for the current input device, which fully considers the user's experience and improves the user experience.
  • the user does not need to use other applications other than the input method application to determine the input method to be invoked.
  • invoking the first input method based on the first input event specifically includes: using the input management service to determine based on the first input event The first device type, and report the first device type to the input method management service; compare the first device type with the first historical device type through the input management service; the first historical device type The type is the device type of the input device corresponding to the last input event of the first input event generated by the electronic device; if the first device type is different from the first historical device type or the first historical device type does not exist A historical device type, sending monitoring callback information to the input method application based on the second interface through the input method management service; the monitoring callback information includes the first device type; the input method application according to the monitoring callback For the first device type in the information, search for the first input method in the input method call rule, and call the first input method; the input method call rule includes the device type corresponding to the input device and the input method Correspondence between.
  • the input management service can determine the device type of the input device based on the input event, compare the current input device type with the historical device type, and judge whether the current input device type needs to be changed according to the comparison result. Passed to the input method management service. If the current input device type is different from the historical device type or there is no historical device type, the input management service can pass the input device type to the input method management service.
  • the input management service in the electronic device can pass the input device type to the input method management service, and then the input method management service passes For the input method application, the input method application finally finds the input method corresponding to the input device type according to the input method calling rules, and calls and displays the input method. It can be understood that in this way, the user does not need to manually switch the appropriate input method, which improves the user experience.
  • the input method calling rule includes the corresponding relationship between the input device type and the input method.
  • the input method calling rules can be stored in the input method application, and can also be stored in other areas for the input method application to call.
  • the second interface is a custom interface, which is used to transmit monitoring callback information.
  • the monitoring callback information may include the type of the input device.
  • invoking the second input method based on the second input event specifically includes: using the input management service to determine based on the second input event the second device type, and report the second device type to the input method management service; use the input management service to compare the second device type with the second historical device type; the second The historical device type is the device type of the input device corresponding to the last input event of the second input event generated by the electronic device; if the second device type is different from the second historical device type or does not exist The second historical device type, through the input method management service to send monitoring callback information to the input method application based on the second interface; the monitoring callback information includes the second device type; the input method application according to the Monitoring the second device type in the callback information, searching for the second input method in the input method calling rules, and calling the second input method.
  • the process of invoking the second input method based on the second input event may refer to the process of invoking the first input method based on the first input event.
  • the input management service can determine the device type of the input device based on the input event, compare the current input device type with the historical device type, and judge whether the current input device type needs to be changed according to the comparison result. Passed to the input method management service. Reference can be made to the above for specific descriptions and beneficial effects, and will not be repeated here.
  • the last input event of the second input event generated by the electronic device is the first input event; the second historical device type is the first device type.
  • the first input event may be a previous input event of the second input event. That is to say, when the user performs input on the electronic device, he switches from the first input device to the second input device. Due to the change of the input device and the type of the input device, the input method invoked and displayed by the electronic device also changes—from the previous first input method to the second input method. In this process, the user no longer needs to manually switch the input method, which improves the user experience.
  • the first input device is a touch screen-finger
  • the second input device is a touch screen-stylus.
  • the user first uses fingers to input on the soft keyboard displayed on the electronic device, and then switches to the stylus for input. It can be understood that the user can use the stylus to directly input on the screen of the electronic device. That is to say, once the stylus touches the touch screen of the electronic device and generates a touch event of the stylus, the electronic device can switch to display the corresponding input method.
  • the first interface and the second interface are user interfaces of a first application; the first application is an application in the electronic device ; The first operation is used to prompt the first application to acquire focus.
  • both the first interface and the second interface are user interfaces of the first application.
  • the electronic device Before displaying the first interface, the electronic device may display the third interface.
  • the first operation may be an input operation for a corresponding edit control in the third interface (for example, clicking on the edit control).
  • the first application in the electronic device can obtain the focus, and notify the input method management service that it has obtained the focus and request to bind the input method.
  • the edit control is a control used for input editing. For example, edit boxes, etc.
  • the second operation is used to prompt the first application to obtain the focus.
  • the second operation may be an input operation (for example, clicking on an edit control) on a corresponding edit control included in other user interfaces in the first application.
  • the first application in the electronic device can obtain the focus, and notify the input method management service that it has obtained the focus and request to bind the input method. That is to say, after the first application displays the first interface and before displaying the second interface, it needs to reacquire the focus so as to display the input method, thereby implementing input.
  • the first interface is a user interface of a first application; the second interface is a user interface of a second application; the first application and The second application is an application in the electronic device; the first operation is used to prompt the first application to obtain focus; the second operation is used to prompt the second application to obtain focus.
  • the first interface is the user interface of the first application
  • the second interface is the user interface of the second application. Users can switch between different input devices to input in different applications.
  • the first operation may be an input operation directed at the edit control of the corresponding interface of the first application
  • the second operation may be an input operation directed at the edit control of the corresponding interface of the second application.
  • the present application provides an input method calling method.
  • the method can be applied to electronic devices.
  • the method may include: receiving a target operation, generating a target input event in response to the target operation; determining the target device type based on the target input event through the input management service, and reporting the target device type to the input method management service; Compare the target device type with the historical device type through the input management service; the historical device type is the device type of the input device corresponding to the last input event of the target input event generated by the electronic device; if the If the target device type is different from the historical device type or the historical device type does not exist, the monitoring callback information is sent to the input method application in the electronic device through the input method management service; the monitoring callback information includes the Target device type; use the input method application to search for the target input method in the input method call rule according to the target device type in the monitoring callback information; the input method call rule includes the device type corresponding to the input device Correspondence between input methods; call the target input method, and display an input interface; the input interface displays
  • the electronic device can generate a target input event in response to a user's target operation, and determine the target device type according to the target input event.
  • the electronic device can search the input method corresponding to the target device type in the input method calling rule, and call the input method. With this method, the user does not need to manually switch to an input method that is more suitable for the current input device, which fully considers the user's experience and improves the user experience.
  • the target operation is an input operation performed by an input device.
  • a target input event is an input event generated for a target action.
  • the target device type is the device type of the input device.
  • the method before generating a target input event in response to the target operation, the method further includes: using the input method application to send an input message based on the first interface to The input method management service sends a registration monitoring request; the registration monitoring request is used to request the input method management service to monitor the input device; the input method management service sends a first message to the input management service; The first message is used to request the input management service to monitor the input device.
  • the determining the target device type based on the target input event through the input management service specifically includes: when the target input event is the first input event In this case, the input management service determines that the target device type is the first device type; when the target input event is the second input event, the input management service determines that the target device type is the second Two device types: when the target input event is a third input event, determine that the target device type is a third device type through the input management service.
  • the first input event is a finger touch event
  • the first device type is a touch screen-finger
  • the second input event is a handwriting stroke control event
  • the second device type is a touch screen-stylus pen
  • the third input event is a keyboard event
  • the third device type is a keyboard.
  • the user may use different input devices to perform input, and the input events generated by the electronic device may be different types of input events.
  • the target operation may be a finger touch operation, a stylus touch operation, and a keyboard tapping operation.
  • the target input event may be a finger touch event, a stylus touch event, and a keyboard event.
  • target input event may also be other types of input events.
  • mouse events key events, etc.
  • the present application provides an electronic device.
  • the electronic equipment includes a receiving module and a display module.
  • the receiving module is configured to receive the first operation; the display module is configured to display the first interface in response to the first operation.
  • the first operation is an input operation performed through the first input method, and the first interface displays the first input method.
  • the first input method is an input method corresponding to the first input mode.
  • the receiving module is further configured to receive the second operation.
  • the display module is further configured to display a second interface in response to the second operation. It can be understood that the second operation is an input operation performed through the second input method, and the second interface displays the second input method.
  • the second input method is an input method corresponding to the second input method.
  • the first input mode is an input mode using a first input device; the second input mode is an input mode using a second input device.
  • the first input method is an input method corresponding to the first input method, specifically including: the first input method is an input method corresponding to the first device type, and the first device type is a device type corresponding to the first input device.
  • the second input method is an input method corresponding to the second input method, specifically including: the second input method is an input method corresponding to the second device type, and the second device type is a device type corresponding to the second input device.
  • the electronic device may further include an input method application, an input method management service, and an input management service.
  • the input method application may be configured to send a registration monitoring request to the input method management service based on the first interface.
  • the registration monitoring request is used to request the input method management service to monitor the input device.
  • the input method management service may be used to send the first message to the input management service.
  • the first message is used to request the input management service to monitor the input device.
  • the electronic device may further include an input event generating module.
  • An input event generating module configured to generate a first input event in response to the first operation.
  • the input management service is further configured to determine the first device type based on the first input event, and report the first device type to the input method management service; compare the first device type with the first historical device type.
  • the first historical device type is the device type of the input device corresponding to the last input event of the first input event generated by the electronic device.
  • the input method management service is further configured to send monitoring callback information to the input method application through the second interface when the first device type is different from the first historical device type or the first historical device type does not exist.
  • the monitoring callback information includes the first device type.
  • the input method application is configured to search for the first input method in the input method calling rule according to the first device type in the monitoring callback information, and call the first input method.
  • the input method calling rule includes the corresponding relationship between the device type corresponding to the input device and the input method.
  • the input event generating module is further configured to generate a second input event in response to the second operation.
  • the input management service is further configured to determine the second device type based on the second input event, and report the second device type to the input method management service; compare the second device type with the second historical device type.
  • the second historical device type is the device type of the input device corresponding to the last input event of the second input event generated by the electronic device.
  • the input method management service is further configured to send monitoring callback information to the input method application through the second interface when the second device type is different from the second historical device type or there is no second historical device type.
  • the monitoring callback information includes the second device type.
  • the input method application is further configured to search for the second input method in the input method calling rule according to the second device type in the monitoring callback information, and call the second input method.
  • the last input event of the second input event generated by the electronic device is the first input event; the second historical device type is the first device type.
  • the first interface and the second interface are user interfaces of a first application; the first application is an application in the electronic device ; The first operation is used to prompt the first application to acquire focus.
  • the second operation is used to prompt the first application to obtain the focus.
  • the first interface is a user interface of a first application; the second interface is a user interface of a second application; the first application and The second application is an application in the electronic device; the first operation is used to prompt the first application to obtain focus; the second operation is used to prompt the second application to obtain focus.
  • the present application provides an electronic device.
  • the electronic device may include a receiving module, an input event generating module, an input management service, an input method management service, an input method application and a display module.
  • the receiving module is used for receiving the target operation.
  • the input event generating module is used for generating a target input event in response to the target operation.
  • the target operation is an input operation performed using an input device.
  • the input management service is used to determine the target device type based on the target input event, and report the target device type to the input method management service; compare the target device type with the historical device type.
  • the target device type is the device type of the input device.
  • the historical device type is the device type of the input device corresponding to the last input event of the target input event generated by the electronic device.
  • the input method management service is used to send monitoring callback information to the input method application in the electronic device through the input method management service when the target device type is different from the historical device type or there is no historical device type.
  • the monitoring callback information includes the target device type.
  • the input method application is used to search for the target input method in the input method calling rules according to the target device type in the monitoring callback information, and call the target input method.
  • the input method calling rule includes the corresponding relationship between the device type corresponding to the input device and the input method.
  • the display module is used for displaying the input interface. The input interface displays the target input method.
  • the input method application may also be configured to send a registration monitoring request to the input method management service based on the first interface.
  • the registration monitoring request is used to request the input method management service to monitor the input device.
  • the input method management service may also be used to send the first message to the input management service.
  • the first message is used to request the input management service to monitor the input device.
  • the input management service when used to determine the target device type based on the target input event, it is specifically used to: when the target input event is the first input event , the target device type is determined to be the first device type by the input management service; if the target input event is the second input event, the target device type is determined to be the second device type by the input management service; if the target input event is the third input event In the case of an event, the target device type is determined to be the third device type through the input management service.
  • the first input event is a finger touch event, and the first device type is a touch screen-finger;
  • the second input event is a stylus touch event, and the second device type is a touch screen-stylus;
  • the third input event is a keyboard event, and the second The third device type is keyboard.
  • the present application provides an electronic device.
  • the electronic device may include a display screen, memory, and one or more processors. Wherein, one or more processors are coupled with a memory, and the memory is used to store computer program codes, and the computer program codes include computer instructions.
  • the electronic device may receive a first operation.
  • the display screen is used to display the first interface in response to the first operation, and is also used to display the second interface in response to the second operation.
  • the first operation is an input operation performed through a first input mode.
  • the first interface displays the first input method.
  • the first input method is an input method corresponding to the first input mode.
  • the second operation is an input operation performed through the second input mode.
  • the second interface displays the second input method.
  • the second input method is an input method corresponding to the second input method.
  • the first input method is different from the second input method.
  • the first input method is an input method using a first input device; the second input method is an input method using a second input device.
  • the first input method is an input method corresponding to the first input method, specifically including: the first input method is an input method corresponding to the first device type, and the first device type is a device type corresponding to the first input device.
  • the second input method is an input method corresponding to the second input method, specifically including: the second input method is an input method corresponding to the second device type, and the second device type is a device type corresponding to the second input device.
  • the processor is configured to use the input method application in the electronic device to send a registration monitoring request to the input method management service in the electronic device based on the first interface;
  • the input method management service sends the first message to the input management service in the electronic device.
  • the registration monitoring request is used to request the input method management service to monitor the input device.
  • the first message is used to request the input management service to monitor the input device.
  • the processor is further configured to generate a first input event in response to the first operation; and invoke the first input method based on the first input event.
  • the first input event is an input event generated for the first input device.
  • the processor is further configured to generate a second input event in response to the second operation; and invoke the second input method based on the second input event.
  • the second input event is an input event generated for the second input device.
  • the processor when configured to call the first input method based on the first input event, it is specifically configured to: use the input management service to determine based on the first input event The first device type, and report the first device type to the input method management service; compare the first device type with the first historical device type through the input management service; if the first device type is different from the first historical device type or there is no first device type A historical device type, through the input method management service to send monitoring callback information to the input method application based on the second interface; through the input method application, according to the first device type in the monitoring callback information, search for the first input method in the input method call rule, And call the first input method.
  • the first historical device type is the device type of the input device corresponding to the last input event of the first input event generated by the electronic device.
  • the monitoring callback information includes the first device type.
  • the input method calling rule includes the corresponding relationship between the device type corresponding to the input device and the input method.
  • the processor when configured to call the second input method based on the second input event, it is specifically configured to: use the input management service to determine based on the second input event The second device type, and report the second device type to the input method management service; compare the second device type with the second historical device type through the input management service; if the second device type is different from the second historical device type or there is no first Two historical device types, send monitoring callback information to the input method application based on the second interface through the input method management service; through the input method application, search for the second input method in the input method calling rules according to the second device type in the monitoring callback information, And call the second input method.
  • the second historical device type is the device type of the input device corresponding to the last input event of the second input event generated by the electronic device.
  • the monitoring callback information includes the second device type.
  • a previous input event of the second input event generated by the electronic device is the first input event.
  • the second historical device type is the first device type.
  • the first interface and the second interface are user interfaces of the first application.
  • the first application is an application in an electronic device.
  • the first operation is used to prompt the first application to acquire focus.
  • the second operation is used to prompt the first application to obtain the focus.
  • the first interface is a user interface of the first application.
  • the second interface is a user interface of the second application.
  • the first application and the second application are applications in the electronic device.
  • the first operation is used to prompt the first application to obtain focus.
  • the second operation is used to prompt the second application to obtain the focus.
  • the present application provides an electronic device.
  • the electronic device may include a display screen, memory, and one or more processors. Wherein, one or more processors are coupled with a memory, and the memory is used to store computer program codes, and the computer program codes include computer instructions.
  • the electronic device can receive the target operation.
  • the processor can be used to generate a target input event in response to the target operation; determine the target device type based on the target input event through the input management service, and report the target device type to the input method management service; compare the target device type through the input management service and the historical device type; if the target device type is different from the historical device type or there is no historical device type, send monitoring callback information to the input method application in the electronic device through the input method management service; through the input method application, according to the monitoring callback information Target device type, find the target input method in the input method call rule; call the target input method, and display the input interface; the input interface displays the target input method.
  • the target operation is an input operation performed by an input device.
  • the target device type is the device type of the input device.
  • the historical device type is the device type of the input device corresponding to the last input event of the target input event generated by the electronic device.
  • the monitoring callback information includes the target device type.
  • the input method calling rule includes the corresponding relationship between the device type corresponding to the input device and the input method.
  • the processor is further configured to use the input method application in the electronic device to send a registration monitoring request to the input method management service in the electronic device based on the first interface; Send the first message to the input management service in the electronic device through the input method management service.
  • the registration monitoring request is used to request the input method management service to monitor the input device.
  • the first message is used to request the input management service to monitor the input device.
  • the processor when the processor is configured to determine the target device type based on the target input event, it is specifically configured to: when the target input event is the first input event , the target device type is determined to be the first device type by the input management service; if the target input event is the second input event, the target device type is determined to be the second device type by the input management service; if the target input event is the third input event In the case of an event, the target device type is determined to be the third device type through the input management service.
  • the first input event is a finger touch event, and the first device type is a touch screen-finger;
  • the second input event is a stylus touch event, and the second device type is a touch screen-stylus;
  • the third input event is a keyboard event, and the second The third device type is keyboard.
  • the present application provides a computer storage medium, including instructions, which, when the instructions are run on an electronic device, cause the electronic device to execute any possible implementation manner in the first aspect above.
  • the present application provides a computer storage medium, including instructions, which, when the instructions are run on an electronic device, cause the electronic device to execute any possible implementation manner in the second aspect above.
  • the embodiment of the present application provides a chip, the chip is applied to electronic equipment, and the chip includes one or more processors, and the processor is used to call computer instructions to make the electronic equipment execute any one of the above first aspects a possible implementation.
  • an embodiment of the present application provides a chip, the chip is applied to an electronic device, and the chip includes one or more processors, and the processor is used to invoke computer instructions so that the electronic device executes any one of the above-mentioned second aspects. a possible implementation.
  • the embodiment of the present application provides a computer program product containing instructions, which, when the computer program product is run on the device, causes the electronic device to execute any possible implementation of the first aspect above.
  • an embodiment of the present application provides a computer program product including instructions, which, when the computer program product is run on a device, cause the electronic device to execute any possible implementation manner in the second aspect above.
  • the beneficial effect of the input method invoking method provided by the second aspect above can refer to the beneficial effect of any possible implementation manner in the first aspect, which will not be repeated here.
  • the electronic equipment provided in the third aspect and the fifth aspect, the computer storage medium provided in the seventh aspect, the chip provided in the ninth aspect, and the computer program product provided in the eleventh aspect are all used to implement the above-mentioned first aspect. any possible implementation.
  • the electronic equipment provided by the fourth aspect and the sixth aspect above, the computer storage medium provided by the eighth aspect, the chip provided by the tenth aspect, and the computer program product provided by the twelfth aspect are all used to implement any one of the above second aspects a possible implementation. Therefore, for the beneficial effects that can be achieved, reference may be made to the beneficial effects of any possible implementation manner in the first aspect above, which will not be repeated here.
  • FIG. 1 is a schematic diagram of an input method calling scenario provided by an embodiment of the present application
  • 2A-2K are schematic diagrams of a group of user interfaces provided by the embodiment of the present application.
  • FIG. 3 is a schematic diagram of a hardware structure of an electronic device 100 provided in an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a software structure of an electronic device 100 provided in an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a process of invoking an input method provided by an embodiment of the present application.
  • FIG. 6 is a flow chart of an input method calling method provided by an embodiment of the present application.
  • FIG. 7 is a flow chart of another method for invoking an input method provided by the embodiment of the present application.
  • the user can directly touch the screen of the terminal device with a finger to realize input, and also can realize input through some input devices.
  • the input methods adopted by the user are different, the applicable input modes may be different. That is, the specific input methods applicable to different input methods may be different.
  • finger touch input may be suitable for keyboard input mode, that is, Quanpin input method, Wubi input method and other input methods that need to use a keyboard
  • stylus input may be suitable for handwriting input mode, that is, handwriting input method.
  • the default input mode is first displayed on the input interface.
  • the default input mode mentioned here may include the default input method set by the user and the input method used by the user when inputting last time. If the input mode needs to be switched due to the change of the input mode, the user generally needs to switch manually, which will affect the user experience.
  • the application provides an input method calling method and related equipment.
  • the electronic device can trigger input device monitoring when the input method application is started, and after the input method application receives the monitoring callback information, determine the input device type to be called according to the input device type included in the monitoring callback information Law.
  • the electronic device can adaptively provide a more reasonable input method according to the input method and the input device, without requiring the user to manually switch the input method, thereby improving user experience.
  • the invoked input method mentioned in this application refers to a specific input method.
  • handwriting input method Quanpin input method
  • stroke input method etc.
  • FIG. 1 is a schematic diagram of an input method calling scenario provided by an embodiment of the present application.
  • the user may input in the electronic device 100 in various input ways.
  • the multiple input methods may include but not limited to a finger touch input method and an input method using other external input devices for input. It can be understood that the external input device mentioned here refers to an input device independent of the electronic device 100 .
  • the finger touch input method mentioned in this application specifically means that the user implements input by touching the touch screen of the electronic device 100 with a finger. Similar to the way of finger touch input, the user can also make input by contacting other human skin with the touch screen of the electronic device 100 .
  • the input device is an external device independent of the electronic device 100 .
  • Input devices may include, but are not limited to, keyboards, stylus, mice, and the like.
  • the finger touch operation acting on the input area of the electronic device 100 may trigger a finger touch event.
  • the electronic device 100 may determine the input method adopted when inputting in the input area.
  • the user's operation acting on the input area of the electronic device 100 may trigger an input event.
  • the electronic device 100 may determine the type of the input event and the type of the corresponding input device, and based on the type of the input event and the type of the input device, determine the input method adopted when inputting in the input area.
  • the user may touch the stylus to the touch screen of the electronic device 100, and the touch operation of the stylus acting on the input area of the electronic device 100 may trigger a touch event of the stylus.
  • the electronic device 100 may determine to adopt a handwriting input method when performing input in the input area.
  • a communication connection may be established between the input device and the electronic device 100 .
  • the communication connection mode between the input device and the electronic device 100 may include a wired communication mode and a wireless communication mode.
  • the wireless communication method may include communication methods such as Bluetooth.
  • GUI graphics user interface
  • FIG. 2A is a schematic diagram of a user interface provided by an embodiment of the present application.
  • the user interface 210 displays a page on which application icons are placed.
  • the page may include multiple application icons (eg, a weather application icon, a calendar application icon, an email application icon, a settings application icon 211 , an application store application icon, a notes application icon, a photo album application icon, a voice recorder application icon, etc.).
  • a page indicator may also be displayed below the plurality of application icons to indicate the positional relationship between the currently displayed page and other pages.
  • tray icons eg, dialer application icon, messaging application icon, browser application icon 212, camera application icon.
  • the browser application icon 212 is an icon of a browser application.
  • a browser is an application program used to retrieve, display and deliver web information resources. Understandably, the tray icon remains displayed when the page is switched.
  • the electronic device 100 may detect a user operation on the browser application icon 212, and in response to the user operation, the electronic device 100 may display a user interface 220 (as shown in FIGS. 2B and 2C ).
  • the user interface 220 is the main interface of the browser. This interface is also a browser search interface. That is to say, the user can perform input in the corresponding area of the interface to realize searching. Therefore, the user interface 220 can also be understood as an input interface.
  • User interface 220 may include edit box 221 .
  • the edit box 221 can be used for input to search through the browser.
  • user operations may include, but are not limited to, touch operations, key operations, gesture operations, and voice operations, which are not limited in this application.
  • the user may click on an edit box 221 included in the user interface 220 .
  • the electronic device 100 may detect a finger touch operation acting on the edit box 221, thereby generating a finger touch event.
  • the finger touch event can be collected by the input subsystem in the kernel layer of the electronic device 100 and transmitted to the device node.
  • the input reader can read the finger touch event, and then the input distributor reports the finger touch event to the input management service.
  • the input management service may transmit the finger touch event to the window management service, and the window management service cooperates with the input management service to distribute the finger touch event to the browser application. This also means that the browser application has gained focus.
  • the browser application can know that the area that the user needs to input is the edit box 221, and determine that the edit box 221 is the position where the cursor is currently activated. In this case, the browser application can notify the input method management service that it has got the focus and request to bind the input method. The input method management service then notifies the input method application to call the input method, and displays the called input method on the interface where the browser application gets the focus.
  • the input management service can determine that the input device is a touch screen according to the finger touch event, and can also determine that the user's trigger method is finger touch.
  • the input management service may send the input device type corresponding to the finger touch event to the input method management service.
  • the input method management service then sends the input device type to the input method application.
  • the input method application may determine that the input method to be invoked is the pinyin input method (soft keyboard) according to the type of the input device.
  • the browser application may determine that the focused interface in the application program is the user interface 220 . After the browser application requests the input method management service to bind the input method, it can also request to display the input method through the input method management service.
  • the input method application may request the input method management service to register the monitoring input device.
  • the request of the input method application to the input method management service to register the monitoring input device may occur before or after the user clicks the edit box 221 included in the user interface 220 .
  • the electronic device 100 may display the user interface 230 shown in FIG. 2C in response to the user's finger touch operation on the edit box 221 .
  • the user interface 230 includes an edit box 231 and an input area 232 .
  • a cursor is displayed in the edit box 231, which indicates that the browser application has acquired the focus.
  • the input area 232 displays a pinyin full-key soft keyboard for the user to input.
  • the user may use a stylus to click on an edit box 221 included in the user interface 220 .
  • the electronic device 100 may detect a stylus touch operation acting on the edit box 221, thereby generating a stylus touch event.
  • the transfer process of the stylus touch event refer to the transfer process of the finger touch event described above.
  • the difference from the transfer process of finger touch events is that after the input management service receives the stylus touch event reported by the input distributor, it can determine the input device as a touch screen according to the stylus touch event, and can also determine that the user’s trigger method is handwriting pen touch.
  • the input management service may send the input device type corresponding to the stylus touch event to the input method management service.
  • the input method management service then sends the input device type to the input method application.
  • the input method application may determine that the input method to be invoked is the handwriting input method according to the type of the input device.
  • the electronic device 100 may display the user interface 240 shown in FIG. 2E .
  • the user interface 240 includes an edit box 241 and an input area 242 .
  • a cursor is displayed in the edit box 241, which indicates that the browser application has acquired the focus.
  • the input area 242 displays a handwriting area for the user to input.
  • the input device used by the user for input may change.
  • the user may tap a keyboard (for example, tap the "shift" key on the keyboard, etc.), thereby triggering a keyboard event.
  • a keyboard for example, tap the "shift" key on the keyboard, etc.
  • the input management service can determine the input device as a keyboard according to the keyboard event.
  • the input management service may send the input device type corresponding to the keyboard event to the input method management service.
  • the input method management service then sends the input device type to the input method application.
  • the input method application can determine that the input method to be invoked is the pinyin input method (floating mode) according to the type of the input device.
  • the electronic device 100 may display the user interface 250 shown in FIG. 2F .
  • the user interface 250 may include an edit box 231 and an input method floating toolbar 251 .
  • the edit box 231 can display the input content of the user.
  • the keyboard tapped by the user has established a communication connection (eg, Bluetooth connection, etc.) with the electronic device 100 .
  • a communication connection eg, Bluetooth connection, etc.
  • the electronic device 100 may switch the input method according to the type of the input device.
  • the user first uses a finger touch operation for input, and then uses a stylus for input.
  • the electronic device 100 may detect a stylus touch operation acting on the edit box 231, thereby generating a stylus touch event.
  • a stylus touch event refer to the transfer process of the finger touch event described above.
  • the difference from the transfer process of finger touch events is that after the input management service receives the stylus touch event reported by the input distributor, it can determine the input device as a touch screen according to the stylus touch event, and can also determine that the user’s trigger method is handwriting pen touch.
  • the input management service may send the input device type corresponding to the stylus touch event to the input method management service.
  • the input method management service then sends the input device type to the input method application.
  • the input method application may determine that the input method to be invoked is the handwriting input method according to the type of the input device, and switch from the originally invoked Pinyin input method to the handwriting input method.
  • the input operation performed by the user through the stylus can act on any position on the touch screen of the electronic device 100 (not necessarily on the edit box 231 ).
  • the electronic device 100 may display the user interface 260 shown in FIG. 2H.
  • the user interface 260 may include an edit box 231 , a handwriting input area 261 and an input tool area 262 .
  • the user can input on the handwriting input area 261 with a stylus, and correspondingly, the edit box 231 can display the input content of the user.
  • the user can also determine input content, search content, size of the input area, and manually switch input methods through the input tool area 262 .
  • the electronic device 100 may detect a user operation acting on the setting application icon 211, and in response to the user operation, the electronic device 100 may display the user interface 270 shown in FIG. 2I.
  • User interface 270 may include controls 271 .
  • the control 271 is used to open the input method setting interface.
  • the electronic device 100 may detect a user operation on the control 271, and in response to the user operation, the electronic device 100 may display the user interface 280 shown in FIG. 2J.
  • the user interface 280 is an input method setting interface.
  • the user interface 280 may include several input method setting items.
  • user interface 280 may include controls 281 , 282 , and 283 .
  • the control 281 is used to set a default input method application. If there are multiple input method applications in the electronic device 100 , the user can use the control 281 to set the input method application to be started by default when inputting.
  • Control 282 is used to set the safe input mode. In the secure input mode, when the user enters the password, the secure input keyboard needs to be activated.
  • the control 283 is used to open the smart call input method interface. It can be understood that calling an input method intelligently refers to calling a specific input method according to the type of the input device.
  • the electronic device 100 may detect a user operation on the control 283, and in response to the user operation, the electronic device 100 may display a user interface 290 as shown in FIG. 2K.
  • the user interface 290 is a smart call input method interface.
  • the smart call input method interface may include several smart call input method setting items.
  • user interface 290 may include controls 291 and display area 292 .
  • the control 291 is used to enable the smart call input method.
  • the display area 292 is an area for setting correspondence between input device types and input methods.
  • the display area 292 may include controls 2921 and a personalized setting area 2922 .
  • the control 2921 is used to set the corresponding relationship between the input device type and the input method as the default corresponding relationship.
  • the personalization setting area 2922 is used to personalize the corresponding relationship between input device types and input methods according to user requirements.
  • the personalized setting area 2922 may include a display area 29221 and controls 29222 .
  • Display area 29221 may include several controls. These controls can be used to manage the corresponding relationship between the input device type and the input method set by the user. As shown in FIG. 2K , the display area 29221 may include controls for managing the input methods corresponding to the three input devices: touch screen-finger, touch screen-stylus and keyboard.
  • the input method corresponding to the touch screen-finger is the pinyin input method (full spell soft keyboard)
  • the input method corresponding to the touch screen-stylus is the handwriting input method
  • the input method corresponding to the keyboard is the pinyin input method (floating mode).
  • Control 29222 is used to add a new corresponding relationship between input device type and input method.
  • FIG. 3 is a schematic diagram of a hardware structure of an electronic device 100 provided in an embodiment of the present application.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (Universal Serial Bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber Identification Module (Subscriber Identification Module, SIM) card interface 195 and so on.
  • SIM Subscriber Identification Module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • Processor 110 may include one or more processing units. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • processor 110 may include one or more interfaces.
  • the processor 110 may execute the input method calling method mentioned in this solution.
  • the charging management module 140 is configured to receive a charging input from a charger.
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the wireless communication function of the electronic device 100 can be realized by the antenna 1 , the antenna 2 , the mobile communication module 150 , the wireless communication module 160 , a modem processor, a baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the electronic device 100 .
  • a modem processor may include a modulator and a demodulator.
  • the wireless communication module 160 can provide wireless local area network (Wireless Local Area Networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) network), bluetooth (Bluetooth, BT), global navigation satellite System (Global Navigation Satellite System, GNSS), frequency modulation (Frequency Modulation, FM), near field communication technology (Near Field Communication, NFC), infrared technology (Infrared, IR) and other wireless communication solutions.
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos and the like.
  • the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
  • the electronic device 100 may realize the acquisition function through an ISP, a camera 193 , a video codec, a GPU, a display screen 194 , and an application processor.
  • the ISP is used for processing the data fed back by the camera 193 .
  • the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image or video visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be located in the camera 193 .
  • Camera 193 is used to capture still images or video.
  • the object generates an optical image through the lens and projects it to the photosensitive element.
  • the photosensitive element can be a charge coupled device (Charge Coupled Device, CCD) or a complementary metal oxide semiconductor (Complementary Metal-Oxide-Semiconductor, CMOS) phototransistor.
  • CCD Charge Coupled Device
  • CMOS complementary metal oxide semiconductor
  • the photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP for conversion into a digital image or video signal.
  • ISP outputs digital image or video signal to DSP for processing.
  • DSP converts digital images or video signals into standard RGB, YUV and other formats of images or video signals.
  • Digital signal processors are used to process digital signals. In addition to digital image or video signals, they can also process other digital signals.
  • Video codecs are used to compress or decompress digital video.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the electronic device 100.
  • an external memory card such as a Micro SD card
  • the internal memory 121 may be used to store computer-executable program codes including instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 .
  • the internal memory 121 may include an area for storing programs and an area for storing data.
  • the electronic device 100 can implement audio functions through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal.
  • Speaker 170A also referred to as a "horn" is used to convert audio electrical signals into sound signals.
  • Receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the microphone 170C also called “microphone” or “microphone”, is used to convert sound signals into electrical signals.
  • the electronic device 100 may be provided with at least one microphone 170C.
  • the earphone interface 170D is used for connecting wired earphones.
  • the sensor module 180 may include one or more sensors, which may be of the same type or of different types. It can be understood that the sensor module 180 shown in FIG. 1 is only an exemplary division manner, and there may be other division manners, which are not limited in the present application.
  • the pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal.
  • pressure sensor 180A may be disposed on display screen 194 .
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions.
  • the gyro sensor 180B can be used to determine the motion posture of the electronic device 100 .
  • the air pressure sensor 180C is used to measure air pressure.
  • the magnetic sensor 180D includes a Hall sensor.
  • the electronic device 100 may use the magnetic sensor 180D to detect the opening and closing of the flip leather case.
  • the acceleration sensor 180E can detect the acceleration of the electronic device 100 in various directions (generally three axes).
  • the magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to identify the posture of the electronic device 100, and can be applied to applications such as horizontal and vertical screen switching, pedometers, etc.
  • the distance sensor 180F is used to measure the distance.
  • the electronic device 100 may measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F for distance measurement to achieve fast focusing.
  • Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
  • LEDs light emitting diodes
  • photodiodes such as photodiodes
  • the ambient light sensor 180L is used for sensing ambient light brightness.
  • the fingerprint sensor 180H is used to acquire fingerprints.
  • the temperature sensor 180J is used to detect temperature.
  • Touch sensor 180K also known as "touch panel”.
  • the touch sensor 180K is used to detect a touch operation on or near it.
  • the touch sensor 180K may transmit the detected touch operation to the application processor to determine the touch event type.
  • the touch sensor 180K can also provide visual output related to the touch operation through the display screen 194 .
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the position of the display screen 194 .
  • the touch sensor 180K can be a touch screen. In some embodiments of the present application, the touch sensor 180K may be disposed on the display screen 194 .
  • the touch sensor 180K may be a projected capacitive touch screen.
  • touch screen of the electronic device 100 mentioned in this application is the touch sensor 180K.
  • the bone conduction sensor 180M can acquire vibration signals.
  • the keys 190 include a power key, a volume key and the like.
  • the key 190 may be a mechanical key. It can also be a touch button.
  • the electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100 .
  • the motor 191 can generate a vibrating reminder.
  • the motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
  • the indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
  • the SIM card interface 195 is used for connecting a SIM card.
  • FIG. 4 is a schematic diagram of a software structure of an electronic device 100 provided in an embodiment of the present application.
  • the software framework of the electronic device 100 may include an application layer, an application framework layer, a system library, an Android runtime, a hardware abstraction layer and a kernel layer.
  • the application layer can include a series of system applications and third-party applications. It can be understood that the system application mentioned here refers to the application provided with the Android platform, and the third party refers to the application selected by the user to install.
  • the electronic device 100 may include an input method application and a first application.
  • An input method application is an application that provides input method services.
  • the first application is an application that obtains focus when the user performs input.
  • the focus refers to the area that the electronic device 100 focuses on, and can be understood as the position where the cursor is currently activated. Generally speaking, whether certain areas on the interface displayed by the electronic device 100 function and respond depends on whether focus is acquired.
  • the interface displayed by the electronic device 100 includes a text box. Once the text box gets focus, the characters typed by the user on the keyboard can be input into the text box.
  • the first application may include an editing control.
  • the edit control can provide the user with editing input function, and can also display the input content to the user.
  • Editing controls may include, but are not limited to, text input areas (such as the text box mentioned above), handwriting areas, and the like.
  • the input method application and the first application may be system applications or third-party applications. That is to say, the input method application in this application may be an input method application provided by the Android platform, or may be an application downloaded and installed subsequently by the user.
  • the application framework layer provides application programming interfaces and programming frameworks for applications in the application layer.
  • the application framework layer includes some pre-defined functions.
  • the application framework layer may include but not limited to input management service, input method management service, window management service, Bluetooth service and so on.
  • the main function of the input management service is to monitor the input device, and timely transmit the input events generated by the input device (for example, click on the screen, button, slide, etc.) to the operating system or application program, and then the operating system or application program Treat accordingly.
  • the input management service can convert the user's touch into a touch event, and deliver it to the application program, and then the application program will process it accordingly.
  • the input management service involves not only the application framework layer, but also the Native layer.
  • the Native layer is at a lower level than the application framework layer.
  • the application framework layer generally includes some system services, while the Native layer generally includes some local services and some link libraries.
  • the efficiency may be very low, but if you choose to implement it through the Native layer, and then communicate with the application framework layer (that is, the JNI mechanism in Android), then Efficiency will be greatly improved.
  • the electronic device 100 when running, it needs to interact with the underlying hardware driver, and this process also passes through the Native layer.
  • the input management service involves the application framework layer, the JNI layer and the Native layer.
  • the main job of the input management service in the application framework layer is to provide implementation methods for Reader Policy and Dispatcher Policy, and to cooperate with other system services (for example, window management services, etc.).
  • the local input manager (NativeInputManager) is located in the JNI layer and is responsible for the mutual communication between the components of the Native layer and the input management service of the application framework layer. At the same time, it provides input readers (Input Reader) and input distributors (Input Dispatcher).
  • the interface of the policy request, the policy request is forwarded to the input management service of the application framework layer, and the input management service performs subsequent processing.
  • Input Manager is the running container of Input Reader and Input Dispatcher. It creates two threads to host the operation of Input Reader and Input Dispatcher respectively.
  • Input Manager can include Input Reader, Input Dispatcher and EventHub.
  • the main function of Input Reader is to read events.
  • the main function of Input Dispatcher is to distribute events.
  • the main function of EventHub is to use Linux's inotify and epoll mechanisms to monitor device events.
  • the device events mentioned here include device plugging and unplugging as well as various touch and button events, etc.
  • EventHub is mainly for device nodes in the /dev/input directory. For the input event on the device node, it can be monitored and obtained through getEvents of EventHub.
  • the input method management service runs in the system process and is a system-level service.
  • the main role of the input method management service is to manage input methods, bind input methods, manage clients, and interact with other system-level services.
  • the Bluetooth service is used to provide a wireless communication function between the electronic device 100 and related peripherals.
  • the relevant peripherals mentioned here may include wireless earphones, tablet computers, notebook computers, and the like.
  • the Bluetooth service can be used to establish a Bluetooth connection between the electronic device 100 and the input device.
  • the window management service is used to manage windows in the operating system.
  • the window management service can work with the corresponding client to realize functions such as creating, destroying, drawing, and laying out windows.
  • the client is responsible for interacting with the window management service, and providing window management interfaces for applications and other services, including providing interface functions such as adding, removing and updating window views.
  • the system library and the Android runtime include the functions that the FWK needs to call, the Android core library, and the Android virtual machine.
  • a system library can include multiple function modules. For example: browser kernel, three-dimensional (3dimensional, 3D) graphics, font library, etc.
  • the hardware abstraction layer is an abstract interface driven by the device kernel, which is used to provide an application programming interface for accessing the underlying device to a higher-level Java API framework.
  • HAL contains multiple library modules such as audio, bluetooth, camera, sensor, etc. Each of these library modules implements an interface for a specific type of hardware component.
  • the Android operating system will load the library module for the hardware component.
  • the kernel layer is the foundation of the Android operating system, and the final functions of the Android operating system are all completed through the kernel layer.
  • the kernel layer can include camera driver, audio driver, Bluetooth driver, sensor driver, display driver, touch screen driver and button driver, etc.
  • the interface language between the kernel layer and the hardware abstraction layer is a hardware abstraction layer interface description language (HAL interface definition language, HIDL).
  • the schematic diagram of the software framework of the electronic device 100 shown in FIG. 4 provided in the embodiment of the present application is only used as an example, and does not limit the specific module division in different layers of the Android operating system.
  • the electronic device 100 provided in the embodiment of the present application may also adopt other operating systems.
  • the method for invoking an input method provided in the embodiment of the present application can also be implemented based on other operating systems, and this application does not give examples one by one.
  • FIG. 5 is a schematic diagram of a process of invoking and switching an input method provided by an embodiment of the present application.
  • the user can use the input device to input, thereby generating an input event, and the original information related to the input event can be collected by the kernel layer and transmitted to the device node in the kernel layer.
  • the kernel layer may include device drivers. It can be understood that a device node corresponds to an input device. Device drivers also correspond to input devices.
  • the input event can be delivered to the input management service in the application framework layer through the kernel layer.
  • the input event can be read by the input reader, and then reported to the input management service through the input distributor, and then passed to the window management service.
  • the window management service as a window manager, may cooperate with the input management service to distribute the input event to the window including the edit control in the first application for processing.
  • the first application is an application that acquires focus. That is to say, the user's input operation is aimed at the edit control in the first application. It can be understood that the first application may request the input method management service to invoke the input method. The input method management service then notifies the input method application to invoke the input method according to the request of the first application to invoke the input method.
  • the input method application can request the input method management service to register the monitoring input device.
  • the input method management service may send the registration monitoring request to the input management service.
  • the input management service may determine the type of the input device according to the type of the received input event.
  • the input event received by the input management service is the first input event after receiving the registration monitoring request.
  • the input management service can send the input device type to the input method management service.
  • the input method management service then sends the monitoring receipt information to the input method application.
  • the monitoring receipt information may include the input device type.
  • the input method application receives the monitoring receipt information, it can determine the input method to be called according to the input device type included in the information, and call the input method.
  • the first application can display an interface including an input area. It can be understood that the input area may display the called input method.
  • the input device type determined by the input management service is different from the historical input device type.
  • the input management service can send the input device type to the input method management service.
  • the input method management service then sends the monitoring receipt information to the input method application.
  • the input method application can determine the input method to be called according to the input device type included in the information, and switch the previously called input method to the input method.
  • the first application can display an interface including an input area. It can be understood that the switched input method may be displayed in the input area.
  • the historical input device type is the type of the input device corresponding to the last input event generated by the electronic device 100 . It is worth noting that there is a corresponding relationship between the input device type and the input method, which will be described in detail later, and will not be explained here.
  • the input device type determined by the input management service is the same as the historical input device type.
  • the first application invokes the input method used when the user triggered the input event last time.
  • FIG. 6 is a flowchart of an input method invocation method provided by an embodiment of the present application.
  • the input method invocation method can be applied to applications including input method applications, input method management services, input distributors, and input management services.
  • Electronic device 100 For example, the electronic device 100 shown in FIG. 3 and FIG. 4 .
  • the input method calling method may include but not limited to the following steps:
  • the input method application sends a registration monitoring request to the input method management service.
  • the registration monitoring request is used to monitor the input device (the registration monitoring request is a request for monitoring the input device).
  • the input method application in the electronic device 100 may send a registration monitoring request to the input method management service.
  • the registration monitoring request is used to monitor the input device. That is, the electronic device 100 can determine the input device type through the registration monitoring request.
  • the input method application may send a registration monitoring request to the input method management service through a custom interface.
  • the custom interface is an interface for implementing monitoring of an input device.
  • the custom interface may be: InputMethodManager#registerInputDeviceChange.
  • step S601 the electronic device 100 may perform initialization processing on the input method application.
  • the electronic device 100 in response to a user operation, the electronic device 100 initially requests to invoke the input method, and in this case, the electronic device 100 may initialize the input method application.
  • the user operations mentioned here are operations performed on the input area of the electronic device 100 . For example, click on the edit box.
  • the initial request of the electronic device 100 to call the input method refers to the first request to bind the input method after the electronic device 100 is turned on.
  • the electronic device 100 may perform initialization processing on the input method application.
  • the initial startup of the input method application refers to the first startup of the input method application after the electronic device 100 is turned on. It should be noted that the input method application can be started in the background, in this case, the corresponding page will not be displayed on the electronic device 100 . Exemplarily, after the electronic device 100 is successfully powered on, the input method application can be started in the background, and the electronic device 100 can initialize the input method application.
  • the input method management service can receive the registration monitoring request accordingly.
  • the electronic device 100 may include multiple input method applications. If the user manually switches the default input method application, the switched input method application needs to send a registration monitoring request to the input method management service. That is to say, the registration monitoring request sent by the input method application before switching is not applicable to the input method application after switching.
  • the input method management service sends a first message to the input management service.
  • the first message is used to prompt the input management service to determine the input device type corresponding to the input event, and return the input device type to the input method management service.
  • the input method management service may send a first message to the input method management service.
  • the first message is used to prompt the input management service to determine the input device type corresponding to the input event, and return the input device type to the input method management service.
  • the input method management service may receive the first message accordingly.
  • the input method management service sends a registration monitoring receipt to the input method application.
  • the input method management service may send a registration monitoring receipt to the input method application.
  • the registration monitoring receipt can be used to indicate that the input method management service has successfully received the registration monitoring request sent by the input method application.
  • the input method application can correspondingly receive the registration monitoring receipt.
  • an input event is an event generated by the electronic device 100 in response to a user operation on the input device.
  • the user may use the input device to perform input on the electronic device 100, thereby generating various types of input events. For example, key events, touch events, mouse events, etc.
  • the original information generated by these input events can be collected by the input subsystem in the kernel layer, uploaded to the input manager, and then sent to the input management service by the input distributor in the input manager.
  • the communication connection between them may be a wired communication connection, and may also be a wireless communication connection (for example, a Bluetooth connection, etc.), which is not limited in this application.
  • the input management service can receive the input event accordingly.
  • the input events may include but not limited to keyboard events, stylus touch events, and finger touch events.
  • the keyboard event is an input event triggered by the user pressing a key on the keyboard.
  • the stylus touch event is an input event triggered by the user touching the touch screen of the electronic device 100 with a stylus.
  • the finger touch event is an input event triggered by the user touching the touch screen of the electronic device 100 with a finger. It can be understood that, similar to the finger touch event, touching the touch screen of the electronic device 100 with other parts of the human body can also trigger the generation of an input event.
  • the input operation performed by the user may include but not limited to tapping a key on a keyboard, touching a touch screen of the electronic device 100 with a stylus or a finger, and the like.
  • the input operation performed by the user is a focus acquisition operation.
  • the focus acquisition operation mentioned here may be a trigger operation performed on the input area displayed on the electronic device 100 .
  • the input area may include an edit box, a handwriting area, and the like.
  • the focus acquisition operation may be a click operation on an edit box displayed on the electronic device 100 .
  • the input operation performed by the user is an input operation after the focus is acquired. For example, typing on the keyboard. For another example, use a stylus to write in the input area, thereby realizing input.
  • the input management service determines the type of the input device that triggers the input event.
  • the input management service may determine the source of the input event, that is, determine the type of the input device that triggered the input event.
  • the input management service may determine the type of the input device that triggers the input event in various ways.
  • the input management service may determine the input device corresponding to the input event according to the type of the input event. Specifically, the input management service can obtain the correspondence between the input event type and the input device type, and after receiving the input event sent by the input distributor, can search for the input device type corresponding to the input event according to the type of the input event. It can be understood that the corresponding relationship between input event types and input device types can be stored in the input management service, and can also be stored in other areas. The input management service can invoke the corresponding relationship.
  • Table 1 represents an exemplary correspondence between input event types and input device types provided in the embodiment of the present application.
  • the corresponding input device type is touch screen-finger.
  • the corresponding input device is a touch screen-stylus.
  • the corresponding input device is a keyboard. It can be understood that Table 1 is only an example provided by the embodiment of the present application, and should not be regarded as a limitation of the present application.
  • input events generated by the electronic device 100 may be different due to different triggering methods by the user.
  • the input device types corresponding to these input events can be distinguished according to the user's triggering manner.
  • the finger touch event and the stylus touch event these two types of input events are essentially touch events, that is, input events triggered through the touch screen. That is to say, the input device type corresponding to these two types of input events is a touch screen.
  • the final generated input events are different. Specifically, the user touches the touch screen with a finger, and the electronic device 100 may generate a finger touch event.
  • the electronic device 100 may generate a stylus touch event.
  • the corresponding input device types can be distinguished according to the user's trigger mode. As shown in Table 1, the input device type corresponding to the finger touch event may be touch screen-finger, and the input device type corresponding to the stylus touch event may be touch screen-stylus.
  • the embodiment of the present application can divide the input event type and the input device type in more detail to prepare for subsequent input method calling or switching, fully considering the user's input requirements.
  • the Linux kernel of the electronic device 100 will create a corresponding device node in the user space (User space).
  • the original information related to the input event can be collected by the input subsystem in the kernel layer.
  • the original information can be transmitted from the driver layer of the kernel space (Kernel space) in the kernel layer to the device node in the user space.
  • the driver layer in the kernel space may include device drivers. For example, touch screen driver, keyboard driver and mouse driver etc. It can be understood that there is a corresponding relationship between the device driver and the input device.
  • the kernel space is the running space of the Linux kernel, which can execute arbitrary commands and invoke all resources of the system.
  • the user space is the running space of the user program. It can only perform simple calculations and cannot directly call system resources. It must send instructions to the kernel through the system interface.
  • the input management service can monitor all device nodes in the user space, process the data when the device node has data, find a suitable window, and dispatch input events to it. It can be understood that the input management service may determine the device node corresponding to the received input event. According to the above, there is a corresponding relationship between the device node and the input device. The input management service can determine the input device type according to the device node corresponding to the input event.
  • the input management service may search the transmission route of the input event, and determine the input device driver corresponding to the input event, thereby determining the input device type.
  • the input event carries input device information
  • the input device information may be used to represent the input device.
  • the input management service can determine input devices triggering different types of input events in different ways, the above-mentioned ways are only examples given in this application, and there are more ways, which will not be listed here.
  • the input management service sends the input device type to the input method management service.
  • the historical input device type is the type of the input device corresponding to the last input event generated by the electronic device 100 .
  • the input management service can send the input device type to the input method management Serve.
  • the historical input device type is the type of the input device corresponding to the last input event generated by the electronic device 100 .
  • the input device type mentioned in this application is different from the historical input device type because the input device used by the user when inputting this time is different from the input device used when inputting last time.
  • the case where there is no historical input type mentioned in this application is that the input management service receives the input event triggered by the user's input using the input device for the first time.
  • the input management service of the electronic device 100 may convert the input device type into a form that meets the interface specification, and then send the input device type that meets the interface specification.
  • Provide input method management services It can be understood that there is a corresponding relationship between different forms of input device types. The corresponding relationship can be stored in the input management service, and can also be stored in other areas. The input management service may invoke this correspondence.
  • the input management service may send the code value corresponding to the input device type to the input method management service.
  • Table 2 provides the types of input devices that meet the interface specifications and their meanings and code values provided by the embodiment of the present application.
  • Table 2 correspond to the types of input devices that trigger input events determined by the input management service.
  • the input management service determines the type of input device that triggers the input event, it looks up the meaning of the same content in Table 2, so as to determine the type of input device that meets the interface specification and its corresponding code value.
  • the input management service can search for the input device type corresponding to the stylus——STYLUS.
  • STYLUS the representation of STYLUS means that the input device type is a stylus, and the STYLUS satisfies the form of the interface specification.
  • the input management service can determine that the code value corresponding to STYLUS is 0x00005002.
  • the input method management service can receive the input device type accordingly. It can be understood that the input device type can meet the interface specification. In some embodiments of the present application, the input device type may be a code value corresponding to the input device type.
  • the input method management service sends monitoring callback information to the input method application.
  • the listener callback information includes the input device type.
  • the input management service sends the input device type to the input method management service. After the input method management service receives the input device type, it can send the input method application Listen for callback information. It can be understood that the monitoring callback information may include the type of the input device.
  • the input method management service may send monitoring callback information to the input method application through a custom interface.
  • the custom interface is an interface for realizing the monitoring callback.
  • the custom interface may be: InputMethodManager#InputDeviceListerner.deviceChange.
  • the parameter corresponding to the custom interface is an input device type meeting the interface specification.
  • the parameter corresponding to the custom interface is inputType.
  • inputType corresponds to the input device types shown in Table 2.
  • the input method application determines the input method and calls the input method for input according to the monitoring callback information and the input method calling rule.
  • the input method application determines the input method for input according to the input device type and input method invocation rules included in the monitoring callback information, and invokes the input method for input. It can be understood that the input method calling rule refers to the corresponding relationship between the input device type and the input method. The input method application can determine the finally invoked input method according to the corresponding relationship and the type of the input device.
  • the input device type is different from the historical input device type, and the input method application can switch the invoked input method according to the listening information and the input method invocation rules.
  • Table 3 is an exemplary input method calling rule provided by the embodiment of the present application.
  • the input method application determines to call the handwriting input method for input. Similarly, if the input device type included in the monitoring callback information received by the input method application is FINGER, the input method application determines to call the Pinyin input method (soft keyboard) for input. If the input device type included in the monitoring callback information received by the input method application is KEYBOARD, the input method application determines to call the Pinyin input method (floating mode) for input.
  • the input method corresponding to the input device type can be preset by a technician, or can be set by a user, which is not limited in this application. It can be understood that the correspondence between input device types and input methods shown in Table 3 is only an example provided by the present application, and the correspondence may also exist in other forms, which is not limited by the present application. For example, when the input device type is FINGER, the corresponding input method may be Wubi input method or stroke input method.
  • the electronic device 100 may display a corresponding input interface. It should be noted that when the input method invoked by the input method application is the same, the input interface displayed by the electronic device 100 may be different.
  • the input method application may determine to call the Pinyin input method (soft keyboard) for input, and the input area in the input interface displayed by the electronic device 100 may include the soft keyboard. keyboard.
  • the form of the soft keyboard may be a pinyin full-key soft keyboard (26 keys), or a pinyin nine-key soft keyboard (9 keys).
  • the specific form of the soft keyboard can be preset by a technician as a default form, or can be set by a user, which is not limited in this application.
  • the input method application may determine to call the Pinyin input method (floating mode) for input, and the input area in the input interface displayed by the electronic device 100 may include Pinyin input Method floating toolbar. It can be understood that the pinyin input method floating toolbar can be used to switch to other input methods.
  • the input interface displayed when the electronic device 100 invokes the input method corresponding to the input device type can have various forms, and the content of the input area in the input interface can be preset by a technician, or can be set by the user. set up.
  • the content of the input area in the input interface displayed by the electronic device 100 may be a pinyin full-key soft keyboard, or a pinyin nine-key soft keyboard.
  • the input device type is KEYBOARD
  • the content of the input area in the input interface displayed by the electronic device 100 may be a pinyin full-key soft keyboard, or a floating toolbar of a pinyin input method.
  • the input method when the user uses the input device to perform input in the electronic device 100, the input method will not send a registration monitoring request to the input method management service. This is because the input method has already sent a registration monitoring request to the input method management service when the user made an input before, so when the user inputs again later, the input method application does not need to send a registration monitoring request to the input method management service. In this case, the electronic device 100 may not perform step S601-step S603.
  • the electronic device 100 can adaptively call the input method or switch the input method according to the type of the input device, so that the user does not need to switch manually, which improves the user experience.
  • Fig. 7 is a flow chart of another input method calling method provided by the embodiment of the present application, the input method calling method may include but not limited to the following steps:
  • the electronic device 100 At a first moment, in response to a first operation, the electronic device 100 generates a first input event.
  • the first input event is an input event generated for the first input device.
  • the user may perform a first operation, and correspondingly, at a first moment, in response to the first operation, the electronic device 100 may generate a first input event.
  • the first input event is an input event generated for the first input device.
  • the first input device may include but not limited to a keyboard, a stylus, and other devices.
  • the first input device may also be a touch screen.
  • the first input event may include but not limited to a keyboard event, a stylus touch event, a finger touch event, and the like.
  • the keyboard event is an input event triggered by the user pressing a key on the keyboard.
  • the stylus touch event is an input event triggered by the user touching the touch screen of the electronic device 100 with a stylus.
  • the finger touch event is an input event triggered by the user touching the touch screen of the electronic device 100 with a finger. It can be understood that, similar to a finger touch event, an input event triggered by touching the touch screen of the electronic device 100 with other parts of the human body may also belong to the first input event.
  • the first operation performed by the user is an input operation performed by using a first input device.
  • the input operation mentioned here may include but not limited to tapping a key on a keyboard, touching a touch screen of the electronic device 100 with a stylus or a finger, and the like.
  • the first operation performed by the user is a focus acquisition operation.
  • the focus acquisition operation mentioned here may be a trigger operation performed on the input area displayed on the electronic device 100 .
  • the input area may include an edit box, a handwriting area, and the like.
  • the focus acquisition operation may be a click operation on an edit box displayed on the electronic device 100 .
  • step S701 the electronic device 100 may register a monitoring input device, and for details, refer to step S601 , which will not be described in detail here.
  • the input method application in the electronic device 100 may be initialized. For details, please refer to step S601, which will not be described in detail here.
  • S702 The electronic device 100 invokes a first input method based on a first input event, and displays a first interface.
  • the electronic device 100 may determine the source of the first input event, that is, determine the first input device corresponding to the first input event, and call the first input device according to the device type of the first input device. an input method, and then display the first interface.
  • the first interface may include a first input method display area. The first input method display area can be used to display the first input method.
  • the first input method is an input method specifically invoked by the electronic device 100 .
  • Quanpin input method Wubi input method, stroke input method, handwriting input method, etc.
  • the electronic device 100 may store a correspondence between input device types and input methods.
  • the corresponding relationship between the input device type and the input method may be preset by a technician. In this case, the electronic device 100 stores the corresponding relationship when it leaves the factory. In some other embodiments of the present application, the corresponding relationship between the input device type and the input method can be set by the user.
  • S703 At a second moment, in response to a second operation, the electronic device 100 generates a second input event.
  • the second input event is an input event generated for the second input device.
  • the user may perform a second operation, and correspondingly, at a second moment, the electronic device 100 may generate a second input event in response to the second operation.
  • the second input event is an input event generated for the second input device.
  • the second input device may include but not limited to a keyboard, a stylus, and other devices.
  • the second input device may also be a touch screen.
  • the second input event may include but not limited to a keyboard event, a stylus touch event, a finger touch event, and the like.
  • the description about the keyboard event, the stylus touch event and the finger touch event can refer to step S701 , which will not be repeated here.
  • the second operation performed by the user is an input operation performed by using a second input device.
  • the input operation mentioned here may include but not limited to tapping a key on a keyboard, touching a touch screen of the electronic device 100 with a stylus or a finger, and the like.
  • the second operation performed by the user is a focus acquisition operation, and may also be an input operation after the focus is acquired.
  • the focus acquisition operation may also be an input operation after the focus is acquired.
  • first input device and the second input device are different input devices.
  • first input device is a stylus
  • second input device is a keyboard.
  • S704 The electronic device 100 invokes the second input method based on the second input event, and displays the second interface.
  • the electronic device 100 may determine the source of the second input event, that is, determine the second input device corresponding to the second input event, and call the first input device according to the device type of the second input device. Second input method, and then display the second interface. It can be understood that the second interface may include a second input method display area. The second input method display area can be used to display the second input method.
  • the second input method is an input method specifically invoked by the electronic device 100 .
  • Quanpin input method Wubi input method, stroke input method, handwriting input method, etc.
  • the first input method and the second input method are different input methods.
  • the first input method is Quanpin input method
  • the second input method is handwriting input method.
  • the first input method and the second input method may be the same input method.
  • the first input method is the Quanpin input method
  • the first input method display area on the first interface displays the QuanPin soft keyboard
  • the second input method is Quanpin input method
  • the second input method display area on the second interface displays an input method floating tool.
  • first interface and the second interface are different interfaces.
  • the first interface displays the first input method
  • the second interface displays the second input method.
  • the first input method is different from the second input method.

Abstract

An input method calling method and a device. In the input method calling method, an electronic device (100) triggers the monitoring of an input device when an input method application is started, and after the input method application receives monitoring callback information, an input method which needs to be called is determined according to the type of an input device that is included in the monitoring callback information. In the input method calling method, the electronic device (100) adaptively provides a more rational input method according to an input mode and the type of an input device, without the need for a user to manually switch the input method, thereby improving the user experience.

Description

一种输入法调用方法及相关设备An input method calling method and related equipment
本申请要求于2021年12月27日提交中国专利局、申请号为202111610264.5、申请名称为“一种输入法调用方法及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202111610264.5 and the application name "A Method for Calling Input Method and Related Equipment" submitted to the China Patent Office on December 27, 2021, the entire contents of which are incorporated herein by reference Applying.
技术领域technical field
本申请涉及终端技术领域,尤其涉及一种输入法调用方法及相关设备。The present application relates to the technical field of terminals, and in particular to an input method calling method and related equipment.
背景技术Background technique
目前,手机、平板电脑等终端设备的发展越来越迅速。随着终端设备的不断发展,用户需求也在不断变化,从最终的基本通信需求逐渐发展为视觉、听觉和触觉等多维度的通信与娱乐需求,因此,越来越多的终端设备制造厂商愈加重视人机交互。为了提升终端设备的易用性和用户友好性,一些厂商开始研发一些配合终端设备使用的设备。例如,手写笔、键盘等。用户可以利用这些输入设备更好地实现自身的输入需求。可理解,由于用户通过这些输入设备进行输入的方式有所差异(例如,触摸输入和键盘输入),往往不同输入设备适用的输入模式可能有所区别。比如,手写笔输入可能适用于手写输入法,键盘输入可能适用于键盘输入法。At present, terminal devices such as mobile phones and tablet computers are developing more and more rapidly. With the continuous development of terminal equipment, user needs are also constantly changing, gradually developing from the final basic communication needs to multi-dimensional communication and entertainment needs such as vision, hearing and touch. Therefore, more and more terminal equipment manufacturers are increasingly Pay attention to human-computer interaction. In order to improve the ease of use and user-friendliness of terminal equipment, some manufacturers have begun to develop some equipment used in conjunction with the terminal equipment. For example, stylus, keyboard, etc. Users can use these input devices to better realize their own input needs. It can be understood that, due to the differences in input methods of users through these input devices (for example, touch input and keyboard input), the applicable input modes of different input devices may be different. For example, stylus input may be applicable to handwriting input method, and keyboard input may be applicable to keyboard input method.
然而,无论用户使用哪种输入设备进行输入,首先显示的输入界面往往是用户设置的默认输入界面。若输入设备发生变化,用户需要手动切换输入法,影响用户体验。However, no matter which input device the user uses for input, the input interface displayed first is often the default input interface set by the user. If the input device changes, the user needs to manually switch the input method, which affects the user experience.
因此,如何根据输入设备适应性调用输入法是目前亟待解决的问题。Therefore, how to call the input method according to the adaptability of the input device is an urgent problem to be solved at present.
发明内容Contents of the invention
本申请提供了一种输入法调用方法及相关设备,可以根据生成的输入事件来确定输入设备类型,并在输入法调用规则中找到该输入设备类型对应的输入法,然后调用该输入法。通过这种方式,可以根据用户使用的输入设备适应性调用输入法,无需用户手动切换输入法,减少了用户的冗余操作,提升了用户体验。The present application provides an input method calling method and related equipment, which can determine the input device type according to the generated input event, find the input method corresponding to the input device type in the input method calling rules, and then call the input method. In this way, the input method can be adaptively invoked according to the input device used by the user, without the need for the user to manually switch the input method, which reduces the redundant operation of the user and improves the user experience.
第一方面,本申请提供一种输入法调用方法。该方法可以应用于电子设备。该方法可以包括:接收第一操作,响应于所述第一操作,显示第一界面;所述第一操作为通过第一输入方式进行的输入操作;所述第一界面显示有第一输入法;所述第一输入法为与所述第一输入方式对应的输入法;接收第二操作,响应于所述第二操作,显示第二界面;所述第二操作为通过第二输入方式进行的输入操作;所述第二界面显示有第二输入法;所述第二输入法为与所述第二输入方式对应的输入法;其中,所述第一输入法不同于所述第二输入法。In a first aspect, the present application provides a method for invoking an input method. The method can be applied to electronic devices. The method may include: receiving a first operation, and displaying a first interface in response to the first operation; the first operation is an input operation performed through a first input method; the first interface displays a first input method ; The first input method is an input method corresponding to the first input method; receiving a second operation, and displaying a second interface in response to the second operation; the second operation is performed through the second input method input operation; the second interface displays a second input method; the second input method is an input method corresponding to the second input method; wherein, the first input method is different from the second input method Law.
在本申请提供的方案中,第一时刻,电子设备可以接收用户通过第一输入方式进行的输入操作,响应于该输入操作,电子设备可以显示包括第一输入法的第一界面。第二时刻,电子设备可以接收用户通过第二输入方式进行的输入操作,响应于该输入操作,电子设备可以显示包括第二输入法的第二界面。其中,第一输入法与第一输入方式对应,第二输入 法与第二输入方式对应。也就是说,电子设备可以根据用户的输入方式来确定需要调用的输入法,并在用户界面上显示该输入法。通过这种输入法调用方式来调用输入法,电子设备调用并显示的输入法可以根据用户的输入方式来确定,并非每一次调用的输入法都是默认输入法或者历史输入法。在这种情况下,用户无需手动切换至与当前输入方式更匹配的输入法,充分考虑了用户的使用感受,提升了用户体验。In the solution provided by the present application, at the first moment, the electronic device may receive an input operation performed by the user through a first input method, and in response to the input operation, the electronic device may display a first interface including the first input method. At a second moment, the electronic device may receive an input operation performed by the user through the second input method, and in response to the input operation, the electronic device may display a second interface including the second input method. Wherein, the first input method corresponds to the first input method, and the second input method corresponds to the second input method. That is to say, the electronic device can determine the input method to be invoked according to the user's input method, and display the input method on the user interface. Invoking the input method through this input method calling method, the input method called and displayed by the electronic device can be determined according to the user's input method, and not every input method called is the default input method or the historical input method. In this case, the user does not need to manually switch to an input method that is more suitable for the current input method, which fully considers the user's experience and improves the user experience.
在本申请的一些实施例中,第一输入方式可以为手指触控方式、手写笔触控方式,还可以为键盘输入方式。相应的第一操作可以为手指触控操作、手写笔触控操作,以及敲击键盘操作。第二输入方式也可以为手指触控方式、手写笔触控方式,还可以为键盘输入方式。相应的第二操作可以为手指触控操作、手写笔触控操作,以及敲击键盘操作。In some embodiments of the present application, the first input mode may be a finger touch mode, a stylus touch mode, or a keyboard input mode. The corresponding first operation may be a finger touch operation, a stylus touch operation, and a keyboard tapping operation. The second input method may also be a finger touch method, a stylus touch method, or a keyboard input method. The corresponding second operation may be a finger touch operation, a stylus touch operation, and a keyboard tapping operation.
示例性的,第一输入方式可以为手指触控方式,第二输入方式可以为手写笔触控方式。用户首先通过手指触控操作在电子设备上进行输入,电子设备调用拼音输入法并在用户界面上显示软键盘以供用户进行输入。然后,用户转而采用手写笔进行输入,电子设备检测到用户当前采用的输入设备为触摸屏-手写笔,电子设备调用手写输入法并在用户界面上显示手写区域以供用户进行输入。Exemplarily, the first input method may be a finger touch method, and the second input method may be a stylus touch method. The user first performs input on the electronic device through a finger touch operation, and the electronic device invokes a pinyin input method and displays a soft keyboard on the user interface for the user to input. Then, the user turns to use a stylus for input, and the electronic device detects that the current input device used by the user is a touch screen-stylus, and the electronic device invokes the handwriting input method and displays a handwriting area on the user interface for the user to input.
结合第一方面,在第一方面的一种可能的实现方式中,所述第一输入方式为利用第一输入设备进行输入的方式;所述第二输入方式为利用第二输入设备进行输入的方式;所述第一输入法为与所述第一输入方式对应的输入法,具体包括:所述第一输入法为与第一设备类型对应的输入法;所述第一设备类型为所述第一输入设备对应的设备类型;所述第二输入法为与所述第二输入方式对应的输入法,具体包括:所述第二输入法为与第二设备类型对应的输入法;所述第二设备类型为所述第二输入设备对应的设备类型。With reference to the first aspect, in a possible implementation manner of the first aspect, the first input method is an input method using a first input device; the second input method is an input method using a second input device method; the first input method is an input method corresponding to the first input method, specifically including: the first input method is an input method corresponding to the first device type; the first device type is the input method The device type corresponding to the first input device; the second input method is an input method corresponding to the second input method, specifically including: the second input method is an input method corresponding to the second device type; The second device type is a device type corresponding to the second input device.
在本申请提供的方案中,第一输入方式可以为利用第一输入设备进行输入的方式,第二输入方式可以为利用第二输入设备进行输入的方式。电子设备中包括输入设备的设备类型与输入法的对应关系。在接收到用户的输入操作之后,电子设备可以根据该输入操作所利用的输入设备来找到相应的输入法,并调用及显示该输入法。也就是说,电子设备可以根据输入设备的设备类型来确定需要调用的输入法。也就意味着,用户无需手动切换至与当前输入设备更匹配的输入法,充分考虑了用户的使用感受,提升了用户体验。In the solution provided by the present application, the first input method may be an input method using a first input device, and the second input method may be an input method using a second input device. The electronic device includes the corresponding relationship between the device type of the input device and the input method. After receiving the user's input operation, the electronic device can find the corresponding input method according to the input device used by the input operation, and invoke and display the input method. That is to say, the electronic device can determine the input method to be invoked according to the device type of the input device. In other words, the user does not need to manually switch to an input method that is more suitable for the current input device, which fully considers the user's experience and improves the user experience.
在本申请的一些实施例中,电子设备可以基于输入方式来确定输入设备,进而确定需要调用的输入法。示例性的,第一输入方式为键盘输入方式的情况下,第一输入设备为键盘,电子设备可以基于第一输入设备来确定第一设备类型为键盘。示例性的,第一输入方式为手指触控方式的情况下,第一输入设备为手指,电子设备可以确定第一设备类型为手指。第一输入方式为手写笔触控方式的情况下,第一输入设备为手写笔,电子设备可以确定第一设备类型为手写笔。In some embodiments of the present application, the electronic device may determine the input device based on the input method, and then determine the input method that needs to be invoked. Exemplarily, when the first input mode is a keyboard input mode, the first input device is a keyboard, and the electronic device may determine that the first device type is a keyboard based on the first input device. Exemplarily, when the first input mode is a finger touch mode, the first input device is a finger, and the electronic device may determine that the first device type is a finger. When the first input mode is a stylus touch mode, the first input device is a stylus, and the electronic device may determine that the first device type is a stylus.
在本申请的一些实施例中,电子设备还可以根据输入方式和输入设备来确定需要调用的输入法。比如,用户采取手指触控方式和手写笔触控方式进行输入时,输入设备为触摸屏,但是由于对触摸屏的操作不同(输入方式有区别),生成的输入事件也不同。在这种情况下,电子设备可以结合输入方式和输入设备来确定输入设备的设备类型,从而确定需要调用的输入法。示例性的,第一输入方式为手指触控方式的情况下,第一输入设备为触控屏,电子设备可以基于第一输入方式和第一输入设备来确定第一设备类型为触摸屏-手指。 第一输入方式为手写笔触控方式的情况下,第一输入设备为触控屏,电子设备可以基于第一输入方式和第一输入设备来确定第一设备类型为触摸屏-手写笔。In some embodiments of the present application, the electronic device may also determine the input method to be invoked according to the input method and the input device. For example, when the user uses a finger touch method and a stylus touch method for input, the input device is a touch screen, but due to different operations on the touch screen (different input methods), different input events are generated. In this case, the electronic device can combine the input method and the input device to determine the device type of the input device, so as to determine the input method that needs to be invoked. Exemplarily, when the first input mode is a finger touch mode, the first input device is a touch screen, and the electronic device may determine that the first device type is a touch screen-finger based on the first input mode and the first input device. When the first input mode is a stylus touch mode, the first input device is a touch screen, and the electronic device may determine that the first device type is a touch screen-stylus based on the first input mode and the first input device.
结合第一方面,在第一方面的一种可能的实现方式中,所述响应于第一操作,显示第一界面之前,所述方法还包括:通过所述电子设备中的输入法应用基于第一接口向所述电子设备中的输入法管理服务发送注册监听请求;所述注册监听请求用于请求所述输入法管理服务对输入设备进行监听;通过所述输入法管理服务向所述电子设备中的输入管理服务发送第一消息;所述第一消息用于请求所述输入管理服务对输入设备进行监听。With reference to the first aspect, in a possible implementation manner of the first aspect, before displaying the first interface in response to the first operation, the method further includes: using an input method application in the electronic device based on the first An interface sends a registration monitoring request to the input method management service in the electronic device; the registration monitoring request is used to request the input method management service to monitor the input device; send the electronic device through the input method management service The input management service in sends a first message; the first message is used to request the input management service to monitor the input device.
在本申请提供的方案中,电子设备需要对输入设备进行监听,才能实现根据输入设备调用输入法。具体地,电子设备中的输入法应用可以基于第一接口向电子设备中的输入法管理服务发送注册监听请求,输入法管理服务再向输入管理服务发送第一消息,以请求监听输入设备。可理解,实质上,电子设备中实现监听的是输入管理服务。输入管理服务通过监听输入事件来实现监听输入设备。也就是说,输入管理服务可以通过输入分发器上报的输入事件来确定输入设备。一旦输入事件对应的输入设备发生变化,输入管理服务可以将变化后的输入设备类型传递给输入法管理服务,进而回调至输入法应用,再由输入法来确定需要切换的输入法。上述过程中提及的监听输入设备是实现根据输入设备类型调用输入法的前提,是实现适应性调用输入法不可或缺的一步。In the solution provided by the present application, the electronic device needs to monitor the input device, so as to call the input method according to the input device. Specifically, the input method application in the electronic device may send a registration monitoring request to the input method management service in the electronic device based on the first interface, and the input method management service then sends a first message to the input management service to request monitoring of the input device. It can be understood that, in essence, it is the input management service that implements monitoring in the electronic device. The input management service monitors input devices by monitoring input events. That is to say, the input management service can determine the input device through the input event reported by the input distributor. Once the input device corresponding to the input event changes, the input management service can pass the changed input device type to the input method management service, and then call back to the input method application, and then the input method determines the input method that needs to be switched. The monitoring input device mentioned in the above process is the premise of calling the input method according to the type of the input device, and is an indispensable step to realize the adaptive calling of the input method.
可理解,实际上,输入法应用并不是每一次调用输入法都需要先向输入法管理服务发送注册监听请求。在本申请的一些实施例中,在输入法的生命周期并未结束的情况下,输入法应用可以调用或切换输入法,无需发送注册监听请求。It can be understood that, in fact, the input method application does not need to send a registration monitoring request to the input method management service every time the input method is invoked. In some embodiments of the present application, when the life cycle of the input method is not over, the input method application can call or switch the input method without sending a registration monitoring request.
在本申请的一些实施例中,用户可以手动切换使用的输入法应用。在这种情况下,尽管用户之前使用的输入法应用已经请求监听输入设备,但是切换后的输入法应用需要再向输入法管理服务发送监听请求。In some embodiments of the present application, the user can manually switch the input method application used. In this case, although the input method application used by the user has requested to monitor the input device, the switched input method application needs to send a monitoring request to the input method management service again.
需要说明的是,第一接口为自定义接口,用于发送注册监听请求。第一接口的相关描述可参考后文,在此不展开说明。It should be noted that the first interface is a custom interface and is used to send a registration monitoring request. For the relevant description of the first interface, reference may be made later, and no further description is given here.
结合第一方面,在第一方面的一种可能的实现方式中,所述响应于第一操作,显示第一界面,具体包括:响应于所述第一操作,生成第一输入事件;所述第一输入事件为针对所述第一输入设备所产生的输入事件;基于所述第一输入事件调用所述第一输入法,并显示所述第一界面;所述响应于第二操作,显示第二界面,具体包括:响应于所述第二操作,生成第二输入事件;所述第二输入事件为针对所述第二输入设备所产生的输入事件;基于所述第二输入事件调用所述第二输入法,并显示所述第二界面。With reference to the first aspect, in a possible implementation manner of the first aspect, the displaying the first interface in response to the first operation specifically includes: generating a first input event in response to the first operation; The first input event is an input event generated for the first input device; based on the first input event, the first input method is invoked, and the first interface is displayed; in response to the second operation, displaying The second interface specifically includes: generating a second input event in response to the second operation; the second input event is an input event generated for the second input device; calling the second input event based on the second input event The second input method is selected, and the second interface is displayed.
在本申请提供的方案中,响应于用户的输入操作,电子设备可以生成输入事件。电子设备可以根据输入事件确定输入设备类型,从而确定需要调用的输入法。具体地,电子设备中的输入事件分发器可以将生成的输入事件上报给输入管理服务,输入管理服务可以根据输入事件确定输入设备类型,并将输入设备类型传递给输入法管理服务,最终传递至输入法应用,从而调用相应的输入法。通过这种方式,用户无需手动切换至与当前输入设备更匹配的输入法,充分考虑了用户的使用感受,提升了用户体验。另外,用户无需使用输入法应用以外的其他应用来确定需要调用的输入法。In the solution provided by the present application, in response to a user's input operation, the electronic device can generate an input event. The electronic device can determine the type of the input device according to the input event, so as to determine the input method that needs to be invoked. Specifically, the input event dispatcher in the electronic device can report the generated input event to the input management service, and the input management service can determine the input device type according to the input event, and pass the input device type to the input method management service, and finally to the The input method is applied, thereby calling the corresponding input method. In this way, the user does not need to manually switch to an input method that is more suitable for the current input device, which fully considers the user's experience and improves the user experience. In addition, the user does not need to use other applications other than the input method application to determine the input method to be invoked.
结合第一方面,在第一方面的一种可能的实现方式中,所述基于所述第一输入事件调 用第一输入法,具体包括:通过所述输入管理服务基于所述第一输入事件确定所述第一设备类型,并将所述第一设备类型上报给所述输入法管理服务;通过所述输入管理服务比较所述第一设备类型与第一历史设备类型;所述第一历史设备类型为所述电子设备生成的所述第一输入事件的上一个输入事件所对应的输入设备的设备类型;若所述第一设备类型与所述第一历史设备类型不同或不存在所述第一历史设备类型,通过所述输入法管理服务基于第二接口向所述输入法应用发送监听回调信息;所述监听回调信息包括所述第一设备类型;所述输入法应用根据所述监听回调信息中的所述第一设备类型,在输入法调用规则中查找所述第一输入法,并调用所述第一输入法;所述输入法调用规则包括输入设备所对应的设备类型与输入法之间的对应关系。With reference to the first aspect, in a possible implementation manner of the first aspect, invoking the first input method based on the first input event specifically includes: using the input management service to determine based on the first input event The first device type, and report the first device type to the input method management service; compare the first device type with the first historical device type through the input management service; the first historical device type The type is the device type of the input device corresponding to the last input event of the first input event generated by the electronic device; if the first device type is different from the first historical device type or the first historical device type does not exist A historical device type, sending monitoring callback information to the input method application based on the second interface through the input method management service; the monitoring callback information includes the first device type; the input method application according to the monitoring callback For the first device type in the information, search for the first input method in the input method call rule, and call the first input method; the input method call rule includes the device type corresponding to the input device and the input method Correspondence between.
在本申请提供的方案中,输入管理服务可以基于输入事件来确定输入设备的设备类型,并将当前的输入设备类型与历史设备类型进行比较,根据比较结果再判断是否需要将当前的输入设备类型传递给输入法管理服务。若当前的输入设备类型不同于历史设备类型或者不存在历史设备类型,输入管理服务可以将输入设备类型传递给输入法管理服务。也就是说,若用户进行输入的设备类型发生变化,或者,用户首次使用输入设备进行输入,电子设备中的输入管理服务可以将输入设备类型传递给输入法管理服务,再由输入法管理服务传递给输入法应用,最终由输入法应用根据输入法调用规则来找到输入设备类型对应的输入法,并调用并显示该输入法。可理解,通过这种方式,用户无需手动切换合适的输入法,提升了用户体验。In the solution provided by this application, the input management service can determine the device type of the input device based on the input event, compare the current input device type with the historical device type, and judge whether the current input device type needs to be changed according to the comparison result. Passed to the input method management service. If the current input device type is different from the historical device type or there is no historical device type, the input management service can pass the input device type to the input method management service. That is to say, if the device type used by the user changes, or the user uses the input device for input for the first time, the input management service in the electronic device can pass the input device type to the input method management service, and then the input method management service passes For the input method application, the input method application finally finds the input method corresponding to the input device type according to the input method calling rules, and calls and displays the input method. It can be understood that in this way, the user does not need to manually switch the appropriate input method, which improves the user experience.
可理解,输入法调用规则包括输入设备类型与输入法的对应关系。输入法调用规则可以存储在输入法应用中,还可以存储在其他区域以供输入法应用调用。It can be understood that the input method calling rule includes the corresponding relationship between the input device type and the input method. The input method calling rules can be stored in the input method application, and can also be stored in other areas for the input method application to call.
可理解,第二接口为自定义接口,用于传递监听回调信息。该监听回调信息可以包括输入设备类型。第二接口的相关描述可参考后文,在此不展开说明。It can be understood that the second interface is a custom interface, which is used to transmit monitoring callback information. The monitoring callback information may include the type of the input device. For the relevant description of the second interface, reference may be made later, and no further description is given here.
结合第一方面,在第一方面的一种可能的实现方式中,所述基于所述第二输入事件调用第二输入法,具体包括:通过所述输入管理服务基于所述第二输入事件确定所述第二设备类型,并将所述第二设备类型上报给所述输入法管理服务;通过所述输入管理服务比较所述第二设备类型与所述第二历史设备类型;所述第二历史设备类型为所述电子设备生成的所述第二输入事件的上一个输入事件所对应的输入设备的设备类型;若所述第二设备类型与所述第二历史设备类型不同或不存在所述第二历史设备类型,通过所述输入法管理服务基于第二接口向所述输入法应用发送监听回调信息;所述监听回调信息包括所述第二设备类型;所述输入法应用根据所述监听回调信息中的所述第二设备类型,在所述输入法调用规则中查找所述第二输入法,并调用所述第二输入法。With reference to the first aspect, in a possible implementation manner of the first aspect, invoking the second input method based on the second input event specifically includes: using the input management service to determine based on the second input event the second device type, and report the second device type to the input method management service; use the input management service to compare the second device type with the second historical device type; the second The historical device type is the device type of the input device corresponding to the last input event of the second input event generated by the electronic device; if the second device type is different from the second historical device type or does not exist The second historical device type, through the input method management service to send monitoring callback information to the input method application based on the second interface; the monitoring callback information includes the second device type; the input method application according to the Monitoring the second device type in the callback information, searching for the second input method in the input method calling rules, and calling the second input method.
可理解,基于第二输入事件调用第二输入法的过程,可参考基于第一输入事件调用第一输入法的过程。在本申请提供的方案中,输入管理服务可以基于输入事件来确定输入设备的设备类型,并将当前的输入设备类型与历史设备类型进行比较,根据比较结果再判断是否需要将当前的输入设备类型传递给输入法管理服务。具体描述和有益效果可以参考上文,在此不再赘述。It can be understood that the process of invoking the second input method based on the second input event may refer to the process of invoking the first input method based on the first input event. In the solution provided by this application, the input management service can determine the device type of the input device based on the input event, compare the current input device type with the historical device type, and judge whether the current input device type needs to be changed according to the comparison result. Passed to the input method management service. Reference can be made to the above for specific descriptions and beneficial effects, and will not be repeated here.
结合第一方面,在第一方面的一种可能的实现方式中,所述电子设备生成的所述第二输入事件的上一个输入事件为所述第一输入事件;所述第二历史设备类型为所述第一设备 类型。With reference to the first aspect, in a possible implementation manner of the first aspect, the last input event of the second input event generated by the electronic device is the first input event; the second historical device type is the first device type.
在本申请提供的方案中,第一输入事件可以为第二输入事件的上一个输入事件。也就是说,用户在电子设备上进行输入时,从第一输入设备切换至第二输入设备。由于输入设备发生变化,输入设备类型发生变化,电子设备调用并显示的输入法也发生了变化——由之前的第一输入法变成了第二输入法。在这个过程中,用户无需再手动切换输入法,提升了用户体验。In the solution provided by this application, the first input event may be a previous input event of the second input event. That is to say, when the user performs input on the electronic device, he switches from the first input device to the second input device. Due to the change of the input device and the type of the input device, the input method invoked and displayed by the electronic device also changes—from the previous first input method to the second input method. In this process, the user no longer needs to manually switch the input method, which improves the user experience.
示例性的,第一输入设备为触摸屏-手指,第二输入设备为触摸屏-手写笔。用户首先通过手指在电子设备显示的软键盘上进行输入,然后切换至手写笔进行输入。可理解,用户可以利用手写笔直接在电子设备的屏幕上进行输入。也就是说,一旦手写笔接触电子设备的触摸屏,生成手写笔触控事件,电子设备就可以切换显示相应的输入法。Exemplarily, the first input device is a touch screen-finger, and the second input device is a touch screen-stylus. The user first uses fingers to input on the soft keyboard displayed on the electronic device, and then switches to the stylus for input. It can be understood that the user can use the stylus to directly input on the screen of the electronic device. That is to say, once the stylus touches the touch screen of the electronic device and generates a touch event of the stylus, the electronic device can switch to display the corresponding input method.
结合第一方面,在第一方面的一种可能的实现方式中,所述第一界面和所述第二界面为第一应用的用户界面;所述第一应用为所述电子设备中的应用;所述第一操作用于提示所述第一应用获取焦点。With reference to the first aspect, in a possible implementation manner of the first aspect, the first interface and the second interface are user interfaces of a first application; the first application is an application in the electronic device ; The first operation is used to prompt the first application to acquire focus.
在本申请提供的方案中,第一界面和第二界面均为第一应用的用户界面。在显示第一界面之前,电子设备可以显示第三界面。可理解,第一操作可以为针对于第三界面中相应编辑控件的输入操作(例如,点击编辑控件)。电子设备接收第一操作之后,显示第一界面之前,电子设备中的第一应用可以获取焦点,并告知输入法管理服务自己已获取焦点并请求绑定输入法。In the solution provided by the present application, both the first interface and the second interface are user interfaces of the first application. Before displaying the first interface, the electronic device may display the third interface. It can be understood that the first operation may be an input operation for a corresponding edit control in the third interface (for example, clicking on the edit control). After the electronic device receives the first operation and before displaying the first interface, the first application in the electronic device can obtain the focus, and notify the input method management service that it has obtained the focus and request to bind the input method.
可理解,编辑控件为用于进行输入编辑的控件。例如,编辑框等。It can be understood that the edit control is a control used for input editing. For example, edit boxes, etc.
结合第一方面,在第一方面的一种可能的实现方式中,所述第二操作用于提示所述第一应用获取焦点。With reference to the first aspect, in a possible implementation manner of the first aspect, the second operation is used to prompt the first application to obtain the focus.
在本申请提供的方案中,第二操作可以为针对于第一应用中其他用户界面包括的相应编辑控件的输入操作(例如,点击编辑控件)。电子设备接收第二操作之后,显示第二界面之前,电子设备中的第一应用可以获取焦点,并告知输入法管理服务自己已获取焦点并请求绑定输入法。也就是说,第一应用显示第一界面之后,显示第二界面之前,还需要重新获取焦点,以便显示输入法,从而实现输入。In the solution provided by the present application, the second operation may be an input operation (for example, clicking on an edit control) on a corresponding edit control included in other user interfaces in the first application. After the electronic device receives the second operation and before displaying the second interface, the first application in the electronic device can obtain the focus, and notify the input method management service that it has obtained the focus and request to bind the input method. That is to say, after the first application displays the first interface and before displaying the second interface, it needs to reacquire the focus so as to display the input method, thereby implementing input.
结合第一方面,在第一方面的一种可能的实现方式中,所述第一界面为第一应用的用户界面;所述第二界面为第二应用的用户界面;所述第一应用和所述第二应用为所述电子设备中的应用;所述第一操作用于提示所述第一应用获取焦点;所述第二操作用于提示所述第二应用获取焦点。With reference to the first aspect, in a possible implementation manner of the first aspect, the first interface is a user interface of a first application; the second interface is a user interface of a second application; the first application and The second application is an application in the electronic device; the first operation is used to prompt the first application to obtain focus; the second operation is used to prompt the second application to obtain focus.
在本申请提供的方案中,第一界面为第一应用的用户界面,第二界面为第二应用的用户界面。用户可以切换不同的输入设备在不同的应用中进行输入。在这种情况下,第一操作可以为针对于第一应用的相应界面的编辑控件的输入操作,第二操作可以为针对第二应用的相应界面的编辑控件的输入操作。In the solution provided by the present application, the first interface is the user interface of the first application, and the second interface is the user interface of the second application. Users can switch between different input devices to input in different applications. In this case, the first operation may be an input operation directed at the edit control of the corresponding interface of the first application, and the second operation may be an input operation directed at the edit control of the corresponding interface of the second application.
第二方面,本申请提供了一种输入法调用方法。该方法可以应用于电子设备。该方法可以包括:接收目标操作,响应于所述目标操作,生成目标输入事件;通过输入管理服务 基于所述目标输入事件确定目标设备类型,并将所述目标设备类型上报给输入法管理服务;通过所述输入管理服务比较所述目标设备类型与历史设备类型;所述历史设备类型为所述电子设备生成的所述目标输入事件的上一个输入事件所对应的输入设备的设备类型;若所述目标设备类型与所述历史设备类型不同或不存在所述历史设备类型,通过所述输入法管理服务向所述电子设备中的输入法应用发送监听回调信息;所述监听回调信息包括所述目标设备类型;通过所述输入法应用来根据所述监听回调信息中的所述目标设备类型,在输入法调用规则中查找目标输入法;所述输入法调用规则包括输入设备所对应的设备类型与输入法之间的对应关系;调用所述目标输入法,并显示输入界面;所述输入界面显示有所述目标输入法。In a second aspect, the present application provides an input method calling method. The method can be applied to electronic devices. The method may include: receiving a target operation, generating a target input event in response to the target operation; determining the target device type based on the target input event through the input management service, and reporting the target device type to the input method management service; Compare the target device type with the historical device type through the input management service; the historical device type is the device type of the input device corresponding to the last input event of the target input event generated by the electronic device; if the If the target device type is different from the historical device type or the historical device type does not exist, the monitoring callback information is sent to the input method application in the electronic device through the input method management service; the monitoring callback information includes the Target device type; use the input method application to search for the target input method in the input method call rule according to the target device type in the monitoring callback information; the input method call rule includes the device type corresponding to the input device Correspondence between input methods; call the target input method, and display an input interface; the input interface displays the target input method.
在本申请提供的方案中,电子设备可以响应用户的目标操作,生成目标输入事件,并根据目标输入事件确定目标设备类型。电子设备可以再输入法调用规则中查找目标设备类型所对应的输入法,并调用该输入法。通过这种方法,用户无需手动切换至与当前输入设备更匹配的输入法,充分考虑了用户的使用感受,提升了用户体验。In the solution provided by the present application, the electronic device can generate a target input event in response to a user's target operation, and determine the target device type according to the target input event. The electronic device can search the input method corresponding to the target device type in the input method calling rule, and call the input method. With this method, the user does not need to manually switch to an input method that is more suitable for the current input device, which fully considers the user's experience and improves the user experience.
可理解,目标操作为利用输入设备进行的输入操作。目标输入事件是针对于目标操作生成的输入事件。目标设备类型为输入设备的设备类型。It can be understood that the target operation is an input operation performed by an input device. A target input event is an input event generated for a target action. The target device type is the device type of the input device.
结合第二方面,在第二方面的一种可能的实现方式中,所述响应于所述目标操作,生成目标输入事件之前,所述方法还包括:通过所述输入法应用基于第一接口向所述输入法管理服务发送注册监听请求;所述注册监听请求用于请求所述输入法管理服务对输入设备进行监听;通过所述输入法管理服务向所述输入管理服务发送第一消息;所述第一消息用于请求所述输入管理服务对输入设备进行监听。With reference to the second aspect, in a possible implementation manner of the second aspect, before generating a target input event in response to the target operation, the method further includes: using the input method application to send an input message based on the first interface to The input method management service sends a registration monitoring request; the registration monitoring request is used to request the input method management service to monitor the input device; the input method management service sends a first message to the input management service; The first message is used to request the input management service to monitor the input device.
结合第二方面,在第二方面的一种可能的实现方式中,所述通过输入管理服务基于所述目标输入事件确定目标设备类型,具体包括:在所述目标输入事件为第一输入事件的情况下,通过所述输入管理服务确定所述目标设备类型为第一设备类型;在所述目标输入事件为第二输入事件的情况下,通过所述输入管理服务确定所述目标设备类型为第二设备类型;在所述目标输入事件为第三输入事件的情况下,通过所述输入管理服务确定所述目标设备类型为第三设备类型。With reference to the second aspect, in a possible implementation manner of the second aspect, the determining the target device type based on the target input event through the input management service specifically includes: when the target input event is the first input event In this case, the input management service determines that the target device type is the first device type; when the target input event is the second input event, the input management service determines that the target device type is the second Two device types: when the target input event is a third input event, determine that the target device type is a third device type through the input management service.
结合第二方面,在第二方面的一种可能的实现方式中,所述第一输入事件为手指触控事件,所述第一设备类型为触摸屏-手指;所述第二输入事件为手写笔触控事件,所述第二设备类型为触摸屏-手写笔;所述第三输入事件为键盘事件,所述第三设备类型为键盘。With reference to the second aspect, in a possible implementation of the second aspect, the first input event is a finger touch event, the first device type is a touch screen-finger; the second input event is a handwriting stroke control event, the second device type is a touch screen-stylus pen; the third input event is a keyboard event, and the third device type is a keyboard.
可理解,用户可以利用不同输入设备进行输入,电子设备生成的输入事件可以为不同类型的输入事件。It can be understood that the user may use different input devices to perform input, and the input events generated by the electronic device may be different types of input events.
在本申请的一些实施例中,目标操作可以为手指触控操作、手写笔触控操作,以及敲击键盘操作。相应的,目标输入事件可以为手指触控事件、手写笔触控事件,以及键盘事件。In some embodiments of the present application, the target operation may be a finger touch operation, a stylus touch operation, and a keyboard tapping operation. Correspondingly, the target input event may be a finger touch event, a stylus touch event, and a keyboard event.
可理解,目标输入事件还可以为其他类型的输入事件。例如,鼠标事件、按键事件等。Understandably, the target input event may also be other types of input events. For example, mouse events, key events, etc.
第三方面,本申请提供了一种电子设备。该电子设备包括接收模块、显示模块。其中,接收模块,用于接收第一操作;显示模块,用于响应于第一操作,显示第一界面。可理解, 第一操作为通过第一输入方式进行的输入操作,第一界面显示有第一输入法。第一输入法为与第一输入方式对应的输入法。接收模块,还用于接收第二操作。显示模块,还用于响应于第二操作,显示第二界面。可理解,第二操作为通过第二输入方式进行的输入操作,第二界面显示有第二输入法。第二输入法为与第二输入方式对应的输入法。结合第三方面,在第三方面的一种可能的实现方式中,第一输入方式为利用第一输入设备进行输入的方式;第二输入方式为利用第二输入设备进行输入的方。第一输入法为与第一输入方式对应的输入法,具体包括:第一输入法为与第一设备类型对应的输入法,第一设备类型为第一输入设备对应的设备类型。第二输入法为与第二输入方式对应的输入法,具体包括:第二输入法为与第二设备类型对应的输入法,第二设备类型为第二输入设备对应的设备类型。In a third aspect, the present application provides an electronic device. The electronic equipment includes a receiving module and a display module. Wherein, the receiving module is configured to receive the first operation; the display module is configured to display the first interface in response to the first operation. It can be understood that the first operation is an input operation performed through the first input method, and the first interface displays the first input method. The first input method is an input method corresponding to the first input mode. The receiving module is further configured to receive the second operation. The display module is further configured to display a second interface in response to the second operation. It can be understood that the second operation is an input operation performed through the second input method, and the second interface displays the second input method. The second input method is an input method corresponding to the second input method. With reference to the third aspect, in a possible implementation manner of the third aspect, the first input mode is an input mode using a first input device; the second input mode is an input mode using a second input device. The first input method is an input method corresponding to the first input method, specifically including: the first input method is an input method corresponding to the first device type, and the first device type is a device type corresponding to the first input device. The second input method is an input method corresponding to the second input method, specifically including: the second input method is an input method corresponding to the second device type, and the second device type is a device type corresponding to the second input device.
结合第三方面,在第三方面的一种可能的实现方式中,电子设备还可以包括输入法应用、输入法管理服务和输入管理服务。其中,输入法应用可以用于基于第一接口向输入法管理服务发送注册监听请求。注册监听请求用于请求输入法管理服务对输入设备进行监听。输入法管理服务可以用于向输入管理服务发送第一消息。第一消息用于请求输入管理服务对输入设备进行监听。With reference to the third aspect, in a possible implementation manner of the third aspect, the electronic device may further include an input method application, an input method management service, and an input management service. Wherein, the input method application may be configured to send a registration monitoring request to the input method management service based on the first interface. The registration monitoring request is used to request the input method management service to monitor the input device. The input method management service may be used to send the first message to the input management service. The first message is used to request the input management service to monitor the input device.
结合第三方面,在第三方面的一种可能的实现方式中,电子设备还可以包括输入事件产生模块。输入事件产生模块,用于响应于第一操作,生成第一输入事件。输入管理服务,还用于基于第一输入事件确定第一设备类型,并将第一设备类型上报给输入法管理服务;比较第一设备类型与第一历史设备类型。其中,第一历史设备类型为电子设备生成的第一输入事件的上一个输入事件所对应的输入设备的设备类型。输入法管理服务,还用于在第一设备类型与第一历史设备类型不同或不存在第一历史设备类型的情况下,通过第二接口向输入法应用发送监听回调信息。监听回调信息包括第一设备类型。输入法应用,用于根据监听回调信息中的第一设备类型,在输入法调用规则中查找第一输入法,并调用第一输入法。输入法调用规则包括输入设备所对应的设备类型与输入法之间的对应关系。With reference to the third aspect, in a possible implementation manner of the third aspect, the electronic device may further include an input event generating module. An input event generating module, configured to generate a first input event in response to the first operation. The input management service is further configured to determine the first device type based on the first input event, and report the first device type to the input method management service; compare the first device type with the first historical device type. Wherein, the first historical device type is the device type of the input device corresponding to the last input event of the first input event generated by the electronic device. The input method management service is further configured to send monitoring callback information to the input method application through the second interface when the first device type is different from the first historical device type or the first historical device type does not exist. The monitoring callback information includes the first device type. The input method application is configured to search for the first input method in the input method calling rule according to the first device type in the monitoring callback information, and call the first input method. The input method calling rule includes the corresponding relationship between the device type corresponding to the input device and the input method.
结合第三方面,在第三方面的一种可能的实现方式中,输入事件产生模块,还用于响应于第二操作,生成第二输入事件。输入管理服务,还用于基于第二输入事件确定第二设备类型,并将第二设备类型上报给输入法管理服务;比较第二设备类型与第二历史设备类型。其中,第二历史设备类型为电子设备生成的第二输入事件的上一个输入事件所对应的输入设备的设备类型。输入法管理服务,还用于在第二设备类型与第二历史设备类型不同或不存在第二历史设备类型的情况下,通过第二接口向输入法应用发送监听回调信息。监听回调信息包括第二设备类型。输入法应用,还用于根据监听回调信息中的第二设备类型,在输入法调用规则中查找第二输入法,并调用第二输入法。With reference to the third aspect, in a possible implementation manner of the third aspect, the input event generating module is further configured to generate a second input event in response to the second operation. The input management service is further configured to determine the second device type based on the second input event, and report the second device type to the input method management service; compare the second device type with the second historical device type. Wherein, the second historical device type is the device type of the input device corresponding to the last input event of the second input event generated by the electronic device. The input method management service is further configured to send monitoring callback information to the input method application through the second interface when the second device type is different from the second historical device type or there is no second historical device type. The monitoring callback information includes the second device type. The input method application is further configured to search for the second input method in the input method calling rule according to the second device type in the monitoring callback information, and call the second input method.
结合第三方面,在第三方面的一种可能的实现方式中,所述电子设备生成的所述第二输入事件的上一个输入事件为所述第一输入事件;所述第二历史设备类型为所述第一设备类型。With reference to the third aspect, in a possible implementation manner of the third aspect, the last input event of the second input event generated by the electronic device is the first input event; the second historical device type is the first device type.
结合第三方面,在第三方面的一种可能的实现方式中,所述第一界面和所述第二界面为第一应用的用户界面;所述第一应用为所述电子设备中的应用;所述第一操作用于提示所述第一应用获取焦点。With reference to the third aspect, in a possible implementation manner of the third aspect, the first interface and the second interface are user interfaces of a first application; the first application is an application in the electronic device ; The first operation is used to prompt the first application to acquire focus.
结合第三方面,在第三方面的一种可能的实现方式中,所述第二操作用于提示所述第 一应用获取焦点。With reference to the third aspect, in a possible implementation manner of the third aspect, the second operation is used to prompt the first application to obtain the focus.
结合第三方面,在第三方面的一种可能的实现方式中,所述第一界面为第一应用的用户界面;所述第二界面为第二应用的用户界面;所述第一应用和所述第二应用为所述电子设备中的应用;所述第一操作用于提示所述第一应用获取焦点;所述第二操作用于提示所述第二应用获取焦点。With reference to the third aspect, in a possible implementation manner of the third aspect, the first interface is a user interface of a first application; the second interface is a user interface of a second application; the first application and The second application is an application in the electronic device; the first operation is used to prompt the first application to obtain focus; the second operation is used to prompt the second application to obtain focus.
第四方面,本申请提供了一种电子设备。该电子设备可以包括接收模块、输入事件产生模块、输入管理服务、输入法管理服务、输入法应用和显示模块。其中,接收模块,用于接收目标操作。输入事件产生模块,用于响应于目标操作,生成目标输入事件。目标操作为利用输入设备进行的输入操作。输入管理服务,用于基于目标输入事件确定目标设备类型,并将目标设备类型上报给输入法管理服务;比较目标设备类型与历史设备类型。目标设备类型为输入设备的设备类型。历史设备类型为电子设备生成的目标输入事件的上一个输入事件所对应的输入设备的设备类型。输入法管理服务,用于在目标设备类型与历史设备类型不同或不存在历史设备类型的情况下,通过输入法管理服务向电子设备中的输入法应用发送监听回调信息。监听回调信息包括目标设备类型。输入法应用,用于根据监听回调信息中的目标设备类型,在输入法调用规则中查找目标输入法,并调用目标输入法。输入法调用规则包括输入设备所对应的设备类型与输入法之间的对应关系。显示模块,用于显示输入界面。输入界面显示有目标输入法。In a fourth aspect, the present application provides an electronic device. The electronic device may include a receiving module, an input event generating module, an input management service, an input method management service, an input method application and a display module. Wherein, the receiving module is used for receiving the target operation. The input event generating module is used for generating a target input event in response to the target operation. The target operation is an input operation performed using an input device. The input management service is used to determine the target device type based on the target input event, and report the target device type to the input method management service; compare the target device type with the historical device type. The target device type is the device type of the input device. The historical device type is the device type of the input device corresponding to the last input event of the target input event generated by the electronic device. The input method management service is used to send monitoring callback information to the input method application in the electronic device through the input method management service when the target device type is different from the historical device type or there is no historical device type. The monitoring callback information includes the target device type. The input method application is used to search for the target input method in the input method calling rules according to the target device type in the monitoring callback information, and call the target input method. The input method calling rule includes the corresponding relationship between the device type corresponding to the input device and the input method. The display module is used for displaying the input interface. The input interface displays the target input method.
结合第四方面,在第四方面的一种可能的实现方式中,输入法应用,还可以用于基于第一接口向输入法管理服务发送注册监听请求。注册监听请求用于请求输入法管理服务对输入设备进行监听。输入法管理服务,还可以用于向输入管理服务发送第一消息。第一消息用于请求输入管理服务对输入设备进行监听。With reference to the fourth aspect, in a possible implementation manner of the fourth aspect, the input method application may also be configured to send a registration monitoring request to the input method management service based on the first interface. The registration monitoring request is used to request the input method management service to monitor the input device. The input method management service may also be used to send the first message to the input management service. The first message is used to request the input management service to monitor the input device.
结合第四方面,在第四方面的一种可能的实现方式中,输入管理服务在用于基于目标输入事件确定目标设备类型时,具体用于:在目标输入事件为第一输入事件的情况下,通过输入管理服务确定目标设备类型为第一设备类型;在目标输入事件为第二输入事件的情况下,通过输入管理服务确定目标设备类型为第二设备类型;在目标输入事件为第三输入事件的情况下,通过输入管理服务确定目标设备类型为第三设备类型。其中,第一输入事件为手指触控事件,第一设备类型为触摸屏-手指;第二输入事件为手写笔触控事件,第二设备类型为触摸屏-手写笔;第三输入事件为键盘事件,第三设备类型为键盘。With reference to the fourth aspect, in a possible implementation manner of the fourth aspect, when the input management service is used to determine the target device type based on the target input event, it is specifically used to: when the target input event is the first input event , the target device type is determined to be the first device type by the input management service; if the target input event is the second input event, the target device type is determined to be the second device type by the input management service; if the target input event is the third input event In the case of an event, the target device type is determined to be the third device type through the input management service. Wherein, the first input event is a finger touch event, and the first device type is a touch screen-finger; the second input event is a stylus touch event, and the second device type is a touch screen-stylus; the third input event is a keyboard event, and the second The third device type is keyboard.
第五方面,本申请提供了一种电子设备。该电子设备可以包括显示屏、存储器、一个或多个处理器。其中,一个或多个处理器与存储器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令。电子设备可以接收第一操作。显示屏,用于响应于第一操作,显示第一界面,还用于响应于第二操作,显示第二界面。其中,第一操作为通过第一输入方式进行的输入操作。第一界面显示有第一输入法。第一输入法为与第一输入方式对应的输入法。第二操作为通过第二输入方式进行的输入操作。第二界面显示有第二输入法。第二输入法为与第二输入方式对应的输入法。第一输入法不同于第二输入法。In a fifth aspect, the present application provides an electronic device. The electronic device may include a display screen, memory, and one or more processors. Wherein, one or more processors are coupled with a memory, and the memory is used to store computer program codes, and the computer program codes include computer instructions. The electronic device may receive a first operation. The display screen is used to display the first interface in response to the first operation, and is also used to display the second interface in response to the second operation. Wherein, the first operation is an input operation performed through a first input mode. The first interface displays the first input method. The first input method is an input method corresponding to the first input mode. The second operation is an input operation performed through the second input mode. The second interface displays the second input method. The second input method is an input method corresponding to the second input method. The first input method is different from the second input method.
结合第五方面,在第五方面的一种可能的实现方式中,第一输入方式为利用第一输入 设备进行输入的方式;第二输入方式为利用第二输入设备进行输入的方。第一输入法为与第一输入方式对应的输入法,具体包括:第一输入法为与第一设备类型对应的输入法,第一设备类型为第一输入设备对应的设备类型。第二输入法为与第二输入方式对应的输入法,具体包括:第二输入法为与第二设备类型对应的输入法,第二设备类型为第二输入设备对应的设备类型。With reference to the fifth aspect, in a possible implementation of the fifth aspect, the first input method is an input method using a first input device; the second input method is an input method using a second input device. The first input method is an input method corresponding to the first input method, specifically including: the first input method is an input method corresponding to the first device type, and the first device type is a device type corresponding to the first input device. The second input method is an input method corresponding to the second input method, specifically including: the second input method is an input method corresponding to the second device type, and the second device type is a device type corresponding to the second input device.
结合第五方面,在第五方面的一种可能的实现方式中,处理器,用于通过电子设备中的输入法应用基于第一接口向电子设备中的输入法管理服务发送注册监听请求;通过输入法管理服务向电子设备中的输入管理服务发送第一消息。其中,注册监听请求用于请求输入法管理服务对输入设备进行监听。第一消息用于请求输入管理服务对输入设备进行监听。With reference to the fifth aspect, in a possible implementation of the fifth aspect, the processor is configured to use the input method application in the electronic device to send a registration monitoring request to the input method management service in the electronic device based on the first interface; The input method management service sends the first message to the input management service in the electronic device. Wherein, the registration monitoring request is used to request the input method management service to monitor the input device. The first message is used to request the input management service to monitor the input device.
结合第五方面,在第五方面的一种可能的实现方式中,处理器,还用于响应于第一操作,生成第一输入事件;基于第一输入事件调用第一输入法。第一输入事件为针对第一输入设备所产生的输入事件。处理器,还用于响应于第二操作,生成第二输入事件;基于第二输入事件调用第二输入法。第二输入事件为针对第二输入设备所产生的输入事件。With reference to the fifth aspect, in a possible implementation manner of the fifth aspect, the processor is further configured to generate a first input event in response to the first operation; and invoke the first input method based on the first input event. The first input event is an input event generated for the first input device. The processor is further configured to generate a second input event in response to the second operation; and invoke the second input method based on the second input event. The second input event is an input event generated for the second input device.
结合第五方面,在第五方面的一种可能的实现方式中,处理器,在用于基于第一输入事件调用第一输入法时,具体用于:通过输入管理服务基于第一输入事件确定第一设备类型,并将第一设备类型上报给输入法管理服务;通过输入管理服务比较第一设备类型与第一历史设备类型;若第一设备类型与第一历史设备类型不同或不存在第一历史设备类型,通过输入法管理服务基于第二接口向输入法应用发送监听回调信息;通过输入法应用根据监听回调信息中的第一设备类型,在输入法调用规则中查找第一输入法,并调用第一输入法。其中,第一历史设备类型为电子设备生成的第一输入事件的上一个输入事件所对应的输入设备的设备类型。监听回调信息包括第一设备类型。输入法调用规则包括输入设备所对应的设备类型与输入法之间的对应关系。With reference to the fifth aspect, in a possible implementation manner of the fifth aspect, when the processor is configured to call the first input method based on the first input event, it is specifically configured to: use the input management service to determine based on the first input event The first device type, and report the first device type to the input method management service; compare the first device type with the first historical device type through the input management service; if the first device type is different from the first historical device type or there is no first device type A historical device type, through the input method management service to send monitoring callback information to the input method application based on the second interface; through the input method application, according to the first device type in the monitoring callback information, search for the first input method in the input method call rule, And call the first input method. Wherein, the first historical device type is the device type of the input device corresponding to the last input event of the first input event generated by the electronic device. The monitoring callback information includes the first device type. The input method calling rule includes the corresponding relationship between the device type corresponding to the input device and the input method.
结合第五方面,在第五方面的一种可能的实现方式中,处理器,在用于基于第二输入事件调用第二输入法时,具体用于:通过输入管理服务基于第二输入事件确定第二设备类型,并将第二设备类型上报给输入法管理服务;通过输入管理服务比较第二设备类型与第二历史设备类型;若第二设备类型与第二历史设备类型不同或不存在第二历史设备类型,通过输入法管理服务基于第二接口向输入法应用发送监听回调信息;通过输入法应用根据监听回调信息中的第二设备类型,在输入法调用规则中查找第二输入法,并调用第二输入法。其中,第二历史设备类型为电子设备生成的第二输入事件的上一个输入事件所对应的输入设备的设备类型。监听回调信息包括第二设备类型。With reference to the fifth aspect, in a possible implementation manner of the fifth aspect, when the processor is configured to call the second input method based on the second input event, it is specifically configured to: use the input management service to determine based on the second input event The second device type, and report the second device type to the input method management service; compare the second device type with the second historical device type through the input management service; if the second device type is different from the second historical device type or there is no first Two historical device types, send monitoring callback information to the input method application based on the second interface through the input method management service; through the input method application, search for the second input method in the input method calling rules according to the second device type in the monitoring callback information, And call the second input method. Wherein, the second historical device type is the device type of the input device corresponding to the last input event of the second input event generated by the electronic device. The monitoring callback information includes the second device type.
结合第五方面,在第五方面的一种可能的实现方式中,电子设备生成的第二输入事件的上一个输入事件为第一输入事件。第二历史设备类型为第一设备类型。With reference to the fifth aspect, in a possible implementation manner of the fifth aspect, a previous input event of the second input event generated by the electronic device is the first input event. The second historical device type is the first device type.
结合第五方面,在第五方面的一种可能的实现方式中,第一界面和第二界面为第一应用的用户界面。第一应用为电子设备中的应用。第一操作用于提示第一应用获取焦点。With reference to the fifth aspect, in a possible implementation manner of the fifth aspect, the first interface and the second interface are user interfaces of the first application. The first application is an application in an electronic device. The first operation is used to prompt the first application to acquire focus.
结合第五方面,在第五方面的一种可能的实现方式中,第二操作用于提示第一应用获取焦点。With reference to the fifth aspect, in a possible implementation manner of the fifth aspect, the second operation is used to prompt the first application to obtain the focus.
结合第五方面,在第五方面的一种可能的实现方式中,第一界面为第一应用的用户界面。第二界面为第二应用的用户界面。第一应用和第二应用为电子设备中的应用。第一操 作用于提示第一应用获取焦点。第二操作用于提示第二应用获取焦点。With reference to the fifth aspect, in a possible implementation manner of the fifth aspect, the first interface is a user interface of the first application. The second interface is a user interface of the second application. The first application and the second application are applications in the electronic device. The first operation is used to prompt the first application to obtain focus. The second operation is used to prompt the second application to obtain the focus.
第六方面,本申请提供了一种电子设备。该电子设备可以包括显示屏、存储器、一个或多个处理器。其中,一个或多个处理器与存储器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令。电子设备可以接收目标操作。处理器,可以用于,响应于目标操作,生成目标输入事件;通过输入管理服务基于目标输入事件确定目标设备类型,并将目标设备类型上报给输入法管理服务;通过输入管理服务比较目标设备类型与历史设备类型;若目标设备类型与历史设备类型不同或不存在历史设备类型,通过输入法管理服务向电子设备中的输入法应用发送监听回调信息;通过输入法应用来根据监听回调信息中的目标设备类型,在输入法调用规则中查找目标输入法;调用目标输入法,并显示输入界面;输入界面显示有目标输入法。其中,目标操作为利用输入设备进行的输入操作。目标设备类型为输入设备的设备类型。历史设备类型为电子设备生成的目标输入事件的上一个输入事件所对应的输入设备的设备类型。监听回调信息包括目标设备类型。输入法调用规则包括输入设备所对应的设备类型与输入法之间的对应关系。In a sixth aspect, the present application provides an electronic device. The electronic device may include a display screen, memory, and one or more processors. Wherein, one or more processors are coupled with a memory, and the memory is used to store computer program codes, and the computer program codes include computer instructions. The electronic device can receive the target operation. The processor can be used to generate a target input event in response to the target operation; determine the target device type based on the target input event through the input management service, and report the target device type to the input method management service; compare the target device type through the input management service and the historical device type; if the target device type is different from the historical device type or there is no historical device type, send monitoring callback information to the input method application in the electronic device through the input method management service; through the input method application, according to the monitoring callback information Target device type, find the target input method in the input method call rule; call the target input method, and display the input interface; the input interface displays the target input method. Wherein, the target operation is an input operation performed by an input device. The target device type is the device type of the input device. The historical device type is the device type of the input device corresponding to the last input event of the target input event generated by the electronic device. The monitoring callback information includes the target device type. The input method calling rule includes the corresponding relationship between the device type corresponding to the input device and the input method.
结合第六方面,在第六方面的一种可能的实现方式中,处理器,还用于通过电子设备中的输入法应用基于第一接口向电子设备中的输入法管理服务发送注册监听请求;通过输入法管理服务向电子设备中的输入管理服务发送第一消息。其中,注册监听请求用于请求输入法管理服务对输入设备进行监听。第一消息用于请求输入管理服务对输入设备进行监听。With reference to the sixth aspect, in a possible implementation manner of the sixth aspect, the processor is further configured to use the input method application in the electronic device to send a registration monitoring request to the input method management service in the electronic device based on the first interface; Send the first message to the input management service in the electronic device through the input method management service. Wherein, the registration monitoring request is used to request the input method management service to monitor the input device. The first message is used to request the input management service to monitor the input device.
结合第六方面,在第六方面的一种可能的实现方式中,处理器,在用于基于目标输入事件确定目标设备类型时,具体用于:在目标输入事件为第一输入事件的情况下,通过输入管理服务确定目标设备类型为第一设备类型;在目标输入事件为第二输入事件的情况下,通过输入管理服务确定目标设备类型为第二设备类型;在目标输入事件为第三输入事件的情况下,通过输入管理服务确定目标设备类型为第三设备类型。其中,第一输入事件为手指触控事件,第一设备类型为触摸屏-手指;第二输入事件为手写笔触控事件,第二设备类型为触摸屏-手写笔;第三输入事件为键盘事件,第三设备类型为键盘。With reference to the sixth aspect, in a possible implementation manner of the sixth aspect, when the processor is configured to determine the target device type based on the target input event, it is specifically configured to: when the target input event is the first input event , the target device type is determined to be the first device type by the input management service; if the target input event is the second input event, the target device type is determined to be the second device type by the input management service; if the target input event is the third input event In the case of an event, the target device type is determined to be the third device type through the input management service. Wherein, the first input event is a finger touch event, and the first device type is a touch screen-finger; the second input event is a stylus touch event, and the second device type is a touch screen-stylus; the third input event is a keyboard event, and the second The third device type is keyboard.
第七方面,本申请提供一种计算机存储介质,包括指令,当上述指令在电子设备上运行时,使得上述电子设备执行上述第一方面中任一种可能的实现方式。In a seventh aspect, the present application provides a computer storage medium, including instructions, which, when the instructions are run on an electronic device, cause the electronic device to execute any possible implementation manner in the first aspect above.
第八方面,本申请提供一种计算机存储介质,包括指令,当上述指令在电子设备上运行时,使得上述电子设备执行上述第二方面中任一种可能的实现方式。In an eighth aspect, the present application provides a computer storage medium, including instructions, which, when the instructions are run on an electronic device, cause the electronic device to execute any possible implementation manner in the second aspect above.
第九方面,本申请实施例提供一种芯片,该芯片应用于电子设备,该芯片包括一个或多个处理器,该处理器用于调用计算机指令以使得该电子设备执行上述第一方面中任一种可能的实现方式。In the ninth aspect, the embodiment of the present application provides a chip, the chip is applied to electronic equipment, and the chip includes one or more processors, and the processor is used to call computer instructions to make the electronic equipment execute any one of the above first aspects a possible implementation.
第十方面,本申请实施例提供一种芯片,该芯片应用于电子设备,该芯片包括一个或多个处理器,该处理器用于调用计算机指令以使得该电子设备执行上述第二方面中任一种可能的实现方式。In a tenth aspect, an embodiment of the present application provides a chip, the chip is applied to an electronic device, and the chip includes one or more processors, and the processor is used to invoke computer instructions so that the electronic device executes any one of the above-mentioned second aspects. a possible implementation.
第十一方面,本申请实施例提供一种包含指令的计算机程序产品,当上述计算机程序 产品在设备上运行时,使得上述电子设备执行上述第一方面任一种可能的实现方式。In the eleventh aspect, the embodiment of the present application provides a computer program product containing instructions, which, when the computer program product is run on the device, causes the electronic device to execute any possible implementation of the first aspect above.
第十二方面,本申请实施例提供一种包含指令的计算机程序产品,当上述计算机程序产品在设备上运行时,使得上述电子设备执行上述第二方面中任一种可能的实现方式。In a twelfth aspect, an embodiment of the present application provides a computer program product including instructions, which, when the computer program product is run on a device, cause the electronic device to execute any possible implementation manner in the second aspect above.
可以理解地,上述第二方面提供的输入法调用方法的有益效果可以参考第一方面中任一种可能的实现方式的有益效果,在此不再赘述。另外,上述第三方面和第五方面提供的电子设备、第七方面提供的计算机存储介质、第九方面提供的芯片,以及第十一方面提供的计算机程序产品均用于执行上述第一方面中任一种可能的实现方式。上述第四方面和第六方面提供的电子设备、第八方面提供的计算机存储介质、第十方面提供的芯片,以及第十二方面提供的计算机程序产品均用于执行上述第二方面中任一种可能的实现方式。因此,其所能达到的有益效果可参考上述第一方面中任一种可能的实现方式的有益效果,此处不再赘述。It can be understood that the beneficial effect of the input method invoking method provided by the second aspect above can refer to the beneficial effect of any possible implementation manner in the first aspect, which will not be repeated here. In addition, the electronic equipment provided in the third aspect and the fifth aspect, the computer storage medium provided in the seventh aspect, the chip provided in the ninth aspect, and the computer program product provided in the eleventh aspect are all used to implement the above-mentioned first aspect. any possible implementation. The electronic equipment provided by the fourth aspect and the sixth aspect above, the computer storage medium provided by the eighth aspect, the chip provided by the tenth aspect, and the computer program product provided by the twelfth aspect are all used to implement any one of the above second aspects a possible implementation. Therefore, for the beneficial effects that can be achieved, reference may be made to the beneficial effects of any possible implementation manner in the first aspect above, which will not be repeated here.
附图说明Description of drawings
图1为本申请实施例提供的一种输入法调用场景的示意图;FIG. 1 is a schematic diagram of an input method calling scenario provided by an embodiment of the present application;
图2A-图2K为本申请实施例提供的一组用户界面的示意图;2A-2K are schematic diagrams of a group of user interfaces provided by the embodiment of the present application;
图3为本申请实施例提供的一种电子设备100的硬件结构示意图;FIG. 3 is a schematic diagram of a hardware structure of an electronic device 100 provided in an embodiment of the present application;
图4为本申请实施例提供的一种电子设备100的软件结构示意图;FIG. 4 is a schematic diagram of a software structure of an electronic device 100 provided in an embodiment of the present application;
图5为本申请实施例提供的一种调用输入法的过程示意图;FIG. 5 is a schematic diagram of a process of invoking an input method provided by an embodiment of the present application;
图6为本申请实施例提供的一种输入法调用方法的流程图;FIG. 6 is a flow chart of an input method calling method provided by an embodiment of the present application;
图7为本申请实施例提供的又一种输入法调用方法的流程图。FIG. 7 is a flow chart of another method for invoking an input method provided by the embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the embodiments of this application, unless otherwise specified, "/" means or means, for example, A/B can mean A or B; "and/or" in the text is only a description of associated objects The association relationship indicates that there may be three kinds of relationships, for example, A and/or B, which may indicate: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiment of the present application , "plurality" means two or more than two.
应当理解,本申请的说明书和权利要求书及附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be understood that the terms "first" and "second" in the specification, claims and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. Furthermore, the terms "include" and "have", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally further includes For other steps or units inherent in these processes, methods, products or apparatuses.
在本申请中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本申请所描述的实施例可以与其它实施例相结合。Reference in this application to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The occurrences of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is understood explicitly and implicitly by those skilled in the art that the embodiments described in this application can be combined with other embodiments.
人们在利用手机、平板电脑等终端设备进行工作和娱乐时,往往需要通过输入法进行输入。例如,用户在利用手机中的社交软件与朋友或同事进行聊天时,可以通过调用输入 法来输入文字。再例如,用户可以通过在搜索引擎的搜索框中输入文字来进行搜索。When people use terminal devices such as mobile phones and tablet computers for work and entertainment, they often need to use input methods for input. For example, when a user utilizes social software in a mobile phone to chat with friends or colleagues, he can input text by calling an input method. For another example, a user may search by inputting text in a search box of a search engine.
用户进行输入的方式多种多样。比如,用户可以直接通过手指触摸终端设备的屏幕来实现输入,还可以通过一些输入设备来实现输入。可理解,若用户采取的输入方式不同,适用的输入模式可能不同。即不同的输入方式适用的具体的输入法可能不同。比如,手指触摸输入可能适用于键盘输入模式,即全拼输入法、五笔输入法等需要利用键盘的输入法,而手写笔输入可能适用于手写输入模式,即手写输入法。然而,无论用户采用什么样的输入方式,输入界面首先显示的都是默认输入模式。可理解,这里所提及的默认输入模式可以包括用户设置的默认输入法和用户上一次进行输入时所使用的输入法。若因为输入方式发生变化需要切换输入模式,用户一般需要手动切换,会影响用户体验。There are various ways for users to make input. For example, the user can directly touch the screen of the terminal device with a finger to realize input, and also can realize input through some input devices. It can be understood that if the input methods adopted by the user are different, the applicable input modes may be different. That is, the specific input methods applicable to different input methods may be different. For example, finger touch input may be suitable for keyboard input mode, that is, Quanpin input method, Wubi input method and other input methods that need to use a keyboard, and stylus input may be suitable for handwriting input mode, that is, handwriting input method. However, no matter what input method the user adopts, the default input mode is first displayed on the input interface. It can be understood that the default input mode mentioned here may include the default input method set by the user and the input method used by the user when inputting last time. If the input mode needs to be switched due to the change of the input mode, the user generally needs to switch manually, which will affect the user experience.
本申请提供了一种输入法调用方法及相关设备。根据该输入法调用方法,电子设备可以在输入法应用启动时触发输入设备监听,并在输入法应用接收到监听回调信息后,根据该监听回调信息中包括的输入设备类型来确定需要调用的输入法。根据这种方法,电子设备可以根据输入方式和输入设备来适应性提供更合理的输入法,无需用户手动切换输入法,提升了用户体验。The application provides an input method calling method and related equipment. According to the input method calling method, the electronic device can trigger input device monitoring when the input method application is started, and after the input method application receives the monitoring callback information, determine the input device type to be called according to the input device type included in the monitoring callback information Law. According to this method, the electronic device can adaptively provide a more reasonable input method according to the input method and the input device, without requiring the user to manually switch the input method, thereby improving user experience.
可理解,本申请中所提及的调用的输入法指的是具体的输入法。例如,手写输入法、全拼输入法、笔画输入法等。It can be understood that the invoked input method mentioned in this application refers to a specific input method. For example, handwriting input method, Quanpin input method, stroke input method, etc.
首先结合图1对本申请实施例提供的输入法调用场景进行简单说明。Firstly, a brief description of the input method invocation scenario provided by the embodiment of the present application will be given with reference to FIG. 1 .
请参阅图1,图1为本申请实施例提供的一种输入法调用场景的示意图。如图1所示,用户可以采取多种输入方式在电子设备100中进行输入。该多种输入方式可以包括但不限于手指触摸输入方式和利用其他外部输入设备进行输入的输入方式。可理解,这里所提及的外部输入设备指的是独立于电子设备100的输入设备。Please refer to FIG. 1 . FIG. 1 is a schematic diagram of an input method calling scenario provided by an embodiment of the present application. As shown in FIG. 1 , the user may input in the electronic device 100 in various input ways. The multiple input methods may include but not limited to a finger touch input method and an input method using other external input devices for input. It can be understood that the external input device mentioned here refers to an input device independent of the electronic device 100 .
可理解,本申请中所提及的手指触摸输入方式具体为用户通过手指与电子设备100的触摸屏相接触来实现输入。与手指触摸输入方式类似,用户还可以通过其他人体皮肤与电子设备100的触摸屏相接触来进行输入。It can be understood that the finger touch input method mentioned in this application specifically means that the user implements input by touching the touch screen of the electronic device 100 with a finger. Similar to the way of finger touch input, the user can also make input by contacting other human skin with the touch screen of the electronic device 100 .
可理解,输入设备为独立于电子设备100存在的外部设备。输入设备可以包括但不限于键盘、手写笔、鼠标等。It can be understood that the input device is an external device independent of the electronic device 100 . Input devices may include, but are not limited to, keyboards, stylus, mice, and the like.
具体地,在用户采取手指触摸输入方式在电子设备100中进行输入的情况下,作用在电子设备100的输入区域上的手指触摸操作可以触发手指触摸事件。电子设备100接收该手指触摸事件后可以确定在该输入区域进行输入时所采取的输入法。在用户利用输入设备在电子设备100中进行输入的情况下,作用在电子设备100的输入区域上用户操作可以触发输入事件。电子设备100接收该输入事件后可以确定该输入事件类型以及相应的输入设备类型,并基于该输入事件类型和该输入设备类型确定在该输入区域进行输入时所采取的输入法。Specifically, in the case that the user performs input in the electronic device 100 by finger touch input, the finger touch operation acting on the input area of the electronic device 100 may trigger a finger touch event. After receiving the finger touch event, the electronic device 100 may determine the input method adopted when inputting in the input area. When a user uses an input device to perform input in the electronic device 100 , the user's operation acting on the input area of the electronic device 100 may trigger an input event. After receiving the input event, the electronic device 100 may determine the type of the input event and the type of the corresponding input device, and based on the type of the input event and the type of the input device, determine the input method adopted when inputting in the input area.
示例性的,用户可以将手写笔与电子设备100的触摸屏相接触,作用在电子设备100的输入区域的手写笔触控操作可以触发手写笔触控事件。电子设备100接收该手写笔触控事件后可以确定在该输入区域进行输入时采取手写输入法。Exemplarily, the user may touch the stylus to the touch screen of the electronic device 100, and the touch operation of the stylus acting on the input area of the electronic device 100 may trigger a touch event of the stylus. After receiving the stylus touch event, the electronic device 100 may determine to adopt a handwriting input method when performing input in the input area.
需要说明的是,在利用输入设备进行输入之前,输入设备与电子设备100之间可以建立通信连接。可理解,输入设备与电子设备100之间的通信连接方式可以包括有线通信方 式和无线通信方式。其中,无线通信方式可以包括蓝牙等通信方式。It should be noted that before using the input device to perform input, a communication connection may be established between the input device and the electronic device 100 . It can be understood that the communication connection mode between the input device and the electronic device 100 may include a wired communication mode and a wireless communication mode. Wherein, the wireless communication method may include communication methods such as Bluetooth.
下面具体介绍本申请实施例提供的一些输入场景。The following specifically introduces some input scenarios provided by the embodiments of the present application.
可理解,本申请的说明书和权利要求书及附图中的术语“界面”和“用户界面”,是应用程序或操作系统与用户之间进行交互和信息交换的介质接口,它实现信息的内部形式与用户可以接受形式之间的转换。用户界面常用的表现形式是图形用户界面(graphic user interface,GUI),是指采用图形方式显示的与计算机操作相关的用户界面。它可以是在电子设备的显示屏中显示的一个图标、窗口、控件等界面元素,其中控件可以包括图标、按钮、菜单、选项卡、文本框、对话框、状态栏、导航栏、Widget等可视的界面元素。It can be understood that the terms "interface" and "user interface" in the specification, claims and drawings of this application are media interfaces for interaction and information exchange between application programs or operating systems and users. Transformation between forms and forms acceptable to users. The commonly used form of user interface is the graphical user interface (graphic user interface, GUI), which refers to the user interface related to computer operation displayed in a graphical way. It can be an icon, window, control and other interface elements displayed on the display screen of the electronic device, where the control can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. visual interface elements.
1、进入输入界面(图2A)1. Enter the input interface (Figure 2A)
请参阅图2A,图2A为本申请实施例提供的一种用户界面的示意图。Please refer to FIG. 2A . FIG. 2A is a schematic diagram of a user interface provided by an embodiment of the present application.
如图2A所示,用户界面210显示了一个放置有应用图标的页面。该页面可包括多个应用图标(例如,天气应用图标、日历应用图标、电子邮件应用图标、设置应用图标211、应用商店应用图标、便签应用图标、相册应用图标、录音机应用图标等等)。上述多个应用图标下方还可显示有页面指示符,以表明当前显示的页面与其他页面的位置关系。页面指示符的下方有多个托盘图标(例如,拨号应用图标、信息应用图标、浏览器应用图标212、相机应用图标)。其中,浏览器应用图标212为浏览器应用的图标。浏览器是用来检索、展示以及传递Web信息资源的应用程序。可理解,托盘图标在页面切换时保持显示。As shown in FIG. 2A, the user interface 210 displays a page on which application icons are placed. The page may include multiple application icons (eg, a weather application icon, a calendar application icon, an email application icon, a settings application icon 211 , an application store application icon, a notes application icon, a photo album application icon, a voice recorder application icon, etc.). A page indicator may also be displayed below the plurality of application icons to indicate the positional relationship between the currently displayed page and other pages. Below the page indicator are a number of tray icons (eg, dialer application icon, messaging application icon, browser application icon 212, camera application icon). Wherein, the browser application icon 212 is an icon of a browser application. A browser is an application program used to retrieve, display and deliver web information resources. Understandably, the tray icon remains displayed when the page is switched.
可理解,上述应用图标的表现形式和名称仅为示例,不应视为对本申请的限制。另外,用户界面210上还可以显示其他内容,本申请对此不作限制。It can be understood that the expression forms and names of the above application icons are only examples, and should not be regarded as limitations on the present application. In addition, other content may also be displayed on the user interface 210, which is not limited in this application.
电子设备100可以检测到作用于浏览器应用图标212上的用户操作,响应于该用户操作,电子设备100可以显示用户界面220(如图2B和图2C所示)。用户界面220为浏览器主界面。该界面也为浏览器搜索界面。也就是说,用户可以在该界面的相应区域进行输入,从而实现搜索,因此,用户界面220也可以理解为输入界面。用户界面220可以包括编辑框221。编辑框221可以用于输入,从而通过浏览器进行搜索。The electronic device 100 may detect a user operation on the browser application icon 212, and in response to the user operation, the electronic device 100 may display a user interface 220 (as shown in FIGS. 2B and 2C ). The user interface 220 is the main interface of the browser. This interface is also a browser search interface. That is to say, the user can perform input in the corresponding area of the interface to realize searching. Therefore, the user interface 220 can also be understood as an input interface. User interface 220 may include edit box 221 . The edit box 221 can be used for input to search through the browser.
可理解,用户操作可以包括但不限于触摸操作、按键操作、手势操作和语音操作等,本申请对此不作限制。It can be understood that user operations may include, but are not limited to, touch operations, key operations, gesture operations, and voice operations, which are not limited in this application.
2、调用及切换输入法(图2B~图2H)2. Calling and switching input methods (Figure 2B ~ Figure 2H)
如图2B所示,用户可以点击用户界面220所包括的编辑框221。相应的,电子设备100可以检测到作用于编辑框221上的手指触控操作,从而产生手指触控事件。可理解,手指触控事件可以被电子设备100的内核层中的输入子系统采集并传递到设备节点。进一步的,输入读取器可以读取该手指触控事件,然后由输入分发器将该手指触控事件上报给输入管理服务。输入管理服务可以将该手指触控事件传递至窗口管理服务,窗口管理服务配合输入管理服务将该手指触控事件分配给浏览器应用。这也就意味着,浏览器应用获取了焦点。通俗来说,浏览器应用可以得知用户需要输入的区域为编辑框221,并确定编辑框221为当前光标被激活的位置。在这种情况下,浏览器应用可以向输入法管理服务通知自己获得 焦点并请求绑定输入法。输入法管理服务再通知输入法应用调用输入法,并将调用的输入法显示到浏览器应用获取焦点的界面上。As shown in FIG. 2B , the user may click on an edit box 221 included in the user interface 220 . Correspondingly, the electronic device 100 may detect a finger touch operation acting on the edit box 221, thereby generating a finger touch event. It can be understood that the finger touch event can be collected by the input subsystem in the kernel layer of the electronic device 100 and transmitted to the device node. Further, the input reader can read the finger touch event, and then the input distributor reports the finger touch event to the input management service. The input management service may transmit the finger touch event to the window management service, and the window management service cooperates with the input management service to distribute the finger touch event to the browser application. This also means that the browser application has gained focus. Generally speaking, the browser application can know that the area that the user needs to input is the edit box 221, and determine that the edit box 221 is the position where the cursor is currently activated. In this case, the browser application can notify the input method management service that it has got the focus and request to bind the input method. The input method management service then notifies the input method application to call the input method, and displays the called input method on the interface where the browser application gets the focus.
另一方面,输入管理服务接收输入分发器上报的手指触控事件之后,可以根据该手指触控事件确定输入设备为触摸屏,还可以确定用户的触发方式为手指触摸。输入管理服务可以将该手指触控事件所对应的输入设备类型发送给输入法管理服务。输入法管理服务再将该输入设备类型发送给输入法应用。输入法应用可以根据该输入设备类型确定需要调用的输入法为拼音输入法(软键盘)。On the other hand, after the input management service receives the finger touch event reported by the input distributor, it can determine that the input device is a touch screen according to the finger touch event, and can also determine that the user's trigger method is finger touch. The input management service may send the input device type corresponding to the finger touch event to the input method management service. The input method management service then sends the input device type to the input method application. The input method application may determine that the input method to be invoked is the pinyin input method (soft keyboard) according to the type of the input device.
需要说明的是,浏览器应用可以确定该应用程序中获取焦点的界面为用户界面220。在浏览器应用向输入法管理服务请求绑定输入法之后,还可以通过输入法管理服务请求显示输入法。It should be noted that the browser application may determine that the focused interface in the application program is the user interface 220 . After the browser application requests the input method management service to bind the input method, it can also request to display the input method through the input method management service.
可理解,输入法应用可以向输入法管理服务请求注册监听输入设备。输入法应用向输入法管理服务请求注册监听输入设备可能发生在用户点击用户界面220所包括的编辑框221之前或之后。It can be understood that the input method application may request the input method management service to register the monitoring input device. The request of the input method application to the input method management service to register the monitoring input device may occur before or after the user clicks the edit box 221 included in the user interface 220 .
根据上述过程则有:响应于用户作用在编辑框221上的手指触控操作,电子设备100可以显示图2C所示的用户界面230。用户界面230包括编辑框231和输入区域232。相较于用户界面220所包括的编辑框221,编辑框231中显示有光标,这说明浏览器应用已获取焦点。输入区域232显示有拼音全键软键盘,以供用户进行输入。According to the above process, the electronic device 100 may display the user interface 230 shown in FIG. 2C in response to the user's finger touch operation on the edit box 221 . The user interface 230 includes an edit box 231 and an input area 232 . Compared with the edit box 221 included in the user interface 220, a cursor is displayed in the edit box 231, which indicates that the browser application has acquired the focus. The input area 232 displays a pinyin full-key soft keyboard for the user to input.
如图2D所示,用户可以用手写笔点击用户界面220所包括的编辑框221。相应的,电子设备100可以检测到作用于编辑框221上的手写笔触控操作,从而产生手写笔触控事件。手写笔触控事件的传递过程可参考上文所述的手指触控事件的传递过程。与手指触控事件的传递过程相区别的是,输入管理服务接收输入分发器上报的手写笔触控事件之后,可以根据该手写笔触控事件确定输入设备为触摸屏,还可以确定用户的触发方式为手写笔触控。输入管理服务可以将该手写笔触控事件所对应的输入设备类型发送给输入法管理服务。输入法管理服务再将该输入设备类型发送给输入法应用。输入法应用可以根据该输入设备类型确定需要调用的输入法为手写输入法。As shown in FIG. 2D , the user may use a stylus to click on an edit box 221 included in the user interface 220 . Correspondingly, the electronic device 100 may detect a stylus touch operation acting on the edit box 221, thereby generating a stylus touch event. For the transfer process of the stylus touch event, refer to the transfer process of the finger touch event described above. The difference from the transfer process of finger touch events is that after the input management service receives the stylus touch event reported by the input distributor, it can determine the input device as a touch screen according to the stylus touch event, and can also determine that the user’s trigger method is handwriting pen touch. The input management service may send the input device type corresponding to the stylus touch event to the input method management service. The input method management service then sends the input device type to the input method application. The input method application may determine that the input method to be invoked is the handwriting input method according to the type of the input device.
可理解,响应于作用在编辑框221上的手写笔触控操作,电子设备100可以显示图2E所示的用户界面240。用户界面240包括编辑框241和输入区域242。相较于用户界面220所包括的编辑框221,编辑框241中显示有光标,这说明浏览器应用已获取焦点。输入区域242显示有手写区域,以供用户进行输入。It can be understood that, in response to the stylus touch operation acting on the edit box 221 , the electronic device 100 may display the user interface 240 shown in FIG. 2E . The user interface 240 includes an edit box 241 and an input area 242 . Compared with the edit box 221 included in the user interface 220, a cursor is displayed in the edit box 241, which indicates that the browser application has acquired the focus. The input area 242 displays a handwriting area for the user to input.
需要说明的是,浏览器应用获取焦点之后,用户进行输入的输入设备可能会发生变化。It should be noted that after the browser application gets the focus, the input device used by the user for input may change.
在本申请的一些实施例中,电子设备100显示图2C所示的用户界面230的情况下,用户可以敲击键盘(例如,敲击键盘上的“shift”键等),从而触发键盘事件。键盘事件的传递过程可参考上文所述的手指触控事件和手写笔触控事件的传递过程。与这两种传递过程不同的是,输入管理服务接收输入分发器上报的键盘事件之后,可以根据该键盘事件确定输入设备为键盘。输入管理服务可以将该键盘事件所对应的输入设备类型发送给输入法管理服务。输入法管理服务再将该输入设备类型发送给输入法应用。输入法应用可以根据该 输入设备类型确定需要调用的输入法为拼音输入法(悬浮模式)。In some embodiments of the present application, when the electronic device 100 displays the user interface 230 shown in FIG. 2C , the user may tap a keyboard (for example, tap the "shift" key on the keyboard, etc.), thereby triggering a keyboard event. For the transmission process of the keyboard event, refer to the transmission process of the finger touch event and the stylus touch event described above. Different from these two transfer processes, after receiving the keyboard event reported by the input distributor, the input management service can determine the input device as a keyboard according to the keyboard event. The input management service may send the input device type corresponding to the keyboard event to the input method management service. The input method management service then sends the input device type to the input method application. The input method application can determine that the input method to be invoked is the pinyin input method (floating mode) according to the type of the input device.
可理解,响应于作用在键盘上的用户操作,电子设备100可以显示图2F所示的用户界面250。用户界面250可以包括编辑框231和输入法悬浮工具栏251。用户通过键盘进行输入时,编辑框231可以显示用户的输入内容。It can be understood that, in response to user operations acting on the keyboard, the electronic device 100 may display the user interface 250 shown in FIG. 2F . The user interface 250 may include an edit box 231 and an input method floating toolbar 251 . When the user inputs through the keyboard, the edit box 231 can display the input content of the user.
可理解,用户敲击的键盘已与电子设备100建立通信连接(例如,蓝牙连接等)。It can be understood that the keyboard tapped by the user has established a communication connection (eg, Bluetooth connection, etc.) with the electronic device 100 .
还需要说明的是,用户进行输入的输入设备发生变化的情况下,电子设备100可以根据输入设备类型来切换输入法。It should also be noted that, when the input device used by the user changes, the electronic device 100 may switch the input method according to the type of the input device.
在本申请的一些实施例中,如图2G所示,用户先是采取手指触控操作进行输入,然后再通过手写笔进行输入。相应的,电子设备100可以检测到作用于编辑框231上的手写笔触控操作,从而产生手写笔触控事件。手写笔触控事件的传递过程可参考上文所述的手指触控事件的传递过程。与手指触控事件的传递过程相区别的是,输入管理服务接收输入分发器上报的手写笔触控事件之后,可以根据该手写笔触控事件确定输入设备为触摸屏,还可以确定用户的触发方式为手写笔触控。输入管理服务可以将该手写笔触控事件所对应的输入设备类型发送给输入法管理服务。输入法管理服务再将该输入设备类型发送给输入法应用。输入法应用可以根据该输入设备类型确定需要调用的输入法为手写输入法,并由原来调用的拼音输入法切换为手写输入法。In some embodiments of the present application, as shown in FIG. 2G , the user first uses a finger touch operation for input, and then uses a stylus for input. Correspondingly, the electronic device 100 may detect a stylus touch operation acting on the edit box 231, thereby generating a stylus touch event. For the transfer process of the stylus touch event, refer to the transfer process of the finger touch event described above. The difference from the transfer process of finger touch events is that after the input management service receives the stylus touch event reported by the input distributor, it can determine the input device as a touch screen according to the stylus touch event, and can also determine that the user’s trigger method is handwriting pen touch. The input management service may send the input device type corresponding to the stylus touch event to the input method management service. The input method management service then sends the input device type to the input method application. The input method application may determine that the input method to be invoked is the handwriting input method according to the type of the input device, and switch from the originally invoked Pinyin input method to the handwriting input method.
可理解,在浏览器应用已获取焦点的情况下,用户通过手写笔进行的输入操作可以作用在电子设备100的触摸屏上的任意位置(不一定需要作用在编辑框231上)。It can be understood that, when the browser application has acquired the focus, the input operation performed by the user through the stylus can act on any position on the touch screen of the electronic device 100 (not necessarily on the edit box 231 ).
可理解,响应于作用在电子设备100的触摸屏上的手写笔触控操作,电子设备100可以显示图2H所示的用户界面260。用户界面260可以包括编辑框231、手写输入区域261和输入工具区域262。用户可以通过手写笔在手写输入区域261上进行输入,相应的,编辑框231可以显示用户的输入内容。另外,用户还可以通过输入工具区域262来确定输入内容、搜索内容、输入区域的大小,以及手动切换输入法。It can be understood that, in response to a stylus touch operation on the touch screen of the electronic device 100, the electronic device 100 may display the user interface 260 shown in FIG. 2H. The user interface 260 may include an edit box 231 , a handwriting input area 261 and an input tool area 262 . The user can input on the handwriting input area 261 with a stylus, and correspondingly, the edit box 231 can display the input content of the user. In addition, the user can also determine input content, search content, size of the input area, and manually switch input methods through the input tool area 262 .
需要说明的是,对于其他包括编辑控件(例如,编辑框等)的应用,也可以实现上述输入法调用方法。另外,上述输入法调用及切换过程仅为概述,并未展开说明,其具体描述可参考下文。It should be noted that, for other applications including edit controls (for example, edit boxes, etc.), the above input method calling method can also be implemented. In addition, the above-mentioned input method calling and switching process is only an overview, and no explanation is given. For the specific description, please refer to the following.
3、设置输入法与输入设备之间的对应关系(图2I~图2K)3. Set the corresponding relationship between the input method and the input device (Fig. 2I-Fig. 2K)
电子设备100可以检测到作用于设置应用图标211上的用户操作,响应于该用户操作,电子设备100可以显示图2I所示的用户界面270。用户界面270可以包括控件271。控件271用于开启输入法设置界面。The electronic device 100 may detect a user operation acting on the setting application icon 211, and in response to the user operation, the electronic device 100 may display the user interface 270 shown in FIG. 2I. User interface 270 may include controls 271 . The control 271 is used to open the input method setting interface.
电子设备100可以检测到作用于控件271的用户操作,响应于该用户操作,电子设备100可以显示图2J所示的用户界面280。用户界面280为输入法设置界面。用户界面280可以包括若干输入法设置项。如图2J所示,用户界面280可以包括控件281、控件282和控件283。其中,控件281用于设置默认输入法应用。若电子设备100中存在多种输入法应用,用户可以通过控件281来设置进行输入时默认启动的输入法应用。控件282用于设 置安全输入模式。在安全输入模式下,用户输入密码时,需要启动安全输入键盘。控件283用于开启智能调用输入法界面。可理解,智能调用输入法指的是根据输入设备类型来调用具体的输入法。The electronic device 100 may detect a user operation on the control 271, and in response to the user operation, the electronic device 100 may display the user interface 280 shown in FIG. 2J. The user interface 280 is an input method setting interface. The user interface 280 may include several input method setting items. As shown in FIG. 2J , user interface 280 may include controls 281 , 282 , and 283 . Wherein, the control 281 is used to set a default input method application. If there are multiple input method applications in the electronic device 100 , the user can use the control 281 to set the input method application to be started by default when inputting. Control 282 is used to set the safe input mode. In the secure input mode, when the user enters the password, the secure input keyboard needs to be activated. The control 283 is used to open the smart call input method interface. It can be understood that calling an input method intelligently refers to calling a specific input method according to the type of the input device.
电子设备100可以检测到作用于控件283的用户操作,响应于该用户操作,电子设备100可以显示如图2K所示的用户界面290。用户界面290为智能调用输入法界面。智能调用输入法界面可以包括若干智能调用输入法设置项。如图2K所示,用户界面290可以包括控件291和显示区域292。其中,控件291用于开启智能调用输入法。显示区域292为输入设备类型与输入法的对应关系的设置区域。显示区域292可以包括控件2921和个性化设置区域2922。控件2921用于将输入设备类型与输入法的对应关系设置为默认对应关系。可理解,默认对应关系为技术人员预先设置的对应关系。个性化设置区域2922用于根据用户需求个性化设置输入设备类型与输入法的对应关系。个性化设置区域2922可以包括显示区域29221和控件29222。显示区域29221可以包括若干控件。这些控件可用于管理用户设置的输入设备类型与输入法的对应关系。如图2K所示,显示区域29221可以包括对触摸屏-手指、触摸屏-手写笔和键盘这三种输入设备所对应的输入法进行管理的控件。根据图2K所示的显示区域29221,触摸屏-手指对应的输入法为拼音输入法(全拼软键盘),触摸屏-手写笔对应的输入法为手写输入法,键盘对应的输入法为拼音输入法(悬浮模式)。控件29222用于添加新的输入设备类型与输入法的对应关系。The electronic device 100 may detect a user operation on the control 283, and in response to the user operation, the electronic device 100 may display a user interface 290 as shown in FIG. 2K. The user interface 290 is a smart call input method interface. The smart call input method interface may include several smart call input method setting items. As shown in FIG. 2K , user interface 290 may include controls 291 and display area 292 . Wherein, the control 291 is used to enable the smart call input method. The display area 292 is an area for setting correspondence between input device types and input methods. The display area 292 may include controls 2921 and a personalized setting area 2922 . The control 2921 is used to set the corresponding relationship between the input device type and the input method as the default corresponding relationship. It can be understood that the default correspondence is a correspondence preset by a technician. The personalization setting area 2922 is used to personalize the corresponding relationship between input device types and input methods according to user requirements. The personalized setting area 2922 may include a display area 29221 and controls 29222 . Display area 29221 may include several controls. These controls can be used to manage the corresponding relationship between the input device type and the input method set by the user. As shown in FIG. 2K , the display area 29221 may include controls for managing the input methods corresponding to the three input devices: touch screen-finger, touch screen-stylus and keyboard. According to the display area 29221 shown in Figure 2K, the input method corresponding to the touch screen-finger is the pinyin input method (full spell soft keyboard), the input method corresponding to the touch screen-stylus is the handwriting input method, and the input method corresponding to the keyboard is the pinyin input method (floating mode). Control 29222 is used to add a new corresponding relationship between input device type and input method.
需要说明的是,上述实施例中所描述的用户界面仅为本申请提供的示例,这些用户界面还可以表现为其他形式,本申请对这些用户界面的具体形式和其包括的其他内容不作限制。It should be noted that the user interfaces described in the above embodiments are only examples provided by this application, and these user interfaces may also be in other forms, and this application does not limit the specific forms of these user interfaces and other contents included therein.
下面介绍本申请实施例涉及的装置。The devices involved in the embodiments of the present application are introduced below.
图3为本申请实施例提供的一种电子设备100的硬件结构示意图。FIG. 3 is a schematic diagram of a hardware structure of an electronic device 100 provided in an embodiment of the present application.
电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(Universal Serial Bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(Subscriber Identification Module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (Universal Serial Bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber Identification Module (Subscriber Identification Module, SIM) card interface 195 and so on. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, bone conduction sensor 180M, etc.
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
处理器110可以包括一个或多个处理单元。其中,不同的处理单元可以是独立的器件, 也可以集成在一个或多个处理器中。 Processor 110 may include one or more processing units. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
处理器110中还可以设置存储器,用于存储指令和数据。A memory may also be provided in the processor 110 for storing instructions and data.
在一些实施例中,处理器110可以包括一个或多个接口。In some embodiments, processor 110 may include one or more interfaces.
在本申请的一些实施例中,处理器110可以执行本方案中所提及的输入法调用方法。In some embodiments of the present application, the processor 110 may execute the input method calling method mentioned in this solution.
充电管理模块140用于从充电器接收充电输入。The charging management module 140 is configured to receive a charging input from a charger.
电源管理模块141用于连接电池142,充电管理模块140与处理器110。The power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be realized by the antenna 1 , the antenna 2 , the mobile communication module 150 , the wireless communication module 160 , a modem processor, a baseband processor, and the like.
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。调制解调处理器可以包括调制器和解调器。The mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the electronic device 100 . A modem processor may include a modulator and a demodulator.
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(Wireless Local Area Networks,WLAN)(如无线保真(Wireless Fidelity,Wi-Fi)网络),蓝牙(Bluetooth,BT),全球导航卫星系统(Global Navigation Satellite System,GNSS),调频(Frequency Modulation,FM),近距离无线通信技术(Near Field Communication,NFC),红外技术(Infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide wireless local area network (Wireless Local Area Networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) network), bluetooth (Bluetooth, BT), global navigation satellite System (Global Navigation Satellite System, GNSS), frequency modulation (Frequency Modulation, FM), near field communication technology (Near Field Communication, NFC), infrared technology (Infrared, IR) and other wireless communication solutions. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏194用于显示图像,视频等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现获取功能。The electronic device 100 may realize the acquisition function through an ISP, a camera 193 , a video codec, a GPU, a display screen 194 , and an application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像或视频。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used for processing the data fed back by the camera 193 . For example, when taking a picture, open the shutter, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image or video visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be located in the camera 193 .
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(Charge Coupled Device,CCD)或互补金属氧化物半导体(Complementary Metal-Oxide-Semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像或视频信号。ISP将数字图像或视频 信号输出到DSP加工处理。DSP将数字图像或视频信号转换成标准的RGB,YUV等格式的图像或视频信号。Camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects it to the photosensitive element. The photosensitive element can be a charge coupled device (Charge Coupled Device, CCD) or a complementary metal oxide semiconductor (Complementary Metal-Oxide-Semiconductor, CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP for conversion into a digital image or video signal. ISP outputs digital image or video signal to DSP for processing. DSP converts digital images or video signals into standard RGB, YUV and other formats of images or video signals.
数字信号处理器用于处理数字信号,除了可以处理数字图像或视频信号,还可以处理其他数字信号。Digital signal processors are used to process digital signals. In addition to digital image or video signals, they can also process other digital signals.
视频编解码器用于对数字视频压缩或解压缩。Video codecs are used to compress or decompress digital video.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the electronic device 100.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。The internal memory 121 may be used to store computer-executable program codes including instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 . The internal memory 121 may include an area for storing programs and an area for storing data.
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 can implement audio functions through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal.
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。Speaker 170A, also referred to as a "horn", is used to convert audio electrical signals into sound signals.
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。 Receiver 170B, also called "earpiece", is used to convert audio electrical signals into sound signals.
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。电子设备100可以设置至少一个麦克风170C。The microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. The electronic device 100 may be provided with at least one microphone 170C.
耳机接口170D用于连接有线耳机。The earphone interface 170D is used for connecting wired earphones.
传感器模块180可以包括1个或多个传感器,这些传感器可以为相同类型或不同类型。可理解,图1所示的传感器模块180仅为一种示例性的划分方式,还可能有其他划分方式,本申请对此不作限制。The sensor module 180 may include one or more sensors, which may be of the same type or of different types. It can be understood that the sensor module 180 shown in FIG. 1 is only an exemplary division manner, and there may be other division manners, which are not limited in the present application.
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。The pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal. In some embodiments, pressure sensor 180A may be disposed on display screen 194 . When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions.
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。The gyro sensor 180B can be used to determine the motion posture of the electronic device 100 .
气压传感器180C用于测量气压。The air pressure sensor 180C is used to measure air pressure.
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。The magnetic sensor 180D includes a Hall sensor. The electronic device 100 may use the magnetic sensor 180D to detect the opening and closing of the flip leather case.
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备100姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 180E can detect the acceleration of the electronic device 100 in various directions (generally three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to identify the posture of the electronic device 100, and can be applied to applications such as horizontal and vertical screen switching, pedometers, etc.
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。The distance sensor 180F is used to measure the distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F for distance measurement to achieve fast focusing.
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
环境光传感器180L用于感知环境光亮度。The ambient light sensor 180L is used for sensing ambient light brightness.
指纹传感器180H用于获取指纹。The fingerprint sensor 180H is used to acquire fingerprints.
温度传感器180J用于检测温度。The temperature sensor 180J is used to detect temperature.
触摸传感器180K,也称“触控面板”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器180K可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。触摸传感器180K还可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。Touch sensor 180K, also known as "touch panel". The touch sensor 180K is used to detect a touch operation on or near it. The touch sensor 180K may transmit the detected touch operation to the application processor to determine the touch event type. The touch sensor 180K can also provide visual output related to the touch operation through the display screen 194 . In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the position of the display screen 194 .
可理解,触摸传感器180K可以为触摸屏。在本申请的一些实施例中,触摸传感器180K可以设置于显示屏194上。It can be understood that the touch sensor 180K can be a touch screen. In some embodiments of the present application, the touch sensor 180K may be disposed on the display screen 194 .
在本申请的一些实施例中,触摸传感器180K可以为投射电容式触摸屏。In some embodiments of the present application, the touch sensor 180K may be a projected capacitive touch screen.
需要说明的是,本申请中所提及的电子设备100的触摸屏即为触摸传感器180K。It should be noted that the touch screen of the electronic device 100 mentioned in this application is the touch sensor 180K.
骨传导传感器180M可以获取振动信号。The bone conduction sensor 180M can acquire vibration signals.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The keys 190 include a power key, a volume key and the like. The key 190 may be a mechanical key. It can also be a touch button. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100 .
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。The motor 191 can generate a vibrating reminder. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
SIM卡接口195用于连接SIM卡。The SIM card interface 195 is used for connecting a SIM card.
图4为本申请实施例提供的一种电子设备100的软件结构示意图。FIG. 4 is a schematic diagram of a software structure of an electronic device 100 provided in an embodiment of the present application.
如图4所示,电子设备100的软件框架可以包括应用层、应用框架层、系统库、安卓运行时、硬件抽象层和内核层。As shown in FIG. 4 , the software framework of the electronic device 100 may include an application layer, an application framework layer, a system library, an Android runtime, a hardware abstraction layer and a kernel layer.
应用层可以包括一系列系统应用和第三方应用。可理解,这里所提及的系统应用指的是安卓平台随附的应用,而第三方指的是用户选择安装的应用。电子设备100可以包括输入法应用和第一应用。输入法应用为提供输入法服务的应用。第一应用为用户进行输入时获取焦点的应用。The application layer can include a series of system applications and third-party applications. It can be understood that the system application mentioned here refers to the application provided with the Android platform, and the third party refers to the application selected by the user to install. The electronic device 100 may include an input method application and a first application. An input method application is an application that provides input method services. The first application is an application that obtains focus when the user performs input.
可理解,焦点指的是电子设备100关注的区域,可以理解为当前光标被激活的位置。一般来说,电子设备100显示的界面上的某些区域是否作用和响应,取决于是否获取了焦点。例如,电子设备100显示的界面中包括一个文本框,一旦该文本框获得焦点,用户在键盘上敲进的字符就可以输入到该文本框中。It can be understood that the focus refers to the area that the electronic device 100 focuses on, and can be understood as the position where the cursor is currently activated. Generally speaking, whether certain areas on the interface displayed by the electronic device 100 function and respond depends on whether focus is acquired. For example, the interface displayed by the electronic device 100 includes a text box. Once the text box gets focus, the characters typed by the user on the keyboard can be input into the text box.
可理解,第一应用可以包括编辑控件。编辑控件可以给用户提供编辑输入功能,还可以向用户显示输入内容。编辑控件可以包括但不限于文本输入区域(比如上文提及的文本框)和手写区域等。It can be understood that the first application may include an editing control. The edit control can provide the user with editing input function, and can also display the input content to the user. Editing controls may include, but are not limited to, text input areas (such as the text box mentioned above), handwriting areas, and the like.
需要说明的是,输入法应用和第一应用可以为系统应用,也可以为第三方应用。也就是说,本申请中的输入法应用可以为安卓平台提供的输入法应用,也可以为用户后续下载安装所得的应用。It should be noted that the input method application and the first application may be system applications or third-party applications. That is to say, the input method application in this application may be an input method application provided by the Android platform, or may be an application downloaded and installed subsequently by the user.
应用框架层为应用层的应用程序提供应用编程接口和编程框架。应用框架层包括一些预先定义的函数。The application framework layer provides application programming interfaces and programming frameworks for applications in the application layer. The application framework layer includes some pre-defined functions.
如图4所示,应用框架层可以包括但不限于输入管理服务、输入法管理服务、窗口管理服务和蓝牙服务等。As shown in FIG. 4 , the application framework layer may include but not limited to input management service, input method management service, window management service, Bluetooth service and so on.
其中,输入管理服务的主要作用是对输入设备进行监听,并及时将输入设备产生的输入事件(例如,点击屏幕、按键、滑动等)传递至操作系统或者应用程序,然后由操作系统或者应用程序进行相应的处理。例如,用户触摸了一个应用程序中的一个activity的一个控件。输入管理服务可以将用户的触摸转化成一次触摸事件,并将其传递至该应用程序,再由该应用程序进行相应处理。Among them, the main function of the input management service is to monitor the input device, and timely transmit the input events generated by the input device (for example, click on the screen, button, slide, etc.) to the operating system or application program, and then the operating system or application program Treat accordingly. For example, the user touches a control in an activity in an application. The input management service can convert the user's touch into a touch event, and deliver it to the application program, and then the application program will process it accordingly.
需要说明的是,实际上,输入管理服务不仅涉及应用框架层,还涉及Native层。Native层相对于应用框架层来说处于更底层。应用框架层一般包括一些系统服务,而Native层一般包括一些本地服务和一些链接库等。比如,如果需要执行复杂运算,如果通过应用框架层去实现,那么效率可能会很低,但是若选择通过Native层去实现,然后和应用框架层通信(即安卓中所说的JNI机制),那么效率会大大提高。再比如,电子设备100运行时需要和底层的硬件驱动交互,这个过程也要通过Native层。It should be noted that, in fact, the input management service involves not only the application framework layer, but also the Native layer. The Native layer is at a lower level than the application framework layer. The application framework layer generally includes some system services, while the Native layer generally includes some local services and some link libraries. For example, if you need to perform complex operations, if you implement it through the application framework layer, the efficiency may be very low, but if you choose to implement it through the Native layer, and then communicate with the application framework layer (that is, the JNI mechanism in Android), then Efficiency will be greatly improved. For another example, when the electronic device 100 is running, it needs to interact with the underlying hardware driver, and this process also passes through the Native layer.
可理解,输入管理服务涉及应用框架层、JNI层和Native层。应用框架层的输入管理服务的主要工作是为读取策略(Reader Policy)和分发策略(Dispatcher Policy)提供实现方式,以及与其他系统服务(例如,窗口管理服务等)进行协作。本地输入管理器(NativeInputManager)位于JNI层,负责Native层的组件和应用框架层的输入管理服务的相互通信,同时,它为输入读取器(Input Reader)和输入分发器(Input Dispatcher)提供了策略请求的接口,策略请求被它转发给应用框架层的输入管理服务,由输入管理服务进行后续处理。输入管理器(Input Manager)是Input Reader和Input Dispatcher的运行容器,它创建了两个线程分别承载Input Reader和Input Dispatcher的运行。输入管理器中可以包括Input Reader、Input Dispatcher和EventHub。Input Reader的主要作用是读取事件。Input Dispatcher的主要作用是分发事件。EventHub的主要作用是利用Linux的inotify和epoll机制,监听设备事件。这里所提及的设备事件包括设备插拔以及各种触摸、按钮事件等。EventHub主要面向的是/dev/input目录下的设备节点。对于设备节点上的输入事件,可以通过EventHub的getEvents来进行监听和获取。It can be understood that the input management service involves the application framework layer, the JNI layer and the Native layer. The main job of the input management service in the application framework layer is to provide implementation methods for Reader Policy and Dispatcher Policy, and to cooperate with other system services (for example, window management services, etc.). The local input manager (NativeInputManager) is located in the JNI layer and is responsible for the mutual communication between the components of the Native layer and the input management service of the application framework layer. At the same time, it provides input readers (Input Reader) and input distributors (Input Dispatcher). The interface of the policy request, the policy request is forwarded to the input management service of the application framework layer, and the input management service performs subsequent processing. Input Manager (Input Manager) is the running container of Input Reader and Input Dispatcher. It creates two threads to host the operation of Input Reader and Input Dispatcher respectively. Input Manager can include Input Reader, Input Dispatcher and EventHub. The main function of Input Reader is to read events. The main function of Input Dispatcher is to distribute events. The main function of EventHub is to use Linux's inotify and epoll mechanisms to monitor device events. The device events mentioned here include device plugging and unplugging as well as various touch and button events, etc. EventHub is mainly for device nodes in the /dev/input directory. For the input event on the device node, it can be monitored and obtained through getEvents of EventHub.
输入法管理服务运行于系统进程,是一个系统级服务。输入法管理服务的主要作用是管理输入法、绑定输入法、管理客户端,以及和其他系统级服务交互。The input method management service runs in the system process and is a system-level service. The main role of the input method management service is to manage input methods, bind input methods, manage clients, and interact with other system-level services.
蓝牙服务用于提供电子设备100与相关外设之间的无线通信功能。这里所提及的相关外设可以包括无线耳机、平板电脑、笔记本电脑等。在本申请的一些实施例中,蓝牙服务可以用于建立电子设备100与输入设备之间的蓝牙连接。The Bluetooth service is used to provide a wireless communication function between the electronic device 100 and related peripherals. The relevant peripherals mentioned here may include wireless earphones, tablet computers, notebook computers, and the like. In some embodiments of the present application, the Bluetooth service can be used to establish a Bluetooth connection between the electronic device 100 and the input device.
窗口管理服务用于管理操作系统中的窗口。窗口管理服务可以与相应的客户端一起作用以实现窗口的创建、销毁、绘制、布局等功能。其中,客户端则负责与窗口管理服务交互,并对应用和其它服务提供窗口管理接口,包括提供窗口视图的添加、移出和更新等接 口函数。The window management service is used to manage windows in the operating system. The window management service can work with the corresponding client to realize functions such as creating, destroying, drawing, and laying out windows. Among them, the client is responsible for interacting with the window management service, and providing window management interfaces for applications and other services, including providing interface functions such as adding, removing and updating window views.
系统库和安卓运行时包含FWK所需要调用的功能函数,Android的核心库,以及Android虚拟机。系统库可以包括多个功能模块。例如:浏览器内核,三维(3dimensional,3D)图形,字体库等。The system library and the Android runtime include the functions that the FWK needs to call, the Android core library, and the Android virtual machine. A system library can include multiple function modules. For example: browser kernel, three-dimensional (3dimensional, 3D) graphics, font library, etc.
硬件抽象层是设备内核驱动的抽象接口,用于实现向更高级别的Java API框架提供访问底层设备的应用编程接口。HAL包含多个库模块,例如音频、蓝牙、相机、传感器等。其中每个库模块都为特定类型的硬件组件实现一个接口。当系统框架层API要求访问便携设备的硬件时,Android操作系统将为该硬件组件加载库模块。The hardware abstraction layer is an abstract interface driven by the device kernel, which is used to provide an application programming interface for accessing the underlying device to a higher-level Java API framework. HAL contains multiple library modules such as audio, bluetooth, camera, sensor, etc. Each of these library modules implements an interface for a specific type of hardware component. When the system framework layer API requires access to the hardware of the portable device, the Android operating system will load the library module for the hardware component.
内核层是Android操作系统的基础,Android操作系统最终的功能都是通过内核层完成。内核层可以包含摄像头驱动、音频驱动、蓝牙驱动、传感器驱动、显示驱动、触屏驱动和按键驱动等。例如,内核层与硬件抽象层之间的接口语言为硬件抽象层接口描述语言(HAL interface definition language,HIDL)。The kernel layer is the foundation of the Android operating system, and the final functions of the Android operating system are all completed through the kernel layer. The kernel layer can include camera driver, audio driver, Bluetooth driver, sensor driver, display driver, touch screen driver and button driver, etc. For example, the interface language between the kernel layer and the hardware abstraction layer is a hardware abstraction layer interface description language (HAL interface definition language, HIDL).
需要说明的是,本申请实施例提供的图4所示的电子设备100的软件框架示意图仅作为一种示例,并不限定安卓操作系统不同分层中的具体模块划分,具体可以参考常规技术中对安卓操作系统软件结构的介绍。另外,本申请实施例提供的电子设备100还可以采用其他操作系统。可理解,本申请实施例提供的一种输入法调用方法还可以基于其他操作系统实现,本申请不再一一举例。It should be noted that the schematic diagram of the software framework of the electronic device 100 shown in FIG. 4 provided in the embodiment of the present application is only used as an example, and does not limit the specific module division in different layers of the Android operating system. For details, refer to An introduction to the software architecture of the Android operating system. In addition, the electronic device 100 provided in the embodiment of the present application may also adopt other operating systems. It can be understood that the method for invoking an input method provided in the embodiment of the present application can also be implemented based on other operating systems, and this application does not give examples one by one.
下面介绍本申请实施例提供的输入法调用方法。The input method calling method provided by the embodiment of the present application is introduced below.
请参阅图5,图5为本申请实施例提供的一种调用及切换输入法的过程示意图。Please refer to FIG. 5 . FIG. 5 is a schematic diagram of a process of invoking and switching an input method provided by an embodiment of the present application.
如图5所示,用户可以利用输入设备进行输入,从而产生输入事件,输入事件相关的原始信息可以被内核层采集,传递至内核层中的设备节点。另外,内核层可以包括设备驱动。可理解,设备节点与输入设备相对应。设备驱动也与输入设备相对应。As shown in Figure 5, the user can use the input device to input, thereby generating an input event, and the original information related to the input event can be collected by the kernel layer and transmitted to the device node in the kernel layer. Additionally, the kernel layer may include device drivers. It can be understood that a device node corresponds to an input device. Device drivers also correspond to input devices.
接下来,输入事件可以经过内核层传递至应用框架层中的输入管理服务。在这个过程中,输入事件可以被输入读取器进行读取,再经过输入分发器上报至输入管理服务,进而传递给窗口管理服务。而窗口管理服务作为窗口的管理者,可以配合输入管理服务将输入事件分配给第一应用中包括编辑控件的窗口来进行处理。根据上文,第一应用为获取焦点的应用。也就是说,用户的输入操作针对的是第一应用中的编辑控件。可理解,第一应用可以向输入法管理服务请求调用输入法。输入法管理服务再根据第一应用调用输入法的请求来通知输入法应用调用输入法。Next, the input event can be delivered to the input management service in the application framework layer through the kernel layer. In this process, the input event can be read by the input reader, and then reported to the input management service through the input distributor, and then passed to the window management service. The window management service, as a window manager, may cooperate with the input management service to distribute the input event to the window including the edit control in the first application for processing. According to the above, the first application is an application that acquires focus. That is to say, the user's input operation is aimed at the edit control in the first application. It can be understood that the first application may request the input method management service to invoke the input method. The input method management service then notifies the input method application to invoke the input method according to the request of the first application to invoke the input method.
另一方面,输入法应用可以向输入法管理服务请求注册监听输入设备。输入法管理服务可以将该注册监听请求发送给输入管理服务。输入管理服务接收该注册监听请求之后,可以根据接收的输入事件的类型来确定输入设备类型。On the other hand, the input method application can request the input method management service to register the monitoring input device. The input method management service may send the registration monitoring request to the input management service. After receiving the registration monitoring request, the input management service may determine the type of the input device according to the type of the received input event.
在本申请的一些实施例中,输入管理服务接收的输入事件为接收该注册监听请求之后的第一个输入事件。在这种情况下,输入管理服务可以将输入设备类型发送给输入法管理服务。输入法管理服务再将监听回执信息发送给输入法应用。可理解,监听回执信息可以包括输入设备类型。输入法应用接收监听回执信息之后可以根据该信息中包括的输入设备 类型来确定需要调用的输入法,并调用该输入法。相应的,第一应用可以显示包括输入区域的界面。可理解,输入区域可以显示有调用的该输入法。In some embodiments of the present application, the input event received by the input management service is the first input event after receiving the registration monitoring request. In this case, the input management service can send the input device type to the input method management service. The input method management service then sends the monitoring receipt information to the input method application. It can be understood that the monitoring receipt information may include the input device type. After the input method application receives the monitoring receipt information, it can determine the input method to be called according to the input device type included in the information, and call the input method. Correspondingly, the first application can display an interface including an input area. It can be understood that the input area may display the called input method.
在本申请的一些实施例中,输入管理服务确定的输入设备类型不同于历史输入设备类型。在这种情况下,输入管理服务可以将输入设备类型发送给输入法管理服务。输入法管理服务再将监听回执信息发送给输入法应用。输入法应用接收监听回执信息之后可以根据该信息中包括的输入设备类型来确定需要调用的输入法,并将之前调用的输入法切换至该输入法。相应的,第一应用可以显示包括输入区域的界面。可理解,输入区域可以显示有切换后的输入法。In some embodiments of the present application, the input device type determined by the input management service is different from the historical input device type. In this case, the input management service can send the input device type to the input method management service. The input method management service then sends the monitoring receipt information to the input method application. After receiving the monitoring receipt information, the input method application can determine the input method to be called according to the input device type included in the information, and switch the previously called input method to the input method. Correspondingly, the first application can display an interface including an input area. It can be understood that the switched input method may be displayed in the input area.
可理解,历史输入设备类型为电子设备100上一次产生的输入事件所对应的输入设备的类型。值得注意的是,输入设备类型与输入法之间存在对应关系,后文中会详细叙述,在此不展开说明。It can be understood that the historical input device type is the type of the input device corresponding to the last input event generated by the electronic device 100 . It is worth noting that there is a corresponding relationship between the input device type and the input method, which will be described in detail later, and will not be explained here.
在本申请的一些实施例中,输入管理服务确定的输入设备类型与历史输入设备类型相同。在这种情况下,第一应用调用用户上一次触发输入事件时所使用的输入法。In some embodiments of the present application, the input device type determined by the input management service is the same as the historical input device type. In this case, the first application invokes the input method used when the user triggered the input event last time.
请参阅图6,图6为本申请实施例提供的一种输入法调用方法的流程图,该输入法调用方法可以应用于包括输入法应用、输入法管理服务、输入分发器、输入管理服务的电子设备100。比如图3、图4所示的电子设备100。该输入法调用方法可以包括但不限于以下步骤:Please refer to FIG. 6. FIG. 6 is a flowchart of an input method invocation method provided by an embodiment of the present application. The input method invocation method can be applied to applications including input method applications, input method management services, input distributors, and input management services. Electronic device 100. For example, the electronic device 100 shown in FIG. 3 and FIG. 4 . The input method calling method may include but not limited to the following steps:
S601:输入法应用向输入法管理服务发送注册监听请求。其中,注册监听请求用于对输入设备进行监听(注册监听请求为对输入设备进行监听的请求)。S601: The input method application sends a registration monitoring request to the input method management service. Wherein, the registration monitoring request is used to monitor the input device (the registration monitoring request is a request for monitoring the input device).
可理解,电子设备100中的输入法应用可以向输入法管理服务发送注册监听请求。该注册监听请求用于对输入设备进行监听。即电子设备100可以通过该注册监听请求来确定输入设备类型。It can be understood that the input method application in the electronic device 100 may send a registration monitoring request to the input method management service. The registration monitoring request is used to monitor the input device. That is, the electronic device 100 can determine the input device type through the registration monitoring request.
在本申请的一些实施例中,输入法应用可以通过自定义接口向输入法管理服务发送注册监听请求。可理解,该自定义接口为实现监听输入设备的接口。示例性的,该自定义接口可以为:InputMethodManager#registerInputDeviceChange。In some embodiments of the present application, the input method application may send a registration monitoring request to the input method management service through a custom interface. It can be understood that the custom interface is an interface for implementing monitoring of an input device. Exemplarily, the custom interface may be: InputMethodManager#registerInputDeviceChange.
需要说明的是,在执行步骤S601之前,电子设备100可以对输入法应用进行初始化处理。It should be noted that, before step S601 is performed, the electronic device 100 may perform initialization processing on the input method application.
在本申请的一些实施例中,响应于用户操作,电子设备100初次请求调用输入法,在这种情况下,电子设备100可以对输入法应用进行初始化处理。可理解,这里所提及的用户操作为针对于电子设备100中的输入区域进行的操作。例如,点击编辑框。另外,电子设备100初次请求调用输入法指的是电子设备100开启后第一次请求绑定输入法。In some embodiments of the present application, in response to a user operation, the electronic device 100 initially requests to invoke the input method, and in this case, the electronic device 100 may initialize the input method application. It can be understood that the user operations mentioned here are operations performed on the input area of the electronic device 100 . For example, click on the edit box. In addition, the initial request of the electronic device 100 to call the input method refers to the first request to bind the input method after the electronic device 100 is turned on.
在本申请的一些实施例中,电子设备100中的输入法应用初次启动时,电子设备100可以对输入法应用进行初始化处理。可理解,输入法应用初次启动指的是电子设备100开启后输入法应用的首次启动。值得注意的是,输入法应用可以在后台启动,在这种情况下,电子设备100上不会显示相应页面。示例性的,电子设备100成功开机后,输入法应用可以在后台启动,电子设备100可以对输入法应用进行初始化处理。In some embodiments of the present application, when the input method application in the electronic device 100 is started for the first time, the electronic device 100 may perform initialization processing on the input method application. It can be understood that the initial startup of the input method application refers to the first startup of the input method application after the electronic device 100 is turned on. It should be noted that the input method application can be started in the background, in this case, the corresponding page will not be displayed on the electronic device 100 . Exemplarily, after the electronic device 100 is successfully powered on, the input method application can be started in the background, and the electronic device 100 can initialize the input method application.
可理解,输入法应用向输入法管理服务发送注册监听请求之后,相应的,输入法管理 服务可以接收该注册监听请求。It can be understood that after the input method application sends a registration monitoring request to the input method management service, the input method management service can receive the registration monitoring request accordingly.
在本申请的一些实施例中,电子设备100可以包括多种输入法应用。若用户手动切换默认使用的输入法应用,切换后的输入法应用需要向输入法管理服务发送注册监听请求。也就是说,切换前的输入法应用发送的注册监听请求对于切换后的输入法应用来说是不适用的。In some embodiments of the present application, the electronic device 100 may include multiple input method applications. If the user manually switches the default input method application, the switched input method application needs to send a registration monitoring request to the input method management service. That is to say, the registration monitoring request sent by the input method application before switching is not applicable to the input method application after switching.
S602:输入法管理服务向输入管理服务发送第一消息。其中,第一消息用于提示输入管理服务确定输入事件所对应的输入设备类型,并向输入法管理服务返回输入设备类型。S602: The input method management service sends a first message to the input management service. Wherein, the first message is used to prompt the input management service to determine the input device type corresponding to the input event, and return the input device type to the input method management service.
输入法管理服务接收输入法应用发送的注册监听请求之后,可以向输入管理服务发送第一消息。该第一消息用于提示输入管理服务确定输入事件所对应的输入设备类型,并向输入法管理服务返回输入设备类型。After receiving the registration monitoring request sent by the input method application, the input method management service may send a first message to the input method management service. The first message is used to prompt the input management service to determine the input device type corresponding to the input event, and return the input device type to the input method management service.
可理解,输入法管理服务向输入管理服务发送第一消息之后,相应的,输入法管理服务可以接收该第一消息。It can be understood that after the input method management service sends the first message to the input method management service, the input method management service may receive the first message accordingly.
S603:输入法管理服务向输入法应用发送注册监听回执。S603: The input method management service sends a registration monitoring receipt to the input method application.
具体地,输入法管理服务接收注册监听请求后,可以向输入法应用发送注册监听回执。可理解,注册监听回执可以用于表明输入法管理服务已经成功接收输入法应用发送的注册监听请求。Specifically, after receiving the registration monitoring request, the input method management service may send a registration monitoring receipt to the input method application. It can be understood that the registration monitoring receipt can be used to indicate that the input method management service has successfully received the registration monitoring request sent by the input method application.
可理解,输入法管理服务向输入法应用发送注册监听回执之后,相应的,输入法应用可以接收该注册监听回执。It can be understood that after the input method management service sends the registration monitoring receipt to the input method application, the input method application can correspondingly receive the registration monitoring receipt.
S604:输入分发器向输入管理服务发送输入事件。其中,输入事件为电子设备100响应于针对输入设备的用户操作而生成的事件。S604: The input distributor sends an input event to the input management service. Wherein, an input event is an event generated by the electronic device 100 in response to a user operation on the input device.
具体地,用户可以利用输入设备在电子设备100上进行输入,从而产生各种类型的输入事件。例如,按键事件、触摸事件、鼠标事件等。这些输入事件产生的原始信息可以被内核层中的输入子系统采集,并上传至输入管理器,再由输入管理器中的输入分发器发送给输入管理服务。可理解,输入设备与电子设备100之间存在通信连接。它们之间的通信连接方式可以为有线通信连接,还可以为无线通信连接(例如,蓝牙连接等),本申请对此不作限制。Specifically, the user may use the input device to perform input on the electronic device 100, thereby generating various types of input events. For example, key events, touch events, mouse events, etc. The original information generated by these input events can be collected by the input subsystem in the kernel layer, uploaded to the input manager, and then sent to the input management service by the input distributor in the input manager. It can be understood that there is a communication connection between the input device and the electronic device 100 . The communication connection between them may be a wired communication connection, and may also be a wireless communication connection (for example, a Bluetooth connection, etc.), which is not limited in this application.
可理解,输入分发器向输入管理服务发送输入事件之后,相应的,输入管理服务可以接收该输入事件。It can be understood that after the input distributor sends the input event to the input management service, the input management service can receive the input event accordingly.
可理解,输入事件可以包括但不限于键盘事件、手写笔触控事件以及手指触控事件等。其中,键盘事件为用户敲击键盘上的按键所触发的输入事件。手写笔触控事件为用户利用手写笔触碰电子设备100的触摸屏所触发的输入事件。手指触控事件为用户通过手指触碰电子设备100的触摸屏所触发的输入事件。可理解,与手指触控事件类似,利用人体其他部位触碰电子设备100的触摸屏也可以触发产生输入事件。It can be understood that the input events may include but not limited to keyboard events, stylus touch events, and finger touch events. Wherein, the keyboard event is an input event triggered by the user pressing a key on the keyboard. The stylus touch event is an input event triggered by the user touching the touch screen of the electronic device 100 with a stylus. The finger touch event is an input event triggered by the user touching the touch screen of the electronic device 100 with a finger. It can be understood that, similar to the finger touch event, touching the touch screen of the electronic device 100 with other parts of the human body can also trigger the generation of an input event.
在本申请的一些实施例中,用户所执行的输入操作可以包括但不限于敲击键盘上的按键、通过手写笔或手指触碰电子设备100的触摸屏等。In some embodiments of the present application, the input operation performed by the user may include but not limited to tapping a key on a keyboard, touching a touch screen of the electronic device 100 with a stylus or a finger, and the like.
在本申请的一些实施例中,用户所执行的输入操作为焦点获取操作。可理解,这里所提及的焦点获取操作可以为针对电子设备100所显示的输入区域所进行的触发操作。其中,输入区域可以包括编辑框、手写区域等。示例性的,焦点获取操作可以为针对电子设备100所显示的编辑框的点击操作。In some embodiments of the present application, the input operation performed by the user is a focus acquisition operation. It can be understood that the focus acquisition operation mentioned here may be a trigger operation performed on the input area displayed on the electronic device 100 . Wherein, the input area may include an edit box, a handwriting area, and the like. Exemplarily, the focus acquisition operation may be a click operation on an edit box displayed on the electronic device 100 .
在本申请的一些实施例中,用户所执行的输入操作是在获取焦点之后的输入操作。例如,敲击键盘进行输入。再例如,利用手写笔在输入区域写字,从而实现输入。In some embodiments of the present application, the input operation performed by the user is an input operation after the focus is acquired. For example, typing on the keyboard. For another example, use a stylus to write in the input area, thereby realizing input.
S605:输入管理服务确定触发输入事件的输入设备类型。S605: The input management service determines the type of the input device that triggers the input event.
具体地,输入管理服务接收输入分发器发送的输入事件之后,可以确定该输入事件的来源,即确定触发该输入事件的输入设备类型。Specifically, after receiving the input event sent by the input distributor, the input management service may determine the source of the input event, that is, determine the type of the input device that triggered the input event.
需要说明的是,输入管理服务可以通过多种方式来确定触发输入事件的输入设备类型。It should be noted that the input management service may determine the type of the input device that triggers the input event in various ways.
在本申请的一些实施例中,输入管理服务可以根据输入事件的类型来确定该输入事件所对应的输入设备。具体地,输入管理服务可以获取输入事件类型与输入设备类型的对应关系,在接收输入分发器发送的输入事件之后,可以根据该输入事件的类型查找该输入事件对应的输入设备类型。可理解,输入事件类型与输入设备类型的对应关系可以存储在输入管理服务中,还可以存储在其他区域。输入管理服务可以对该对应关系进行调用。In some embodiments of the present application, the input management service may determine the input device corresponding to the input event according to the type of the input event. Specifically, the input management service can obtain the correspondence between the input event type and the input device type, and after receiving the input event sent by the input distributor, can search for the input device type corresponding to the input event according to the type of the input event. It can be understood that the corresponding relationship between input event types and input device types can be stored in the input management service, and can also be stored in other areas. The input management service can invoke the corresponding relationship.
如表1所示,表1表示了本申请实施例提供的一种示例性的输入事件类型与输入设备类型的对应关系。As shown in Table 1, Table 1 represents an exemplary correspondence between input event types and input device types provided in the embodiment of the present application.
表1Table 1
输入事件类型input event type 输入设备类型input device type
手指触控事件finger touch event 触摸屏-手指touch screen - finger
手写笔触控事件Stylus touch events 触摸屏-手写笔touch screen - stylus
键盘事件keyboard events 键盘keyboard
根据表1可得,输入事件类型为手指触控事件时,相应的输入设备类型为触摸屏-手指。输入事件类型为手写笔触控事件时,相应的输入设备为触摸屏-手写笔。输入事件类型为键盘事件时,相应的输入设备为键盘。可理解,表1仅为本申请实施例提供的示例,不应视为对本申请的限制。According to Table 1, when the input event type is a finger touch event, the corresponding input device type is touch screen-finger. When the input event type is a stylus touch event, the corresponding input device is a touch screen-stylus. When the input event type is a keyboard event, the corresponding input device is a keyboard. It can be understood that Table 1 is only an example provided by the embodiment of the present application, and should not be regarded as a limitation of the present application.
还需要说明的是,在实际输入过程中,对于相同的输入设备,由于用户的触发方式不同,电子设备100生成的输入事件可能有所差异。在这种情况下,这些输入事件所对应的输入设备类型可以根据用户的触发方式来进行区分。如表1所示的手指触控事件和手写笔触控事件,这两类输入事件本质上都是触摸事件,即通过触摸屏触发的输入事件。也就是说,这两类输入事件对应的输入设备类型为触摸屏。但是由于用户的触发方式不同,最终生成的输入事件有所差异。具体地,用户通过手指来触摸触摸屏,电子设备100可以生成手指触控事件。而用户通过手写笔来触碰触摸屏,电子设备100可以生成手写笔触控事件。对于这两类输入事件,可以根据用户的触发方式来区分其对应的输入设备类型。如表1所示,手指触控事件所对应的输入设备类型可以为触摸屏-手指,手写笔触控事件所对应的输入设备类型可以为触摸屏-手写笔。It should also be noted that, in an actual input process, for the same input device, input events generated by the electronic device 100 may be different due to different triggering methods by the user. In this case, the input device types corresponding to these input events can be distinguished according to the user's triggering manner. As shown in Table 1, the finger touch event and the stylus touch event, these two types of input events are essentially touch events, that is, input events triggered through the touch screen. That is to say, the input device type corresponding to these two types of input events is a touch screen. However, due to the different triggering methods of users, the final generated input events are different. Specifically, the user touches the touch screen with a finger, and the electronic device 100 may generate a finger touch event. While the user touches the touch screen with a stylus, the electronic device 100 may generate a stylus touch event. For these two types of input events, the corresponding input device types can be distinguished according to the user's trigger mode. As shown in Table 1, the input device type corresponding to the finger touch event may be touch screen-finger, and the input device type corresponding to the stylus touch event may be touch screen-stylus.
也就是说,本申请实施例可以对输入事件类型和输入设备类型进行更细致的划分,为后续输入法调用或切换进行准备,充分考虑到了用户的输入需求。That is to say, the embodiment of the present application can divide the input event type and the input device type in more detail to prepare for subsequent input method calling or switching, fully considering the user's input requirements.
可理解,在输入设备可用的情况下,电子设备100的Linux内核会在用户空间(User space)中创建对应的设备节点。输入事件产生之后,与输入事件相关的原始信息可以被内核层中的输入子系统采集。具体地,原始信息可以由内核层中的内核空间(Kernel space)的驱动层一直传递到用户空间中的设备节点。可理解,内核空间中的驱动层可以包括设备驱动。例如,触摸屏驱动、键盘驱动和鼠标驱动等。可理解,设备驱动与输入设备存在对应关系。It can be understood that, when the input device is available, the Linux kernel of the electronic device 100 will create a corresponding device node in the user space (User space). After the input event is generated, the original information related to the input event can be collected by the input subsystem in the kernel layer. Specifically, the original information can be transmitted from the driver layer of the kernel space (Kernel space) in the kernel layer to the device node in the user space. It can be understood that the driver layer in the kernel space may include device drivers. For example, touch screen driver, keyboard driver and mouse driver etc. It can be understood that there is a corresponding relationship between the device driver and the input device.
可理解,内核空间为Linux内核的运行空间,可以执行任意命令,以及调用系统的一切资源。用户空间为用户程序的运行空间,只能执行简单运算,不能直接调用系统资源,必须通过系统接口才能向内核发送指令。It can be understood that the kernel space is the running space of the Linux kernel, which can execute arbitrary commands and invoke all resources of the system. The user space is the running space of the user program. It can only perform simple calculations and cannot directly call system resources. It must send instructions to the kernel through the system interface.
在本申请的一些实施例中,输入管理服务可以监听用户空间中所有的设备节点,当设备节点有数据时会将数据进行加工处理并找到合适的窗口,将输入事件派发给它。可理解,输入管理服务可以确定接收的输入事件所对应的设备节点。根据上文,设备节点与输入设备之间存在对应关系。输入管理服务可以根据输入事件所对应的设备节点来确定输入设备类型。In some embodiments of the present application, the input management service can monitor all device nodes in the user space, process the data when the device node has data, find a suitable window, and dispatch input events to it. It can be understood that the input management service may determine the device node corresponding to the received input event. According to the above, there is a corresponding relationship between the device node and the input device. The input management service can determine the input device type according to the device node corresponding to the input event.
在本申请的一些实施例中,输入管理服务可以查找输入事件的传输路线,并确定该输入事件所对应的输入设备驱动,从而确定输入设备类型。In some embodiments of the present application, the input management service may search the transmission route of the input event, and determine the input device driver corresponding to the input event, thereby determining the input device type.
在本申请的一些实施例中,输入事件携带有输入设备信息,该输入设备信息可以用于表示输入设备。In some embodiments of the present application, the input event carries input device information, and the input device information may be used to represent the input device.
需要说明的是,输入管理服务可以通过不同方式确定触发不同类型输入事件的输入设备,上述方式仅为本申请给出的示例,还存在更多的方式,在此不一一举出。It should be noted that the input management service can determine input devices triggering different types of input events in different ways, the above-mentioned ways are only examples given in this application, and there are more ways, which will not be listed here.
S606:在输入设备类型不同于历史输入设备类型或者不存在历史输入设备类型的情况下,输入管理服务将输入设备类型发送给输入法管理服务。其中,历史输入设备类型为电子设备100上一次产生的输入事件所对应的输入设备的类型。S606: In the case that the input device type is different from the historical input device type or there is no historical input device type, the input management service sends the input device type to the input method management service. Wherein, the historical input device type is the type of the input device corresponding to the last input event generated by the electronic device 100 .
具体地,输入管理服务确定触发输入事件的输入设备类型后,在输入设备类型不同于历史输入设备类型或者不存在历史输入设备类型的情况下,输入管理服务可以将输入设备类型发送给输入法管理服务。可理解,历史输入设备类型为电子设备100上一次产生的输入事件所对应的输入设备的类型。本申请中所提及的输入设备类型不同于历史输入设备类型的情况为用户本次进行输入时所采取的输入设备不同于上一次进行输入时所采取的输入设备。本申请中所提及的不存在历史输入类型的情况为输入管理服务第一次接收用户利用输入设备进行输入所触发的输入事件。Specifically, after the input management service determines the input device type that triggers the input event, if the input device type is different from the historical input device type or there is no historical input device type, the input management service can send the input device type to the input method management Serve. It can be understood that the historical input device type is the type of the input device corresponding to the last input event generated by the electronic device 100 . The input device type mentioned in this application is different from the historical input device type because the input device used by the user when inputting this time is different from the input device used when inputting last time. The case where there is no historical input type mentioned in this application is that the input management service receives the input event triggered by the user's input using the input device for the first time.
在本申请的一些实施例中,电子设备100的输入管理服务确定触发输入事件的输入设备类型之后,可以将输入设备类型转换为满足接口规范的形式,再将该满足接口规范的输入设备类型发送给输入法管理服务。可理解,不同形式的输入设备类型之间存在对应关系。 该对应关系可以存储在输入管理服务中,还可以存储在其他区域。输入管理服务可以调用该对应关系。In some embodiments of the present application, after the input management service of the electronic device 100 determines the input device type that triggers the input event, it may convert the input device type into a form that meets the interface specification, and then send the input device type that meets the interface specification. Provide input method management services. It can be understood that there is a corresponding relationship between different forms of input device types. The corresponding relationship can be stored in the input management service, and can also be stored in other areas. The input management service may invoke this correspondence.
在本申请的一些实施例中,输入管理服务可以将输入设备类型所对应的码值发送给输入法管理服务。In some embodiments of the present application, the input management service may send the code value corresponding to the input device type to the input method management service.
如表2所示,表2为本申请实施例提供的满足接口规范的输入设备类型与其含义和码值。As shown in Table 2, Table 2 provides the types of input devices that meet the interface specifications and their meanings and code values provided by the embodiment of the present application.
表2Table 2
输入设备类型input device type 含义meaning 码值code value
STYLUSSTYLUS 手写笔stylus 0x000050020x00005002
FINGERFINGER 手指finger 0x000020020x00002002
KEYBOARDKEYBOARD 键盘keyboard 0x000001010x00000101
可理解,表2中的含义对应的是输入管理服务确定的触发输入事件的输入设备类型。输入管理服务确定触发输入事件的输入设备类型之后,在表2中查找内容相同的含义,从而确定满足接口规范的输入设备类型以及其对应的码值。示例性的,根据表2,输入管理服务确定触发输入事件的输入设备类型为触摸屏-手写笔之后,输入管理服务可以查找含义为手写笔所对应的输入设备类型——STYLUS。可理解,STYLUS表示的含义为输入设备类型是手写笔,且STYLUS满足接口规范的形式。相应的,输入管理服务可以确定STYLUS对应的码值为0x00005002。It can be understood that the meanings in Table 2 correspond to the types of input devices that trigger input events determined by the input management service. After the input management service determines the type of input device that triggers the input event, it looks up the meaning of the same content in Table 2, so as to determine the type of input device that meets the interface specification and its corresponding code value. Exemplarily, according to Table 2, after the input management service determines that the type of input device that triggers the input event is a touch screen-stylus, the input management service can search for the input device type corresponding to the stylus——STYLUS. It can be understood that the representation of STYLUS means that the input device type is a stylus, and the STYLUS satisfies the form of the interface specification. Correspondingly, the input management service can determine that the code value corresponding to STYLUS is 0x00005002.
可理解,输入管理服务将输入设备类型发送给输入法管理服务之后,相应的,输入法管理服务可以接收该输入设备类型。可理解,该输入设备类型可以满足接口规范。在本申请的一些实施例中,该输入设备类型可以为与输入设备类型相对应的码值。It can be understood that after the input management service sends the input device type to the input method management service, the input method management service can receive the input device type accordingly. It can be understood that the input device type can meet the interface specification. In some embodiments of the present application, the input device type may be a code value corresponding to the input device type.
S607:输入法管理服务向输入法应用发送监听回调信息。监听回调信息包括输入设备类型。S607: The input method management service sends monitoring callback information to the input method application. The listener callback information includes the input device type.
具体地,若输入设备类型不同于历史输入设备类型或不存在历史输入设备类型,输入管理服务向输入法管理服务发送输入设备类型,输入法管理服务接收输入设备类型之后,可以向输入法应用发送监听回调信息。可理解,监听回调信息可以包括输入设备类型。Specifically, if the input device type is different from the historical input device type or there is no historical input device type, the input management service sends the input device type to the input method management service. After the input method management service receives the input device type, it can send the input method application Listen for callback information. It can be understood that the monitoring callback information may include the type of the input device.
在本申请的一些实施例中,输入法管理服务可以通过自定义接口向输入法应用发送监听回调信息。可理解,该自定义接口为实现监听回调的接口。示例性的,该自定义接口可以为:InputMethodManager#InputDeviceListerner.deviceChange。可理解,该自定义接口所对应的参数为满足接口规范的输入设备类型。示例性的,该自定义接口所对应的参数为inputType。在本申请的一些实施例中,inputType对应的是表2所示的输入设备类型。In some embodiments of the present application, the input method management service may send monitoring callback information to the input method application through a custom interface. It can be understood that the custom interface is an interface for realizing the monitoring callback. Exemplarily, the custom interface may be: InputMethodManager#InputDeviceListerner.deviceChange. It can be understood that the parameter corresponding to the custom interface is an input device type meeting the interface specification. Exemplarily, the parameter corresponding to the custom interface is inputType. In some embodiments of the present application, inputType corresponds to the input device types shown in Table 2.
S608:输入法应用根据监听回调信息和输入法调用规则,确定输入法并调用该输入法进行输入。S608: The input method application determines the input method and calls the input method for input according to the monitoring callback information and the input method calling rule.
具体地,输入法应用根据监听回调信息中所包括的输入设备类型和输入法调用规则, 确定进行输入的输入法,并调用该输入法进行输入。可理解,输入法调用规则指的是输入设备类型与输入法之间存在的对应关系。输入法应用可以根据该对应关系以及输入设备类型来确定最终调用的输入法。Specifically, the input method application determines the input method for input according to the input device type and input method invocation rules included in the monitoring callback information, and invokes the input method for input. It can be understood that the input method calling rule refers to the corresponding relationship between the input device type and the input method. The input method application can determine the finally invoked input method according to the corresponding relationship and the type of the input device.
在本申请的一些实施例中,输入设备类型不同于历史输入设备类型,输入法应用可以根据监听会掉信息和输入法调用规则,来切换调用的输入法。In some embodiments of the present application, the input device type is different from the historical input device type, and the input method application can switch the invoked input method according to the listening information and the input method invocation rules.
如表3所示,表3为本申请实施例提供的一种示例性输入法调用规则。As shown in Table 3, Table 3 is an exemplary input method calling rule provided by the embodiment of the present application.
表3table 3
输入设备类型input device type 输入法Input
STYLUSSTYLUS 手写输入法handwriting input method
FINGERFINGER 拼音输入法(软键盘)Pinyin input method (soft keyboard)
KEYBOARDKEYBOARD 拼音输入法(悬浮模式)Pinyin input method (floating mode)
根据表3,若输入法应用接收的监听回调信息所包括的输入设备类型为STYLUS,输入法应用确定调用手写输入法来进行输入。类似的,若输入法应用接收的监听回调信息所包括的输入设备类型为FINGER,输入法应用确定调用拼音输入法(软键盘)来进行输入。若输入法应用接收的监听回调信息所包括的输入设备类型为KEYBOARD,输入法应用确定调用拼音输入法(悬浮模式)来进行输入。According to Table 3, if the input device type included in the monitoring callback information received by the input method application is STYLUS, the input method application determines to call the handwriting input method for input. Similarly, if the input device type included in the monitoring callback information received by the input method application is FINGER, the input method application determines to call the Pinyin input method (soft keyboard) for input. If the input device type included in the monitoring callback information received by the input method application is KEYBOARD, the input method application determines to call the Pinyin input method (floating mode) for input.
需要说明的是,输入设备类型所对应的输入法可以由技术人员预先设置,也可以由用户进行设置,本申请对此不作限制。可理解,表3所示的输入设备类型与输入法之间的对应关系仅为本申请提供的一个示例,该对应关系还可以存在其他形式,本申请对此不作限制。例如,输入设备类型为FINGER的情况下,对应的输入法可以为五笔输入法或笔画输入法等。It should be noted that the input method corresponding to the input device type can be preset by a technician, or can be set by a user, which is not limited in this application. It can be understood that the correspondence between input device types and input methods shown in Table 3 is only an example provided by the present application, and the correspondence may also exist in other forms, which is not limited by the present application. For example, when the input device type is FINGER, the corresponding input method may be Wubi input method or stroke input method.
可理解,输入法应用调用输入法时,电子设备100可以显示相应的输入界面。需要说明的是,输入法应用调用的输入法相同时,电子设备100显示的输入界面可能有所差异。It can be understood that when the input method application invokes the input method, the electronic device 100 may display a corresponding input interface. It should be noted that when the input method invoked by the input method application is the same, the input interface displayed by the electronic device 100 may be different.
示例性的,如表3所示,输入设备类型为FINGER的情况下,输入法应用可以确定调用拼音输入法(软键盘)来进行输入,电子设备100显示的输入界面中的输入区域可以包括软键盘。可理解,软键盘的形式可以为拼音全键软键盘(26键),还可以为拼音九键软键盘(9键)。软键盘的具体形式可以由技术人员预先设置默认形式,也可以由用户进行设置,本申请对此不作限制。Exemplarily, as shown in Table 3, when the input device type is FINGER, the input method application may determine to call the Pinyin input method (soft keyboard) for input, and the input area in the input interface displayed by the electronic device 100 may include the soft keyboard. keyboard. Understandably, the form of the soft keyboard may be a pinyin full-key soft keyboard (26 keys), or a pinyin nine-key soft keyboard (9 keys). The specific form of the soft keyboard can be preset by a technician as a default form, or can be set by a user, which is not limited in this application.
示例性的,如表3所示,输入设备类型为KEYBOARD的情况下,输入法应用可以确定调用拼音输入法(悬浮模式)进行输入,电子设备100显示的输入界面中的输入区域可以包括拼音输入法悬浮工具栏。可理解,该拼音输入法悬浮工具栏可以用于切换至其他输入法。Exemplarily, as shown in Table 3, when the input device type is KEYBOARD, the input method application may determine to call the Pinyin input method (floating mode) for input, and the input area in the input interface displayed by the electronic device 100 may include Pinyin input Method floating toolbar. It can be understood that the pinyin input method floating toolbar can be used to switch to other input methods.
需要说明的是,电子设备100调用输入设备类型所对应的输入法时所显示的输入界面可以有多种形式,该输入界面中的输入区域的内容可以由技术人员预先设置,也可以由用户进行设置。例如,输入设备类型为FINGER的情况下,电子设备100显示的输入界面中的输入区域的内容可以为拼音全键软键盘,也可以为拼音九键软键盘。再例如,输入设备 类型为KEYBOARD的情况下,电子设备100显示的输入界面中的输入区域的内容可以为拼音全键软键盘,也可以为拼音输入法悬浮工具栏。It should be noted that the input interface displayed when the electronic device 100 invokes the input method corresponding to the input device type can have various forms, and the content of the input area in the input interface can be preset by a technician, or can be set by the user. set up. For example, when the input device type is FINGER, the content of the input area in the input interface displayed by the electronic device 100 may be a pinyin full-key soft keyboard, or a pinyin nine-key soft keyboard. For another example, when the input device type is KEYBOARD, the content of the input area in the input interface displayed by the electronic device 100 may be a pinyin full-key soft keyboard, or a floating toolbar of a pinyin input method.
需要说明的是,在本申请的一些实施例中,用户利用输入设备在电子设备100中进行输入时,输入法不会向输入法管理服务发送注册监听请求。这是因为用户之前进行输入时,输入法已经向输入法管理服务发送了注册监听请求,所以用户后续再次进行输入时,输入法应用无需再向输入法管理服务发送注册监听请求。在这种情况下,电子设备100可以不执行步骤S601-步骤S603。It should be noted that, in some embodiments of the present application, when the user uses the input device to perform input in the electronic device 100, the input method will not send a registration monitoring request to the input method management service. This is because the input method has already sent a registration monitoring request to the input method management service when the user made an input before, so when the user inputs again later, the input method application does not need to send a registration monitoring request to the input method management service. In this case, the electronic device 100 may not perform step S601-step S603.
根据上述过程,电子设备100可以根据输入设备类型来适应性调用输入法或切换输入法,使得用户无需进行手动切换,提升了用户体验。According to the above process, the electronic device 100 can adaptively call the input method or switch the input method according to the type of the input device, so that the user does not need to switch manually, which improves the user experience.
请参阅图7,图7为本申请实施例提供的又一种输入法调用方法的流程图,该输入法调用方法可以包括但不限于以下步骤:Please refer to Fig. 7, Fig. 7 is a flow chart of another input method calling method provided by the embodiment of the present application, the input method calling method may include but not limited to the following steps:
S701:在第一时刻,响应于第一操作,电子设备100生成第一输入事件。其中,第一输入事件为针对第一输入设备所产生的输入事件。S701: At a first moment, in response to a first operation, the electronic device 100 generates a first input event. Wherein, the first input event is an input event generated for the first input device.
具体地,用户可以执行第一操作,相应的,在第一时刻,响应于第一操作,电子设备100可以生成第一输入事件。可理解,第一输入事件为针对第一输入设备所产生的输入事件。Specifically, the user may perform a first operation, and correspondingly, at a first moment, in response to the first operation, the electronic device 100 may generate a first input event. It can be understood that the first input event is an input event generated for the first input device.
可理解,第一输入设备可以包括但不限于键盘、手写笔等设备。在本申请的一些实施例中,第一输入设备还可以为触摸屏。It can be understood that the first input device may include but not limited to a keyboard, a stylus, and other devices. In some embodiments of the present application, the first input device may also be a touch screen.
可理解,第一输入事件可以包括但不限于键盘事件、手写笔触控事件以及手指触控事件等。其中,键盘事件为用户敲击键盘上的按键所触发的输入事件。手写笔触控事件为用户利用手写笔触碰电子设备100的触摸屏所触发的输入事件。手指触控事件为用户通过手指触碰电子设备100的触摸屏所触发的输入事件。可理解,与手指触控事件类似,利用人体其他部位触碰电子设备100的触摸屏所触发的输入事件也可以属于第一输入事件。It can be understood that the first input event may include but not limited to a keyboard event, a stylus touch event, a finger touch event, and the like. Wherein, the keyboard event is an input event triggered by the user pressing a key on the keyboard. The stylus touch event is an input event triggered by the user touching the touch screen of the electronic device 100 with a stylus. The finger touch event is an input event triggered by the user touching the touch screen of the electronic device 100 with a finger. It can be understood that, similar to a finger touch event, an input event triggered by touching the touch screen of the electronic device 100 with other parts of the human body may also belong to the first input event.
在本申请的一些实施例中,用户所执行的第一操作为利用第一输入设备进行输入的输入操作。可理解,这里所提及的输入操作可以包括但不限于敲击键盘上的按键、通过手写笔或手指触碰电子设备100的触摸屏等。In some embodiments of the present application, the first operation performed by the user is an input operation performed by using a first input device. It can be understood that the input operation mentioned here may include but not limited to tapping a key on a keyboard, touching a touch screen of the electronic device 100 with a stylus or a finger, and the like.
在本申请的一些实施例中,用户所执行的第一操作为焦点获取操作。可理解,这里所提及的焦点获取操作可以为针对电子设备100所显示的输入区域所进行的触发操作。其中,输入区域可以包括编辑框、手写区域等。示例性的,焦点获取操作可以为针对电子设备100所显示的编辑框的点击操作。In some embodiments of the present application, the first operation performed by the user is a focus acquisition operation. It can be understood that the focus acquisition operation mentioned here may be a trigger operation performed on the input area displayed on the electronic device 100 . Wherein, the input area may include an edit box, a handwriting area, and the like. Exemplarily, the focus acquisition operation may be a click operation on an edit box displayed on the electronic device 100 .
需要说明的是,在执行步骤S701之前,电子设备100可以注册监听输入设备,详细内容可以参考步骤S601,在此不再详细赘述。It should be noted that, before step S701 is performed, the electronic device 100 may register a monitoring input device, and for details, refer to step S601 , which will not be described in detail here.
另外,电子设备100注册监听输入设备之前,电子设备100中的输入法应用可以进行初始化,详细内容可以参考步骤S601,在此不再详细赘述。In addition, before the electronic device 100 registers to listen to the input device, the input method application in the electronic device 100 may be initialized. For details, please refer to step S601, which will not be described in detail here.
S702:电子设备100基于第一输入事件调用第一输入法,并显示第一界面。S702: The electronic device 100 invokes a first input method based on a first input event, and displays a first interface.
具体地,电子设备100生成第一输入事件之后,电子设备100可以确定第一输入事件的来源,即确定第一输入事件所对应的第一输入设备,并根据第一输入设备的设备类型调用第一输入法,然后显示第一界面。可理解,第一界面可以包括第一输入法显示区域。该第一输入法显示区域可以用于显示第一输入法。Specifically, after the electronic device 100 generates the first input event, the electronic device 100 may determine the source of the first input event, that is, determine the first input device corresponding to the first input event, and call the first input device according to the device type of the first input device. an input method, and then display the first interface. It can be understood that the first interface may include a first input method display area. The first input method display area can be used to display the first input method.
需要说明的是,电子设备100基于第一输入事件调用第一输入法的具体方式可参考上文,在此不再赘述。It should be noted that, the specific manner of invoking the first input method based on the first input event by the electronic device 100 may refer to the above, and will not be repeated here.
可理解,第一输入法为电子设备100具体调用的输入法。例如,全拼输入法、五笔输入法、笔画输入法、手写输入法等。It can be understood that the first input method is an input method specifically invoked by the electronic device 100 . For example, Quanpin input method, Wubi input method, stroke input method, handwriting input method, etc.
需要说明的是,电子设备100可以存储输入设备类型与输入法之间的对应关系。在本申请的一些实施例中,输入设备类型与输入法之间的对应关系可以由技术人员预先设置,在这种情况下,电子设备100出厂时,其存储有该对应关系。在本申请的又一些实施例中,输入设备类型与输入法之间的对应关系可以由用户进行设置。It should be noted that the electronic device 100 may store a correspondence between input device types and input methods. In some embodiments of the present application, the corresponding relationship between the input device type and the input method may be preset by a technician. In this case, the electronic device 100 stores the corresponding relationship when it leaves the factory. In some other embodiments of the present application, the corresponding relationship between the input device type and the input method can be set by the user.
S703:在第二时刻,响应于第二操作,电子设备100生成第二输入事件。其中,第二输入事件为针对第二输入设备所产生的输入事件。S703: At a second moment, in response to a second operation, the electronic device 100 generates a second input event. Wherein, the second input event is an input event generated for the second input device.
具体地,用户可以执行第二操作,相应的,在第二时刻,响应于第二操作,电子设备100可以生成第二输入事件。可理解,第二输入事件为针对第二输入设备所产生的输入事件。Specifically, the user may perform a second operation, and correspondingly, at a second moment, the electronic device 100 may generate a second input event in response to the second operation. It can be understood that the second input event is an input event generated for the second input device.
可理解,第二输入设备可以包括但不限于键盘、手写笔等设备。在本申请的一些实施例中,第二输入设备还可以为触摸屏。It can be understood that the second input device may include but not limited to a keyboard, a stylus, and other devices. In some embodiments of the present application, the second input device may also be a touch screen.
可理解,第二输入事件可以包括但不限于键盘事件、手写笔触控事件以及手指触控事件等。其中,关于键盘事件、手写笔触控事件以及手指触控事件的描述可以参考步骤S701,在此不再赘述。It can be understood that the second input event may include but not limited to a keyboard event, a stylus touch event, a finger touch event, and the like. Wherein, the description about the keyboard event, the stylus touch event and the finger touch event can refer to step S701 , which will not be repeated here.
在本申请的一些实施例中,用户所执行的第二操作为利用第二输入设备进行输入的输入操作。可理解,这里所提及的输入操作可以包括但不限于敲击键盘上的按键、通过手写笔或手指触碰电子设备100的触摸屏等。In some embodiments of the present application, the second operation performed by the user is an input operation performed by using a second input device. It can be understood that the input operation mentioned here may include but not limited to tapping a key on a keyboard, touching a touch screen of the electronic device 100 with a stylus or a finger, and the like.
在本申请的一些实施例中,用户所执行的第二操作为焦点获取操作,还可以为获取焦点之后的输入操作,详细内容可以参考步骤S701,在此不再赘述。In some embodiments of the present application, the second operation performed by the user is a focus acquisition operation, and may also be an input operation after the focus is acquired. For details, refer to step S701 , which will not be repeated here.
需要说明的是,第一输入设备和第二输入设备为不同的输入设备。示例性的,第一输入设备为手写笔,第二输入设备为键盘。It should be noted that the first input device and the second input device are different input devices. Exemplarily, the first input device is a stylus, and the second input device is a keyboard.
S704:电子设备100基于第二输入事件调用第二输入法,并显示第二界面。S704: The electronic device 100 invokes the second input method based on the second input event, and displays the second interface.
具体地,电子设备100生成第二输入事件之后,电子设备100可以确定第二输入事件的来源,即确定第二输入事件所对应的第二输入设备,并根据第二输入设备的设备类型调用第二输入法,然后显示第二界面。可理解,第二界面可以包括第二输入法显示区域。该第二输入法显示区域可以用于显示第二输入法。Specifically, after the electronic device 100 generates the second input event, the electronic device 100 may determine the source of the second input event, that is, determine the second input device corresponding to the second input event, and call the first input device according to the device type of the second input device. Second input method, and then display the second interface. It can be understood that the second interface may include a second input method display area. The second input method display area can be used to display the second input method.
需要说明的是,电子设备100基于第二输入事件调用第二输入法的具体方式可参考上 文,在此不再赘述。It should be noted that, the specific manner of invoking the second input method based on the second input event by the electronic device 100 can refer to the above, and will not be repeated here.
可理解,第二输入法为电子设备100具体调用的输入法。例如,全拼输入法、五笔输入法、笔画输入法、手写输入法等。It can be understood that the second input method is an input method specifically invoked by the electronic device 100 . For example, Quanpin input method, Wubi input method, stroke input method, handwriting input method, etc.
在本申请的一些实施例中,第一输入法和第二输入法为不同的输入法。示例性的,第一输入法为全拼输入法,第二输入法为手写输入法。而在本申请的又一些实施例中,第一输入法和第二输入法可以为相同的输入法。In some embodiments of the present application, the first input method and the second input method are different input methods. Exemplarily, the first input method is Quanpin input method, and the second input method is handwriting input method. In some other embodiments of the present application, the first input method and the second input method may be the same input method.
示例性的,在第一输入设备为触摸屏且第一操作为手指触控操作的情况下,第一输入法为全拼输入法,第一界面上的第一输入法显示区域显示全拼软键盘。在第二输入设备为键盘且第二操作为敲击键盘操作的情况下,第二输入法为全拼输入法,第二界面上的第二输入法显示区域显示输入法悬浮工具。Exemplarily, when the first input device is a touch screen and the first operation is a finger touch operation, the first input method is the Quanpin input method, and the first input method display area on the first interface displays the QuanPin soft keyboard . When the second input device is a keyboard and the second operation is a keystroke operation, the second input method is Quanpin input method, and the second input method display area on the second interface displays an input method floating tool.
需要说明的是,第一界面和第二界面为不同的界面。第一界面显示有第一输入法,第二界面显示有第二输入法。第一输入法不同于第二输入法。It should be noted that the first interface and the second interface are different interfaces. The first interface displays the first input method, and the second interface displays the second input method. The first input method is different from the second input method.
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still apply to the foregoing embodiments Modifications are made to the recorded technical solutions, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of each embodiment of the application.

Claims (17)

  1. 一种输入法调用方法,其特征在于,所述方法应用于电子设备;所述方法包括:An input method calling method, characterized in that the method is applied to electronic equipment; the method includes:
    接收第一操作,响应于所述第一操作,显示第一界面;所述第一操作为通过第一输入方式进行的输入操作;所述第一界面显示有第一输入法;所述第一输入法为与所述第一输入方式对应的输入法;Receiving a first operation, and displaying a first interface in response to the first operation; the first operation is an input operation performed through a first input method; the first interface displays a first input method; the first The input method is an input method corresponding to the first input method;
    接收第二操作,响应于所述第二操作,显示第二界面;所述第二操作为通过第二输入方式进行的输入操作;所述第二界面显示有第二输入法;所述第二输入法为与所述第二输入方式对应的输入法;Receiving a second operation, and displaying a second interface in response to the second operation; the second operation is an input operation performed through a second input method; the second interface displays a second input method; the second The input method is an input method corresponding to the second input method;
    其中,所述第一输入法不同于所述第二输入法。Wherein, the first input method is different from the second input method.
  2. 如权利要求1所述的方法,其特征在于,所述第一输入方式为利用第一输入设备进行输入的方式;所述第二输入方式为利用第二输入设备进行输入的方式;The method according to claim 1, wherein the first input mode is an input mode using a first input device; the second input mode is an input mode using a second input device;
    所述第一输入法为与所述第一输入方式对应的输入法,具体包括:所述第一输入法为与第一设备类型对应的输入法;所述第一设备类型为所述第一输入设备对应的设备类型;The first input method is an input method corresponding to the first input method, specifically including: the first input method is an input method corresponding to the first device type; the first device type is the first Enter the device type corresponding to the device;
    所述第二输入法为与所述第二输入方式对应的输入法,具体包括:所述第二输入法为与第二设备类型对应的输入法;所述第二设备类型为所述第二输入设备对应的设备类型。The second input method is an input method corresponding to the second input method, specifically including: the second input method is an input method corresponding to the second device type; the second device type is the second Enter the device type for the device.
  3. 如权利要求1或2所述的方法,其特征在于,所述响应于第一操作,显示第一界面之前,所述方法还包括:The method according to claim 1 or 2, wherein, before displaying the first interface in response to the first operation, the method further comprises:
    通过所述电子设备中的输入法应用基于第一接口向所述电子设备中的输入法管理服务发送注册监听请求;所述注册监听请求用于请求所述输入法管理服务对输入设备进行监听;The input method application in the electronic device sends a registration monitoring request to the input method management service in the electronic device based on the first interface; the registration monitoring request is used to request the input method management service to monitor the input device;
    通过所述输入法管理服务向所述电子设备中的输入管理服务发送第一消息;所述第一消息用于请求所述输入管理服务对输入设备进行监听。Sending a first message to the input management service in the electronic device through the input method management service; the first message is used to request the input management service to monitor the input device.
  4. 如权利要求3所述的方法,其特征在于,所述响应于第一操作,显示第一界面,具体包括:The method according to claim 3, wherein the displaying the first interface in response to the first operation specifically comprises:
    响应于所述第一操作,生成第一输入事件;所述第一输入事件为针对所述第一输入设备所产生的输入事件;generating a first input event in response to the first operation; the first input event is an input event generated for the first input device;
    基于所述第一输入事件调用所述第一输入法,并显示所述第一界面;calling the first input method based on the first input event, and displaying the first interface;
    所述响应于第二操作,显示第二界面,具体包括:The displaying the second interface in response to the second operation specifically includes:
    响应于所述第二操作,生成第二输入事件;所述第二输入事件为针对所述第二输入设备所产生的输入事件;generating a second input event in response to the second operation; the second input event is an input event generated for the second input device;
    基于所述第二输入事件调用所述第二输入法,并显示所述第二界面。calling the second input method based on the second input event, and displaying the second interface.
  5. 如权利要求4所述的方法,其特征在于,所述基于所述第一输入事件调用第一输入法,具体包括:The method according to claim 4, wherein calling the first input method based on the first input event specifically comprises:
    通过所述输入管理服务基于所述第一输入事件确定所述第一设备类型,并将所述第一设备类型上报给所述输入法管理服务;determining the first device type based on the first input event through the input management service, and reporting the first device type to the input method management service;
    通过所述输入管理服务比较所述第一设备类型与第一历史设备类型;所述第一历史设备类型为所述电子设备生成的所述第一输入事件的上一个输入事件所对应的输入设备的设备类型;Using the input management service to compare the first device type with a first historical device type; the first historical device type is the input device corresponding to the last input event of the first input event generated by the electronic device type of equipment;
    若所述第一设备类型与所述第一历史设备类型不同或不存在所述第一历史设备类型,通过所述输入法管理服务基于第二接口向所述输入法应用发送监听回调信息;所述监听回调信息包括所述第一设备类型;If the first device type is different from the first historical device type or the first historical device type does not exist, the input method management service sends monitoring callback information to the input method application based on the second interface; The monitoring callback information includes the first device type;
    通过所述输入法应用根据所述监听回调信息中的所述第一设备类型,在输入法调用规则中查找所述第一输入法,并调用所述第一输入法;所述输入法调用规则包括输入设备所对应的设备类型与输入法之间的对应关系。According to the first device type in the monitoring callback information, the input method application searches for the first input method in the input method calling rule, and calls the first input method; the input method calling rule Including the corresponding relationship between the device type corresponding to the input device and the input method.
  6. 如权利要求4或5所述的方法,其特征在于,所述基于所述第二输入事件调用第二输入法,具体包括:The method according to claim 4 or 5, wherein calling the second input method based on the second input event specifically comprises:
    通过所述输入管理服务基于所述第二输入事件确定所述第二设备类型,并将所述第二设备类型上报给所述输入法管理服务;determining the second device type based on the second input event through the input management service, and reporting the second device type to the input method management service;
    通过所述输入管理服务比较所述第二设备类型与所述第二历史设备类型;所述第二历史设备类型为所述电子设备生成的所述第二输入事件的上一个输入事件所对应的输入设备的设备类型;Compare the second device type with the second historical device type through the input management service; the second historical device type is corresponding to the last input event of the second input event generated by the electronic device the device type of the input device;
    若所述第二设备类型与所述第二历史设备类型不同或不存在所述第二历史设备类型,通过所述输入法管理服务基于第二接口向所述输入法应用发送监听回调信息;所述监听回调信息包括所述第二设备类型;If the second device type is different from the second historical device type or the second historical device type does not exist, send monitoring callback information to the input method application based on the second interface through the input method management service; The monitoring callback information includes the second device type;
    通过所述输入法应用根据所述监听回调信息中的所述第二设备类型,在所述输入法调用规则中查找所述第二输入法,并调用所述第二输入法。The input method application searches for the second input method in the input method calling rule according to the second device type in the monitoring callback information, and calls the second input method.
  7. 如权利要求6所述的方法,其特征在于,所述电子设备生成的所述第二输入事件的上一个输入事件为所述第一输入事件;所述第二历史设备类型为所述第一设备类型。The method according to claim 6, wherein the last input event of the second input event generated by the electronic device is the first input event; the second historical device type is the first input event Equipment type.
  8. 如权利要求1-7任一项所述的方法,其特征在于,所述第一界面和所述第二界面为第一应用的用户界面;所述第一应用为所述电子设备中的应用;所述第一操作用于提示所述第一应用获取焦点。The method according to any one of claims 1-7, wherein the first interface and the second interface are user interfaces of a first application; and the first application is an application in the electronic device ; The first operation is used to prompt the first application to acquire focus.
  9. 如权利要求8所述的方法,其特征在于,所述第二操作用于提示所述第一应用获取焦点。The method according to claim 8, wherein the second operation is used to prompt the first application to acquire focus.
  10. 如权利要求1-7任一项所述的方法,其特征在于,所述第一界面为第一应用的用户界面;所述第二界面为第二应用的用户界面;所述第一应用和所述第二应用为所述电子设备中的应用;所述第一操作用于提示所述第一应用获取焦点;所述第二操作用于提示所述第二应用获取焦点。The method according to any one of claims 1-7, wherein the first interface is a user interface of a first application; the second interface is a user interface of a second application; the first application and The second application is an application in the electronic device; the first operation is used to prompt the first application to obtain focus; the second operation is used to prompt the second application to obtain focus.
  11. 一种输入法调用方法,其特征在于,所述方法应用于电子设备;所述方法包括:An input method calling method, characterized in that the method is applied to electronic equipment; the method includes:
    接收目标操作,响应于所述目标操作,生成目标输入事件;所述目标操作为利用输入设备进行的输入操作;receiving a target operation, and generating a target input event in response to the target operation; the target operation is an input operation performed using an input device;
    通过输入管理服务基于所述目标输入事件确定目标设备类型,并将所述目标设备类型上报给输入法管理服务;所述目标设备类型为所述输入设备的设备类型;Determine the target device type based on the target input event through the input management service, and report the target device type to the input method management service; the target device type is the device type of the input device;
    通过所述输入管理服务比较所述目标设备类型与历史设备类型;所述历史设备类型为所述电子设备生成的所述目标输入事件的上一个输入事件所对应的输入设备的设备类型;Comparing the target device type with a historical device type through the input management service; the historical device type is the device type of the input device corresponding to the last input event of the target input event generated by the electronic device;
    若所述目标设备类型与所述历史设备类型不同或不存在所述历史设备类型,通过所述 输入法管理服务向所述电子设备中的输入法应用发送监听回调信息;所述监听回调信息包括所述目标设备类型;If the target device type is different from the historical device type or the historical device type does not exist, send monitoring callback information to the input method application in the electronic device through the input method management service; the monitoring callback information includes the target device type;
    通过所述输入法应用来根据所述监听回调信息中的所述目标设备类型,在输入法调用规则中查找目标输入法;所述输入法调用规则包括输入设备所对应的设备类型与输入法之间的对应关系;According to the target device type in the monitoring callback information, the input method application searches for the target input method in the input method call rule; the input method call rule includes the device type corresponding to the input device and the input method Correspondence between;
    调用所述目标输入法,并显示输入界面;所述输入界面显示有所述目标输入法。calling the target input method, and displaying an input interface; the input interface displays the target input method.
  12. 如权利要求11所述的方法,其特征在于,所述响应于所述目标操作,生成目标输入事件之前,所述方法还包括:The method according to claim 11, wherein before generating a target input event in response to the target operation, the method further comprises:
    通过所述输入法应用基于第一接口向所述输入法管理服务发送注册监听请求;所述注册监听请求用于请求所述输入法管理服务对输入设备进行监听;Sending a registration monitoring request to the input method management service through the input method application based on the first interface; the registration monitoring request is used to request the input method management service to monitor the input device;
    通过所述输入法管理服务向所述输入管理服务发送第一消息;所述第一消息用于请求所述输入管理服务对输入设备进行监听。Sending a first message to the input management service through the input method management service; the first message is used to request the input management service to monitor the input device.
  13. 如权利要求11或12所述的方法,其特征在于,所述通过输入管理服务基于所述目标输入事件确定目标设备类型,具体包括:The method according to claim 11 or 12, wherein the determining the target device type based on the target input event through the input management service includes:
    在所述目标输入事件为第一输入事件的情况下,通过所述输入管理服务确定所述目标设备类型为第一设备类型;If the target input event is a first input event, determining that the target device type is a first device type through the input management service;
    在所述目标输入事件为第二输入事件的情况下,通过所述输入管理服务确定所述目标设备类型为第二设备类型;In a case where the target input event is a second input event, determining that the target device type is a second device type through the input management service;
    在所述目标输入事件为第三输入事件的情况下,通过所述输入管理服务确定所述目标设备类型为第三设备类型;If the target input event is a third input event, determining that the target device type is a third device type through the input management service;
    其中,所述第一输入事件为手指触控事件,所述第一设备类型为触摸屏-手指;所述第二输入事件为手写笔触控事件,所述第二设备类型为触摸屏-手写笔;所述第三输入事件为键盘事件,所述第三设备类型为键盘。Wherein, the first input event is a finger touch event, and the first device type is a touch screen-finger; the second input event is a stylus touch event, and the second device type is a touch screen-stylus; The third input event is a keyboard event, and the third device type is a keyboard.
  14. 一种电子设备,包括显示屏、存储器、一个或多个处理器,其特征在于,所述存储器用于存储计算机程序;所述处理器用于调用所述计算机程序,使得所述电子设备执行权利要求1-10中任一项所述的方法。An electronic device, comprising a display screen, a memory, and one or more processors, wherein the memory is used to store a computer program; the processor is used to call the computer program, so that the electronic device executes the claims The method described in any one of 1-10.
  15. 一种电子设备,包括显示屏、存储器、一个或多个处理器,其特征在于,所述存储器用于存储计算机程序;所述处理器用于调用所述计算机程序,使得所述电子设备执行权利要求11-13中任一项所述的方法。An electronic device, comprising a display screen, a memory, and one or more processors, wherein the memory is used to store a computer program; the processor is used to call the computer program, so that the electronic device executes the claims The method described in any one of 11-13.
  16. 一种计算机存储介质,其特征在于,包括:计算机指令;当所述计算机指令在电子设备上运行时,使得所述电子设备执行权利要求1-10中任一项所述的方法。A computer storage medium, characterized by comprising: computer instructions; when the computer instructions are run on an electronic device, the electronic device is made to execute the method described in any one of claims 1-10.
  17. 一种计算机存储介质,其特征在于,包括:计算机指令;当所述计算机指令在电子设备上运行时,使得所述电子设备执行权利要求11-13中任一项所述的方法。A computer storage medium, characterized by comprising: computer instructions; when the computer instructions are run on an electronic device, the electronic device is made to execute the method described in any one of claims 11-13.
PCT/CN2022/114289 2021-12-27 2022-08-23 Input method calling method and related device WO2023124141A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111610264.5A CN114489350B (en) 2021-12-27 2021-12-27 Input method calling method and related equipment
CN202111610264.5 2021-12-27

Publications (2)

Publication Number Publication Date
WO2023124141A1 true WO2023124141A1 (en) 2023-07-06
WO2023124141A9 WO2023124141A9 (en) 2023-08-24

Family

ID=81496039

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/114289 WO2023124141A1 (en) 2021-12-27 2022-08-23 Input method calling method and related device

Country Status (2)

Country Link
CN (1) CN114489350B (en)
WO (1) WO2023124141A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114489350B (en) * 2021-12-27 2023-04-28 荣耀终端有限公司 Input method calling method and related equipment
CN115421626B (en) * 2022-11-02 2023-02-24 海看网络科技(山东)股份有限公司 AR virtual window interaction method based on mobile terminal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1991700A (en) * 2005-12-28 2007-07-04 中兴通讯股份有限公司 Mobile terminal having keyboard and hand-write synergic input function
CN102193736A (en) * 2011-04-21 2011-09-21 安徽科大讯飞信息科技股份有限公司 Input method and system supporting multimode automatic switching
CN102306052A (en) * 2011-08-10 2012-01-04 山东泰信电子有限公司 Intelligent input method for automatically identifying input equipment
CN114489350A (en) * 2021-12-27 2022-05-13 荣耀终端有限公司 Input method calling method and related equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101356368B1 (en) * 2012-02-24 2014-01-29 주식회사 팬택 Application switching apparatus and method
US20140053198A1 (en) * 2012-08-17 2014-02-20 Flextronics Ap, Llc Live television application information panel
CN103716710A (en) * 2013-12-30 2014-04-09 深圳市同洲电子股份有限公司 Intelligent television terminal and input method thereof
CN106940619A (en) * 2016-01-05 2017-07-11 阿里巴巴集团控股有限公司 A kind of inputting interface transfers method and device, user equipment
CN110362214A (en) * 2019-07-22 2019-10-22 江苏观复科技信息咨询有限公司 A kind of input method, equipment and program product
CN113741708A (en) * 2020-05-31 2021-12-03 华为技术有限公司 Input method and electronic equipment
CN112087671B (en) * 2020-09-04 2022-06-14 海信视像科技股份有限公司 Display method and display equipment for control prompt information of input method control

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1991700A (en) * 2005-12-28 2007-07-04 中兴通讯股份有限公司 Mobile terminal having keyboard and hand-write synergic input function
CN102193736A (en) * 2011-04-21 2011-09-21 安徽科大讯飞信息科技股份有限公司 Input method and system supporting multimode automatic switching
CN102306052A (en) * 2011-08-10 2012-01-04 山东泰信电子有限公司 Intelligent input method for automatically identifying input equipment
CN114489350A (en) * 2021-12-27 2022-05-13 荣耀终端有限公司 Input method calling method and related equipment

Also Published As

Publication number Publication date
CN114489350A (en) 2022-05-13
WO2023124141A9 (en) 2023-08-24
CN114489350B (en) 2023-04-28

Similar Documents

Publication Publication Date Title
US20220342850A1 (en) Data transmission method and related device
WO2021013158A1 (en) Display method and related apparatus
CN112269527B (en) Application interface generation method and related device
WO2021057830A1 (en) Information processing method and electronic device
WO2021104030A1 (en) Split-screen display method and electronic device
WO2023124141A1 (en) Input method calling method and related device
KR102534354B1 (en) System navigation bar display control method, graphical user interface and electronic device
JP2022523989A (en) How to display UI components and electronic devices
KR102481065B1 (en) Application function implementation method and electronic device
JP2023509533A (en) Interaction methods for cross-device task processing, electronic devices and storage media
US11886894B2 (en) Display control method and terminal device for determining a display layout manner of an application
WO2021057290A1 (en) Information control method and electronic device
WO2022017393A1 (en) Display interaction system, display method, and device
WO2020215969A1 (en) Content input method and terminal device
WO2021098604A1 (en) Parameter adjustment method and electronic device
WO2020215982A1 (en) Desktop icon management method and terminal device
WO2022194190A1 (en) Method and apparatus for adjusting numerical range of recognition parameter of touch gesture
WO2022213831A1 (en) Control display method and related device
US11243679B2 (en) Remote data input framework
WO2021244459A1 (en) Input method and electronic device
CN110865765A (en) Terminal and map control method
US20230236714A1 (en) Cross-Device Desktop Management Method, First Electronic Device, and Second Electronic Device
WO2021052488A1 (en) Information processing method and electronic device
WO2022002213A1 (en) Translation result display method and apparatus, and electronic device
CN113204302B (en) Virtual robot-based operation method, device, equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22913425

Country of ref document: EP

Kind code of ref document: A1