Event processing method and device for input equipment

CN119768776APending Publication Date: 2025-04-04HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380062457.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-09-02
Filing Date
2023-08-29
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

In multi-device collaboration scenarios across operating systems, devices with different operating systems cannot recognize and respond to shortcut key events, resulting in inefficient user operations.

Method used

By detecting shortcut key events of input devices and determining the focus device, event information is generated, including key scan codes and event types, and is converted and transmitted across operating systems to ensure that events can be recognized and responded to under different operating systems.

Benefits of technology

It realizes the automatic conversion of shortcut key events between different operating systems, improving user operation experience and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119768776A_ABST
    Figure CN119768776A_ABST
Patent Text Reader

Abstract

An event processing method and device of an input device are applied to the technical field of electronics. The method comprises the steps that first electronic equipment detects a first event of input equipment; focus equipment is determined; when the focus device is a second electronic device, event information is generated based on the event type of the first event and a first mapping relation, the event information comprises a key scan code and a first event type, and the first mapping relation comprises a corresponding relation between the key scan code and a first key code; the event information is sent to the second electronic equipment, the event information is used for converting the first event into an event under the second operating system, so that the second electronic equipment responds to the event information, automatic conversion of the shortcut key event of the input equipment among different operating systems can be realized, the shortcut key takes effect among different operating systems, and the user experience is improved. The operation efficiency is improved, and the operation experience of the user is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Event processing method and device for input device

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on September 2, 2022, with application number 202211071830.4 and application name “An event processing method and device for an input device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of communications, and in particular, to a processing method and apparatus for an input device. Background Art

[0003] With the rapid development of electronic devices, cross-operating system multi-device collaboration scenarios are increasingly appearing in people's lives. In cross-operating system multi-device collaboration scenarios, there are scenarios where different devices share peripherals (such as mice, keyboards, etc.). Due to the differences between different operating systems, when using shortcut keys on the peripherals of one device, there are problems with recognition and response on devices with different operating systems, which seriously affects user operation efficiency.

[0004] Summary of the Invention

[0005] In view of this, the present application provides an event processing method, apparatus, computer-readable storage medium and computer program product for an input device, which can realize the automatic conversion of shortcut key events of an input device between different operating systems, thereby realizing the effectiveness of shortcut keys between different operating systems, improving operating efficiency, and greatly improving the user's operating experience.

[0006] In a first aspect, a method for processing an event of an input device is provided. The method is applied to a first electronic device, wherein a first operating system is running on the first electronic device, the first electronic device is connected to a second electronic device, and a second operating system is running on the second electronic device, the second operating system being different from the first operating system. The method includes:

[0007] A first event of the first input device or the second input device is detected, the first electronic device is in a connected state with the first input device, and the first electronic device is in a connected state with the second input device;

[0008] Determining a current focus device of the first input device;

[0009] When the focus device is the second electronic device, generating event information based on the event type of the first event and a first mapping relationship, the event information including a key scan code and the first event type, the first mapping relationship including a correspondence between the key scan code and a first key code, the key scan code being a key scan code corresponding to the first event in the second operating system, and the first key code being a key code for the first event in the first operating system;

[0010] The event information is sent to the second electronic device, where the event information is used to convert the first event into an event under the second operating system.

[0011] The above technical solution can be executed by a first electronic device (such as a PC) or a chip in the first electronic device (such as a chip in a PC). Based on the above solution, after the first electronic device monitors the shortcut key event of the input device (such as the first event), if it is determined that the focus device is the second electronic device, the first electronic device converts the shortcut key event of the input device from the first operating system into event information that can be recognized by the second operating system, and sends the event information to the second electronic device so that the second electronic device can respond to the event information. This can realize the automatic conversion of the shortcut key event of the input device between different operating systems, thereby realizing the effectiveness of shortcut keys between different operating systems, improving operating efficiency, and greatly improving the user's operating experience.

[0012] In some possible implementations, sending the event information to the second electronic device includes:

[0013] The event information is sent to the second electronic device based on a first transmission format, where the first transmission format is a key event transmission format predefined by the first electronic device and the second electronic device.

[0014] Therefore, sending the event information in a predetermined transmission format can ensure that the peer end (ie, the second electronic device) can parse the event information.

[0015] In some possible implementations, the first input device is a mouse, and the first event is an event generated by a user sliding a scroll wheel of the mouse or clicking a mouse button. Therefore, for a shortcut key event related to the mouse, the first electronic device can convert the shortcut key event and send it to the second electronic device so that the second electronic device can respond.

[0016] In some possible implementations, the second input device is a keyboard; the first event is an event generated by a user operating a key on the keyboard (such as pressing and releasing the keyboard). Therefore, for keyboard-related shortcut key events, the first electronic device can convert the keyboard-related shortcut key events and send them to the second electronic device so that the second electronic device can respond.

[0017] It is understandable that the first electronic device may also convert shortcut key events implemented by a combination of a keyboard and a mouse, and send them to the second electronic device so that the second electronic device can respond.

[0018] In some possible implementations, the method further includes:

[0019] When the focus device is the first electronic device, the first event is executed in the first electronic device.

[0020] In some possible implementations, the first input device is a mouse; and determining the focus device includes:

[0021] determining a position of a cursor of the wireless mouse on a display screen of the first electronic device;

[0022] When the cursor of the wireless mouse moves from the display screen of the first electronic device to the display screen of the second electronic device, the focus device is the second electronic device;

[0023] When the cursor of the wireless mouse is located on the display screen of the first electronic device and has no tendency to slide out of the display screen of the first electronic device, the focus device is the first electronic device.

[0024] In some possible implementations, the first operating system is a Windows system and the second operating system is an Android system. Therefore, embodiments of the present application can convert shortcut key events under the Windows system into shortcut key events under the Android system, so as to achieve automatic conversion of shortcut key events of the input device between the Windows operating system and the installed operating system.

[0025] In a second aspect, a method for connecting an input device is provided. The method is applied to a second electronic device, wherein the second electronic device runs a second operating system, the second electronic device is connected to the first electronic device, and the first electronic device runs a first operating system, the second operating system being different from the first operating system. The method includes:

[0026] receiving event information from a first electronic device, the event information including a key scan code and a first event type identifier, the key scan code being a key scan code corresponding to a first event under the second operating system, the first electronic device running a first operating system, the first event being an event under the first operating system, and the first event being an event input by a first input device or a second input device detected by the first electronic device;

[0027] Acquire the key scan code and the first event type identifier according to the event information;

[0028] An interface is called to respond based on the key scan code and the first event type identifier.

[0029] In some possible implementations, calling an interface to respond based on the key scan code and the first event type includes:

[0030] The system interface is called to perform response processing on the key scan code and the first event type.

[0031] Therefore, when the system has a related interface (such as the interface for the lock screen event), there is no need to send it to the application, and the shortcut key event can be responded to by calling the system interface.

[0032] Exemplarily, the key scan code is a key code corresponding to a lock screen event shortcut key, and the first event type is a key press type; and the calling of the system interface to respond to the key scan code and the first event type includes:

[0033] Calling a lock screen interface to lock the display screen of the electronic device.

[0034] In some possible implementations, calling an interface to respond based on the key scan code and the first event type includes:

[0035] The key scan code and the first event type are sent to the application program for response processing using an event distribution mechanism.

[0036] Therefore, by sending the key scan code and the first event type to the first application, the application of the second electronic device responds to the shortcut key event.

[0037] Exemplarily, the key scan code includes a shortcut key related to a copy text event, and the first event type is a key press type;

[0038] The sending of the key scan code and the first event type to the application program for response processing by utilizing the event distribution mechanism includes:

[0039] The key scan code and the first event type are sent to a first application for response processing, the first application supports the copy text event, and the first application is an application currently running on the electronic device.

[0040] In some possible implementations, obtaining the key scan code and the first event type according to the event information includes:

[0041] The event information is parsed based on a first transmission format to obtain the key scan code and the first event type, where the first transmission format is a key event transmission format predefined by the first electronic device and the second electronic device.

[0042] In some possible implementations, the first operating system is a Windows system and the second operating system is an Android system. Therefore, embodiments of the present application can convert shortcut key events under the Windows system into shortcut key events under the Android system, so as to achieve automatic conversion of shortcut key events of the input device between the Windows operating system and the installed operating system.

[0043] In a third aspect, a communication system is provided, comprising a first electronic device and a second electronic device. Optionally, the communication system further comprises a first input device and a second input device. The first electronic device is configured to perform any of the methods in the first aspect. The second electronic device is configured to perform any of the methods in the second aspect.

[0044] Optionally, a first operating system is run in the first electronic device, a second operating system is run in the second electronic device, the second electronic device is connected to the first electronic device, and the second operating system is different from the first operating system.

[0045] Optionally, the first operating system is a Windows system, and the second operating system is an Android system.

[0046] In a fourth aspect, an event processing apparatus for an input device is provided, comprising a unit for executing any of the methods described in the first aspect. The apparatus can be a first electronic device (e.g., a PC) or a chip within the first electronic device (e.g., a chip within a PC). The apparatus includes an input unit, a display unit, and a processing unit.

[0047] Optionally, a first operating system is running in the device. Exemplarily, the first operating system is a Windows system.

[0048] When the device is a first electronic device, the processing unit may be a processor, the input unit may be a communication interface, and the display unit may be a graphics processing module and a screen; the first electronic device may also include a memory for storing computer program code, and when the processor executes the computer program code stored in the memory, the first electronic device executes the method of any one of the implementation methods of the first aspect.

[0049] When the device is a chip in a first electronic device, the processing unit may be a logic processing unit inside the chip, the input unit may be an input interface, pin or circuit, etc., and the display unit may be a graphics processing unit inside the chip; the chip may also include a memory, which may be a memory inside the chip (for example, a register, a cache, etc.) or a memory located outside the chip (for example, a read-only memory, a random access memory, etc.); the memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, the chip executes the method of any one of the implementation methods in the first aspect.

[0050] In a fifth aspect, an event processing apparatus for an input device is provided, comprising a unit for executing any of the methods described in the second aspect. The apparatus may be a second electronic device (e.g., a tablet) or a chip within the second electronic device (e.g., a chip within a tablet). The apparatus includes an input unit, a display unit, and a processing unit.

[0051] Optionally, a second operating system is running in the device. Exemplarily, the second operating system is an Android system.

[0052] When the device is a second electronic device, the processing unit may be a processor, the input unit may be a communication interface, and the display unit may be a graphics processing module and a screen; the second electronic device may also include a memory for storing computer program code, and when the processor executes the computer program code stored in the memory, the second electronic device executes the method of any one of the implementation methods of the second aspect.

[0053] When the device is a chip in a second electronic device, the processing unit may be a logic processing unit inside the chip, the input unit may be an input interface, pin or circuit, etc., and the display unit may be a graphics processing unit inside the chip; the chip may also include a memory, which may be a memory inside the chip (for example, a register, a cache, etc.) or a memory located outside the chip (for example, a read-only memory, a random access memory, etc.); the memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, the chip executes the method of any one of the implementation methods in the second aspect.

[0054] In the sixth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code is executed by an event processing device of an input device, the device executes a method of any one of the implementation modes in the first aspect, or the device executes a method of any one of the implementation modes in the second aspect.

[0055] In the seventh aspect, a computer program product is provided, comprising: a computer program code, which, when executed by an event processing device of an input device, causes the device to execute any one of the methods implemented in the first aspect, or causes the device to execute any one of the methods implemented in the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] FIG1 is an example diagram of an application scenario of an embodiment of the present application;

[0057] FIG2 is a schematic diagram of a hardware system of an electronic device applicable to the present application;

[0058] FIG3 is a schematic block diagram of the hardware structure of an input device suitable for the present application;

[0059] FIG4 is a schematic diagram of a software system of an electronic device applicable to the present application;

[0060] FIG5 is a schematic flow chart of an event processing method of an input device according to an embodiment of the present application;

[0061] FIG6 is an example diagram of a shortcut key event according to an embodiment of the present application;

[0062] FIG7 is another example diagram of shortcut key events according to an embodiment of the present application;

[0063] FIG8 is another example diagram of a shortcut key event according to an embodiment of the present application;

[0064] FIG9 is a schematic block diagram of an event processing apparatus for an input device according to an embodiment of the present application;

[0065] FIG10 is another schematic block diagram of an event processing apparatus for an input device according to an embodiment of the present application. DETAILED DESCRIPTION

[0066] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.

[0067] The event processing method of the input device provided in the embodiment of the present application can be applied to electronic devices. For example, the electronic device can be a tablet computer, a laptop computer, a wearable device, a multimedia playback device, an e-book reader, a personal computer (PC), a personal digital assistant (PDA), a netbook, an augmented reality (AR) device, a virtual reality (VR) device, a smart phone, a smart TV, a smart screen device, a smart camera, a portable multimedia player (PMP), a projection device, a mixed reality (MR) device, a television or a somatosensory game console in a human-computer interaction scene, and other electronic devices. The present application does not limit the specific form of the electronic device.

[0068] Electronic devices can usually be connected to one or more input devices (such as input peripherals) to achieve corresponding functions. It is understandable that the input device can be a wireless peripheral or a wired peripheral, and this is not specifically limited.

[0069] For example, a wireless peripheral device refers to an input device that implements input to a terminal device based on a wireless transmission protocol (such as the Bluetooth protocol or the 2.4G communication protocol, etc.). In the embodiments of the present application, the input methods supported by the input device may include but are not limited to keystrokes (such as a mouse, keyboard, etc.), scroll wheels (such as a mouse, etc.), gesture input, body language input, voice input, expression input, eye movement input, etc.

[0070] Furthermore, the embodiments of the present application do not limit the specific communication method between the input device and the electronic device. For example, if the input device is a Bluetooth peripheral, the Bluetooth peripheral can communicate with the electronic device based on a Bluetooth protocol that supports a multi-connection protocol stack between devices to enable multiple electronic devices to share the input device.

[0071] For example, a personal computer (PC) can be connected to a mouse, allowing users to move the cursor on the PC display and open / delete files. A PC can also be connected to a keyboard, allowing users to move the cursor on the PC display, input characters, and open / delete files. Another example is a tablet computer connected to a keyboard, allowing users to input characters and open applications, videos, and audio on the tablet.

[0072] The event processing method for the input device provided in the embodiment of the present application can be applied to a multi-device collaboration scenario across operating systems. For example, the multi-device collaboration scenario across operating systems includes: a PC (running a Windows operating system), a tablet (running an Android system), wherein a communication connection is established between the PC and the tablet. Assuming that the current focus device is a tablet, due to different operating systems, when the input peripherals of the PC use shortcut keys for operation, the tablet cannot recognize the shortcut key events, and therefore cannot respond to the shortcut key events, which greatly affects the operating efficiency and the user experience is poor.

[0073] For example, a focused device is an electronic device that has established a communication connection with an input device and can be directly controlled by the input device; a non-focus device is an electronic device that has established a communication connection with the input device but cannot be directly controlled by the input device. For example, if the input device is a wireless mouse shared by a PC and a tablet, when the wireless mouse is moved to the PC, the focused device is the PC; when the wireless mouse is moved to the tablet, the focused device is the tablet.

[0074] For ease of understanding, the application scenario of the embodiment of the present application is described below in combination with 1.

[0075] Referring to Figure 1, Figure 1 shows an example diagram of an application scenario of an embodiment of the present application. As shown in Figure 1, a PC and a tablet establish a wireless communication connection. After the PC and the tablet establish a communication connection, the mouse can move freely at both ends of the PC and the tablet. When the focus is on the tablet, the tablet can input through the mouse and keyboard. However, since the PC and the tablet use different operating systems, when the user performs shortcut key operations on the PC's mouse and / or keyboard, the tablet cannot respond to the shortcut key operations. That is, the shortcut keys cannot function in this scenario, thereby affecting the user's operating efficiency.

[0076] It should be understood that the embodiment of the present application does not specifically limit the connection method between the PC and the tablet. The PC and the tablet can be connected via Bluetooth, wireless LAN, infrared connection, etc.

[0077] In order to improve the user's device operation experience across operating systems, an embodiment of the present application proposes an event processing method for an input device. By converting the shortcut key events of the input device from a first operating system into event information that can be recognized by a second operating system, the shortcut key events of the input device can be automatically converted between different operating systems, thereby enabling the shortcut keys to take effect between different operating systems.

[0078] Figure 2 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. Exemplarily, the first electronic device may adopt the structure shown in Figure 2. Exemplarily, the second electronic device may adopt the structure shown in Figure 2.

[0079] As shown in Figure 2, the electronic device 200 may include a processor 210, a memory (including an external memory interface 220 and an internal memory 221), a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a communication module 250, an audio module 260, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera 293, a display screen 294, etc.

[0080] It is understood that the structure illustrated in FIG2 does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0081] The processor 210 may include one or more processing units. For example, the processor 210 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a flight controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0082] Processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 210 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 210. If processor 210 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 210 latency, and thus improves system efficiency.

[0083] In the embodiment of the present application, the processor 210 may include one or more microcontrollers (MCUs) for being responsible for the coordinated scheduling of all other modules / timing / transactions related to the migration of the input device.

[0084] In some embodiments, the processor 210 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0085] The charging management module 240 is configured to receive charging input from a charger. The power management module 241 is configured to connect the battery 242, the charging management module 240, and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240 to power the processor 210, the internal memory 221, the display 294, the camera 293, and the communication module 250.

[0086] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, communication module 250, modem processor and baseband processor.

[0087] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in an electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0088] The communication module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G / 6G applied to electronic devices. The communication module 250 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The communication module 250 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The communication module 250 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the communication module 250 can be set in the processor 210. In some embodiments, at least some of the functional modules of the communication module 250 can be set in the same device as at least some of the modules of the processor 210.

[0089] In some embodiments, the communication module 250 can also provide wireless communication solutions including WLAN (such as Wi-Fi network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc., which are applied to electronic devices. The communication module 250 can be one or more devices integrating at least one communication processing module. The communication module 250 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signal, and sends the processed signal to the processor 210. The communication module 250 can also receive the signal to be sent from the processor 210, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0090] In some embodiments, the communication module 250 may include a Bluetooth module, which may be responsible for sending Bluetooth messages to implement Bluetooth-connected interactions with multiple input devices.

[0091] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 270A, the receiver 270B, etc.) or displays an image or video through the display screen 294. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 210 and be provided in the same device as the communication module 250 or other functional modules.

[0092] In an embodiment of the present application, the electronic device can communicate with other terminal devices based on the communication module 250, antenna 1 and / or antenna 2, for example, send control instructions to other electronic devices.

[0093] In some embodiments, antenna 1 of the electronic device is coupled to communication module 250, and antenna 2 is coupled to communication module 250, so that the electronic device can communicate with a network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), new radio (NR), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite-based augmentation system (SBAS), etc.

[0094] The electronic device implements display functionality through a GPU, display screen 294, and an application processor. A GPU is a microprocessor for image processing that connects display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or modify display information.

[0095] Display screen 294 is used to display images, videos, etc. Display screen 294 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED).

[0096] In some embodiments, the electronic device may perform interface rendering through a GPU, display the interface through the display screen 294, and the like.

[0097] For example, in the embodiment of the present application, the interface displayed on the display screen 294 may include a cursor and characters input by an input device, etc.

[0098] The electronic device can realize the shooting function through the ISP, the camera 293, the video codec, the GPU, the display 294 and the application processor.

[0099] The external memory interface 220 can be used to connect an external memory card, such as a micro storage card (SD card), to expand the storage capacity of the electronic device. The external memory card communicates with the processor 210 via the external memory interface 220 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0100] The internal memory 221 can be used to store executable program codes of computer programs. Exemplarily, computer programs may include operating system programs and applications. Operating systems may include but are not limited to Symbian system, Android system, Microsoft (Windows) system, Apple iOS system, Blackberry system and other operating systems. Among them, the executable program code includes instructions. The internal memory 221 may include a program storage area and a data storage area. Among them, the program storage area may store the operating system, at least one application required for a function, etc. The data storage area may store data (such as application data, user data, etc.) created during the use of the electronic device. In addition, the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 210 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 221 and / or the instructions stored in the memory provided in the processor.

[0101] The sensor module 280 can sense user operations, such as touch operations, click operations, sliding operations, and user approaching the screen.

[0102] The electronic device can implement audio functions such as music playback and recording through the audio module 260, speaker 270A, receiver 270B, microphone 270C, and application processor. For the specific operating principles and functions of the audio module 260, speaker 270A, receiver 270B, and microphone 270C, please refer to the description in conventional technology.

[0103] Keys 290 include a power button, a volume button, and the like. Keys 290 may be mechanical keys or touch-sensitive keys. The electronic device may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device.

[0104] It should be noted that the hardware modules included in the electronic device shown in FIG. 2 are merely illustrative descriptions and do not limit the specific structure of the electronic device.

[0105] In the embodiments of the present application, the input device may include but is not limited to a wireless mouse, a wireless keyboard, a wireless trackball, a wireless touchpad, a wireless stylus, a wireless pen, a smart wearable device (such as a smart watch, a smart bracelet, smart glasses, a phone watch, etc.), a wireless headset, a gaming peripheral, etc., or any other device that can provide input to an electronic device, and this application does not limit it.

[0106] FIG3 is a block diagram of an input device according to an embodiment of the present invention. As shown in FIG3 , the input device 300 may include: a bus 305 , an input module 310 , a control circuit 320 , a power supply 330 , a memory component 340 , a communication module 350 , and a power management module 360 ​​.

[0107] The power supply 330 is used to power the input device 300. The power management module 360 ​​can route power directly from the power supply 330 to other components of the input device 300. The power management module 360 ​​can also distribute power from the power supply 330 to other system components (e.g., the control circuit 320, the communication module 350, and the input module 310, or any combination thereof).

[0108] In some embodiments, control circuit 320, power supply 330, memory component 340, communication module 350, and power management module 360 ​​may communicate with each other via bus 305. Input module 310 may be connected to control circuit 320 and power management module 360 ​​independently.

[0109] In some embodiments, the input module 310 can be connected to other modules via the bus 305 .

[0110] In some embodiments, the input module 310 can be configured to receive input from multiple key input elements or devices. In some embodiments, the input module 310 is operable to receive input in response to a user pressing the following components, including: keys (e.g., letter keys, function keys (such as volume keys, exit keys, mute keys, shift keys, etc.), numeric keys or numeric keypad keys, operating system selection keys, right mouse button, left mouse button, etc.), or other appropriate input elements or devices such as media control buttons, voice over internet phone (VOIP) buttons, touch sensors (e.g., touch pads, touch styluses), etc. The input module 310 can generate character data associated with the pressed key input element and send the character data to the control circuit 320. For example, if the input device is a wireless keyboard, the input module 310 may include keyboard keys; if the input device is a wireless mouse, the input module 310 may include a mouse sensor and a cursor module, wherein the cursor module is responsible for mouse cursor movement and input.

[0111] In the embodiment of the present application, the key code sent by the input device 300 to the electronic device depends on the operating system running on the electronic device. The behavior of the input device 300 depends on the operating system. The different key codes corresponding to the multiple key input elements can be specific to the operating system. For example, selecting the "Home" key on different operating systems results in different functions (e.g., the home screen in iOS, but the browser homepage in Windows).

[0112] In some embodiments, the control circuit 320 may include one or more microprocessors, and the control circuit 320 may be configured to control the operation of the input device 300. The control circuit 320 may be responsible for coordinating the scheduling of all other modules / timing / transactions, managing input device configuration information, managing input device migration, etc. In some embodiments, the control circuit 320 may include one or more MCUs, digital signal processors (DSPs), field-programmable gate arrays (FPGAs), programmable logic devices (PLDs), etc., supporting hardware / firmware (e.g., memory, programmable input / output (I / O), etc.).

[0113] The memory component 340 may be configured to store data. In some embodiments, the data may include connection data and pairing data, including, for example, the address of the selected electronic device. In some embodiments, the memory component 340 may be a non-volatile memory.

[0114] The communication module 350 can be configured to provide I / O capabilities to the input device 300. For example, the communication module 350 can route data from the input module 310 to the terminal device via a wireless connection, and route data from the terminal device to the input module 310. The wireless connection can be a Bluetooth connection or a communication connection based on any other wireless standard or dedicated wireless network protocol. Exemplarily, the communication module 350 can include a Bluetooth module. The Bluetooth module can be responsible for sending Bluetooth messages to implement Bluetooth connection interaction with the electronic device.

[0115] It should be noted that the structure of the input device 300 shown in FIG3 is merely an exemplary description and does not limit the specific structure of the input device 300 .

[0116] Figure 4 is an example diagram of the software architecture for multi-device collaborative connection. As shown in Figure 4, a communication connection is established between a first electronic device (also referred to as collaborative device 1) and a second electronic device (also referred to as collaborative device 2). The first electronic device uses a first operating system. The second electronic device uses a second operating system. The first operating system and the second operating system are different. For example, the first electronic device uses the Windows system, and the second electronic device uses the Android system.

[0117] As shown in Figure 4, the software architecture of the first electronic device is divided into the following layers from top to bottom: business layer (or application layer), capability layer (or architecture layer) and driver layer. Among them, the business layer includes the following modules: application, setting management (mainly used for setting management of the first operating system), device discovery, status management (for example, used to manage the status of the first electronic device), display management (for example, used to manage the screen display content of the first electronic device). In an embodiment of the present application, a conversion module (also referred to as an event monitoring conversion module) is newly added to the business layer. The conversion module is used to monitor input events of the input device. The conversion module is also used to identify the focus device. The conversion module is also used to convert the input event of the input device into event information of the second electronic device based on the first mapping relationship, and send the event information to the data receiving module of the second electronic device.

[0118] It should be understood that the modules included in the service layer of the first electronic device shown in Figure 4 are merely exemplary descriptions, and the embodiments of the present application are not limited thereto. In fact, the service layer of the first electronic device may include more or fewer modules than those shown in Figure 4.

[0119] The capability layer includes the following modules: socket, TCP / IP, and input module. The socket module is the basic operation unit that supports TCP / IP protocol communication.

[0120] The driver layer may include various driver modules. For example, for the first electronic device, the driver layer in FIG4 includes a Bluetooth driver, a WiFi driver, an HID driver, etc. It is understood that the driver layer of the first electronic device in FIG4 may include more or fewer modules than those shown in FIG4, and this is not specifically limited.

[0121] As shown in FIG4 , the software architecture of the second electronic device is divided into: a service layer (or application layer), a capability layer (or architecture layer), and a driver layer from top to bottom.

[0122] Among them, the business layer includes the following modules: application, setting management (for example, for implementing setting management for the second operating system), device discovery (for example, for implementing device discovery management for the second operating system), state management (for example, for managing the state of the second electronic device), and display management (for example, for managing the screen display content of the second electronic device). In an embodiment of the present application, a data receiving module is newly added to the business layer. The data receiving module is used to receive event information sent by the conversion module of the first electronic device. The data receiving module is also used to parse the event information and inject the key code and event type obtained after parsing into the input driver.

[0123] It should be understood that the modules included in the service layer of the second electronic device shown in Figure 4 are merely exemplary descriptions, and the present application is not limited thereto. In fact, the service layer of the second electronic device may include more or fewer modules than those shown in Figure 4.

[0124] The capability layer includes the following modules: input module, socket module, and TCP / IP. In this embodiment, the business layer modifies the input module. The input module is used to call the corresponding shortcut function interface or distribute it to the application based on the event information injected by the input driver (including key code and event type).

[0125] The driver layer can include various driver modules. For example, for the second electronic device, the driver layer in FIG4 includes an input driver, a Bluetooth driver, a WiFi driver, a HID driver, and the like. After obtaining the key code and event type injected by the data receiving module, the input driver reports the key code and event type to the input module. It is understood that the driver layer of the second electronic device in FIG4 can include more or fewer modules than those shown in FIG4 , and this is not specifically limited.

[0126] It should be understood that the software architecture shown in FIG4 is merely an exemplary description and the embodiments of the present application are not limited thereto.

[0127] It should be understood that the structure illustrated in FIG4 does not constitute a specific limitation on the first electronic device or the second electronic device. In other embodiments of the present application, the first electronic device or the second electronic device may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0128] The event processing method of the input device according to the embodiment of the present application is described below with reference to FIG. 5 to FIG. 8 .

[0129] FIG5 is a schematic flow chart of an event processing method 500 for an input device according to an embodiment of the present application. It is understood that the method of FIG5 can be applied to the scenario shown in FIG1 . For example, the first electronic device in FIG5 is the PC in FIG1 , and the second electronic device is the tablet in FIG1 . As shown in FIG5 , the method 500 includes:

[0130] Step 501: The first electronic device detects a first event of the first input device or the second input device, where the first event is an event under the first operating system, the first electronic device is in a connected state with the first input device, and the first electronic device is in a connected state with the second input device.

[0131] The term "first event" generally refers to an input event detected by the first electronic device under the first operating system. Input events include shortcut key events. A shortcut key event is an event triggered by pressing a shortcut key on an input device. For example, pressing the Windows+L shortcut key triggers a lock screen event.

[0132] Optionally, the first event can be an event triggered jointly by the first input device and the second input device, such as the operation of a keyboard key plus a mouse wheel; or it can be an event triggered solely by the first input device or the second input device, such as a sliding mouse wheel event.

[0133] Exemplarily, the first input device is a wireless mouse, and the second input device is a keyboard. The first electronic device is connected to the wireless mouse and the keyboard.

[0134] For the purpose of this disclosure, the first electronic device and the second electronic device are electronic devices running different operating systems. A communication connection is established between the first electronic device and the second electronic device. For example, the first electronic device is a PC running Windows, and the second electronic device is a tablet running Android.

[0135] The embodiment of the present application does not specifically limit the communication connection method between the first electronic device and the second electronic device. For example, the first electronic device and the second electronic device are connected via Bluetooth.

[0136] For example, when the first electronic device monitors input events of various external devices (e.g., a keyboard or mouse, etc.), it detects an event of the first input device or the second input device, such as a first event. The first event can be understood as an event under the first operating system. In order to enable the first event to be executed in the second electronic device, the embodiment of the present application needs to convert the first event into an event under the second operating system.

[0137] Step 502: The first electronic device determines the current focus device of the first input device.

[0138] After monitoring the first event, it is possible to first determine whether the current focus device is the first electronic device or the second electronic device. If it is determined that the focus device is the first electronic device, step 503-2 is executed; if it is determined that the focus device is the second electronic device, step 503-1 is executed.

[0139] The description of the focus device can be found in the previous article. For the sake of brevity, it will not be repeated here.

[0140] The embodiment of the present application does not specifically limit the method for determining the focus device.

[0141] Optionally, as an implementation manner, when the first input device is a wireless mouse, determining the current focus device of the first input device includes:

[0142] determining a position of a cursor of the wireless mouse on a display screen of the first electronic device;

[0143] When the cursor of the wireless mouse moves from the display screen of the first electronic device to the display screen of the second electronic device, the focus device is the second electronic device;

[0144] When the cursor of the wireless mouse is located on the display screen of the first electronic device and has no tendency to slide out of the display screen of the first electronic device, the focus device is the first electronic device.

[0145] For example, assuming that the first electronic device is located on the right side of the second electronic device, when it is detected that the cursor of the wireless mouse moves from the right edge of the display screen of the first electronic device to the second electronic device, the focus device is determined to be the second electronic device; when it is detected that the cursor of the wireless mouse does not exceed the right edge of the display screen of the first electronic device, the focus device is determined to be the first electronic device.

[0146] Exemplarily, the first device detects that the wireless mouse slides out of the edge of the display screen of the first electronic device, and the movement coordinates of the wireless mouse sliding toward the second electronic device exceed a preset threshold, and then determines that the focus device is the second electronic device.

[0147] It should be understood that the above-described method for determining the focus device is merely illustrative and is not intended to limit the embodiments of the present application to the above-described example. In fact, those skilled in the art may employ other methods for determining the focus device, such as employing a screen cursor edge detection algorithm.

[0148] Step 503-1: When the focus device is the second electronic device, the first electronic device generates event information based on the event type of the first event and a first mapping relationship. The event information includes a key scan code and a first event type. The first mapping relationship includes a correspondence between the first key scan code and a first key code. The key scan code is the key code corresponding to the first event in the second operating system, and the first key code is the key code of the first event in the first operating system. The first event type identifier is used to identify the event type of the first event.

[0149] The first mapping relationship may include a correspondence between the key codes of the first event under different operating systems.

[0150] For example, the following Table 1 is a mapping relationship between the key codes of the lock screen event in the Windows system and the key scan codes of the lock screen event in the Android system.

[0151] Table 1

[0152] In Table 1 above, for the lock screen event, the key codes under the Windows system are 0x5B, 0x4C, and the corresponding key scan codes under the Android system are 125, 38.

[0153] It should be understood that the above Table 1 is only described with the lock screen event as an example, and the embodiments of the present application are not limited thereto. In fact, for other shortcut key events, there are also key code mapping relationships, which are not listed here one by one.

[0154] For example, the keys corresponding to the 26 English letters have corresponding key scan codes in the Android system. For example, the key scan code for the letter A in the Android system is 30; the key scan code for the letter B in the Android system is 48; the key scan code for the letter C in the Android system is 46; ...; the key scan code for the letter X in the Android system is 45; the key scan code for the letter Y in the Android system is 21; and the key scan code for the letter Z in the Android system is 44. It should be understood that for the sake of brevity, only the key scan codes for some letters in the Android system are given as examples here.

[0155] It should be understood that the aforementioned 26 English letter keys also have corresponding key codes in Windows. For example, the 26 English letter keys can be converted into hexadecimal representations to obtain the key codes for the 26 English letters in Windows. Thus, the key code mapping relationship for the 26 English letters includes: the key code of each letter in Windows and the corresponding key scan code of each letter in Android.

[0156] Another key code mapping relationship is described below in conjunction with Table 2. For example, Table 2 shows a mapping table of key codes corresponding to some keys on the keyboard in Windows system and key scan codes corresponding to some keys in Android system.

[0157] Table 2

[0158] In Table 2, taking the Windows key as an example, the corresponding key code in the Windows system is 0x5B, and the corresponding key scan code in the Android system is 125.

[0159] It should be understood that the above Table 2 is only an example of describing some keys in the keyboard, and the embodiments of the present application are not limited thereto. In fact, for other keys, there are also mapping relationships between key codes in Windows systems and key scan codes in Android systems, which are not listed here one by one.

[0160] It should also be understood that the above mapping relationship between key codes and key scan codes is only an exemplary description, and those skilled in the art can add new key code mapping relationships according to needs or in accordance with the specifications of different operating systems.

[0161] For example, the first electronic device can maintain a mapping relationship between input devices (such as keyboards, mice, and other peripherals) under different operations. When the first electronic device monitors an event triggered by an input device, it can query the mapping relationship to obtain the key scan code of the event under the Android system. After obtaining the key code, the first electronic device can encapsulate the key scan code and event type into data (such as event information) and transmit it to the second electronic device.

[0162] Optionally, the event type may be identified by an event ID. For example, during the packaging process, the event ID and the key scan code may be packaged and sent to the second electronic device.

[0163] The following describes the definition table of event types and event IDs in conjunction with Table 3. For example, Table 3 shows some event types and their corresponding event IDs.

[0164] Table 3

[0165] In Table 3, the keyboard down event is the event when the user presses the keyboard and does not release it. For example, the keyboard down event can be identified by GENERIC_INPUT_TYPE_KEY_DOWN. The keyboard up event is the event when the user presses the keyboard and releases it. For example, the keyboard up event can be identified by GENERIC_INPUT_TYPE_KEY_UP. The vertical wheel movement event is the event when the user slides the mouse wheel to move vertically. For example, the vertical wheel movement event can be identified by GENERIC_INPUT_TYPE_VERTICAL_WHEEL. The horizontal wheel movement event is the event when the user slides the mouse wheel to move horizontally. For example, the horizontal wheel movement event can be identified by GENERIC_INPUT_TYPE_HORIZONTAL_WHEEL.

[0166] It should be understood that the event types and corresponding event IDs shown in Table 3 above are merely exemplary descriptions, and the embodiments of the present application are not limited thereto.

[0167] It should also be understood that the above descriptions of event types and corresponding event IDs are merely exemplary, and those skilled in the art may add new event types and corresponding event IDs as needed.

[0168] Exemplarily, the lock screen event is implemented by two lock screen shortcut keys, such as a Windows key and an L key combination key. When the user presses the Windows key, the first electronic device queries the key scan code (125) corresponding to the Windows key under the Android system through the first mapping relationship, and then sends the keyboard down event and the key scan code (125) corresponding to the Windows key under the Android system to the second electronic device; then, when the user presses the L key, the first electronic device sends the "key scan code (38) corresponding to the L key under the Android system" and the "keyboard down" event of the L key to the second electronic device; when the user releases the L key, the first electronic device sends the "key scan code (38) corresponding to the L key under the Android system" and the "keyboard up" event of the L key to the second electronic device; when the user releases the Windows key, the first electronic device sends the keyboard up event and the key scan code (125) corresponding to the Windows key under the Android system to the second electronic device.

[0169] Optionally, in step 503 - 2 , when the focus device is the first electronic device, executing the first event in the first electronic device.

[0170] For example, when it is detected that the mouse has not moved to an edge of the first electronic device (e.g., the right edge), the first event can be processed in the first electronic device. Optionally, processing the first event in the first electronic device includes: responding to the first event using an existing event flow in the first electronic device. For example, the first event is distributed to another form (or window) of the first electronic device for processing.

[0171] Step 504: The first electronic device sends event information to the second electronic device, where the event information is used by the second electronic device to generate an event under the second operating system. Correspondingly, the second electronic device receives the event information from the first electronic device.

[0172] The embodiment of the present application does not specifically limit the transmission format used when the first electronic device sends event information to the second electronic device.

[0173] Exemplarily, the first electronic device sends the event information to the second electronic device based on a first transmission format (such as the format shown in Table 3), where the first transmission format is a key event transmission format predefined between the first electronic device and the second electronic device.

[0174] It should be noted that the first transmission format is a transmission format agreed upon in advance by the first electronic device and the second electronic device. After receiving the event information sent in the first transmission format, the second electronic device can parse it according to the first transmission format. Therefore, sending the event information in the predetermined transmission format can ensure that the other party (i.e., the second electronic device) can parse the event information.

[0175] It should be understood that the term "first transmission format" generally refers to the transmission format in which the first electronic device sends event information to the second electronic device, and the present embodiment does not specifically limit its naming. For example, the term "first transmission format" may also be referred to as the "key event transmission format."

[0176] The following describes the key event transmission format. For example, Table 4 shows an example of the key event transmission format:

[0177] Table 4

[0178] The number of bytes corresponding to each field is shown in Table 4. Based on the transmission format shown in Table 4, the key code and time type can be encapsulated to obtain event information.

[0179] It should be understood that the transmission format in Table 4 is only an exemplary description, and the embodiments of the present application are not limited thereto. In fact, those skilled in the art may also use other transmission protocols or transmission formats to transmit the above event information.

[0180] Step 505: The second electronic device obtains the key scan code and the first event type (which can be identified by an event ID) according to the event information.

[0181] Exemplarily, if the first electronic device sends the above-mentioned event information based on the first transmission format, correspondingly, after receiving the event information, the second electronic device parses the event information based on the first transmission format to obtain the key scan code and the first event type (for example, obtains the event ID).

[0182] The second electronic device may directly inject the parsed key scan code and the first event type into the input driver, or may perform mapping based on the parsed key scan code and the first event type and inject the mapped event type into the input driver.

[0183] Optionally, as an embodiment, after the second electronic device (or the data receiving module of the second electronic device) obtains the event type through parsing, it can further map the parsed event type, for example, mapping the first event type to the second event type, so that the event type is more in line with the usage specifications or standards under the second operating system, avoiding the inability to respond to the first event type when the second operating system cannot support the first event type, which helps to improve the user's operating experience. Optionally, the second electronic device injects the mapped second event type into the input driver. For example, the second electronic device parses the shortcut key event including: pressing "Windows+left arrow key (i.e., left arrow key)", "Windows+left arrow key" is "maximize the window to the left side of the screen event" under the Windows system, but there is no corresponding event type under the Android system, then the second electronic device maps this event to "Windows+left arrow key" mapped to the "return" event, and injects the "return" event into the input driver.

[0184] It should be understood that the embodiments of the present application do not specifically limit how the second electronic device maps the parsed events, and those skilled in the art can perform corresponding mapping based on actual needs.

[0185] Step 506: The second electronic device calls an interface to respond based on the key scan code and the first event type (identified by the first event type ID).

[0186] Exemplarily, step 506 includes: 506-1, the data receiving module of the second electronic device injects the key scan code and the first event type into the input driver; 506-2, the input driver reports the key scan code and the first event type to the input module; and 506-3, the input module invokes an interface to respond based on the key scan code and the first event type. Exemplarily, the input module can convert the key scan code into a key code in the Android system.

[0187] For example, the input module in the second electronic device calls the corresponding function interface according to the key scan code and the first event type, or distributes the shortcut event to the application. This will be described later with reference to examples.

[0188] In an embodiment of the present application, after the first electronic device monitors the shortcut key event of the input device (such as the first event), if it determines that the focus device is the second electronic device, then the first electronic device converts the shortcut key event of the input device from the first operating system into event information that can be recognized by the second operating system, and sends the event information to the second electronic device so that the second electronic device can respond to the event information. This can realize the automatic conversion of the shortcut key event of the input device between different operating systems, thereby realizing the effectiveness of shortcut keys between different operating systems, improving operating efficiency, and greatly improving the user's operating experience.

[0189] Optionally, as an embodiment, calling an interface to respond based on the key scan code and the first event type includes: calling a system interface to respond to the key scan code and the first event type.

[0190] Exemplarily, the key scan code is a key code corresponding to a lock screen event shortcut key, and the first event type is a key press type; and the calling of the system interface to respond to the key scan code and the first event type includes:

[0191] Calling a lock screen interface to lock the display screen of the electronic device.

[0192] For example, the Android system has a corresponding lock screen interface, so there is no need to distribute event information to the application.

[0193] Optionally, if the second electronic device maps the key scan code and / or the first event type, the system interface can be called here to respond to the mapped key code (such as the third key code) and the mapped event type (such as the second event type).

[0194] For ease of understanding, the following explanation is provided with reference to the example in Figure 6. In one possible implementation, taking the first electronic device as a PC and the second electronic device as a tablet as an example, and the PC and tablet sharing a mouse as an example, as shown in Figure 6, the PC and tablet are in a connected state. In Figure 6, the mouse cursor is in the tablet, that is, the current focus device is the tablet. The user can trigger a lock screen event by pressing the lock screen shortcut keys (including the Windows key and the L key). After detecting the lock screen event, the PC converts the lock screen event into a key code and event type under the tablet. As shown in Figure 6, when the user presses the Windows key and the L key, the tablet calls the system interface to implement the lock screen, that is, the tablet turns off the screen. As can be seen from Figure 6, the tablet responds to the lock screen shortcut key event.

[0195] Optionally, as an embodiment, calling an interface to respond based on the key scan code and the first event type includes: utilizing an event distribution mechanism to send the key scan code and the first event type to an application for response processing.

[0196] Exemplarily, the key scan code includes the key code of the shortcut key related to the copy text event (such as the ctrl key in the copy shortcut key), and the first event type is a key press type (such as pressing the ctrl key); using the event distribution mechanism to send the key scan code and the first event type to the application for response processing includes: sending the key scan code and the first event type to the first application for response processing, the first application supports the copy text event, and the first application is the application running on the electronic device.

[0197] Optionally, if the second electronic device maps the key scan code and / or the first event type, the event distribution mechanism may be used to perform response processing on the mapped key scan code and the mapped event type.

[0198] For ease of understanding, the following is explained with reference to the example in Figure 7. In one possible implementation, taking the first electronic device as a PC, the second electronic device as a tablet, and the PC and the tablet sharing a mouse as an example, as shown in Figure 7, the PC and the tablet are in a connected state. In Figure 7, the mouse cursor is in the tablet, that is, the current focus device is the tablet. The user can trigger the select all text event by pressing the select all text shortcut key (including the ctrl key and the A key). After detecting the select all text event, the PC converts the select all text event into a key code and event type under the tablet. As shown in Figure 7, when the user presses the ctrl key and the A key, the tablet distributes the select all text event to the application. Assuming that the tablet is currently running a text application, the interface of the text application is called to implement the select all text event, such as selecting the text "Honor New Product Release..." that is being displayed on the tablet. As can be seen from Figure 7, the tablet responds to the select all text event shortcut key event.

[0199] It should be understood that the example in FIG. 7 is merely an example of a “select all text shortcut key event”, and the embodiments of the present application are not limited thereto.

[0200] It should be understood that the examples shown in Figures 6 and 7 are about keyboard shortcut operations, and the embodiments of the present application are not limited thereto. In fact, the user can also implement certain shortcut key events through the combination of keyboard and mouse.

[0201] Figure 8 shows an example diagram of enlarging text through the keyboard and mouse. Take the first electronic device as a PC, the second electronic device as a tablet, and the PC and tablet sharing a mouse as an example, as shown in Figure 8. As shown in Figure 8, the PC and tablet are in a connected state. In Figure 8, the mouse cursor is in the tablet, that is, the current focus device is the tablet. The user can trigger the enlarge text event by pressing the enlarge text shortcut key (including the ctrl key and sliding the mouse wheel up). After detecting the enlarge text event, the PC converts the enlarge text event into a key code and event type under the tablet. As shown in Figure 8, when the user presses the ctrl key and slides the mouse wheel up at the same time, the tablet distributes the enlarge text event to the application. Assuming that the tablet is currently running a text application, the interface of the text application is called to implement the enlarge text event, such as enlarging the text "Honor New Product Release..." displayed on the tablet. As can be seen from Figure 8, the tablet responds to the enlarge text event shortcut key event.

[0202] It should be understood that the examples in Figures 6 to 8 are only exemplary descriptions of some shortcut key events, and the embodiments of the present application are not limited thereto. In fact, other shortcut key events can also achieve cross-system response using the method of the embodiments of the present application.

[0203] It should also be understood that Figures 6 to 8 illustrate the example of a PC as the first electronic device and a tablet as the second electronic device, and the present invention is not limited thereto. For example, a tablet as the first electronic device and a PC as the second electronic device can also be implemented.

[0204] The above description, in conjunction with Figures 1 to 8 , details the event processing method for an input device provided by an embodiment of the present application. The following description will detail the device embodiment of the present application in conjunction with Figures 9 and 10 . It should be understood that the event processing device for an input device according to an embodiment of the present application can execute the event processing methods for various input devices described in the aforementioned embodiments of the present application. For the specific working processes of the various products below, reference can be made to the corresponding processes in the aforementioned method embodiments.

[0205] FIG9 is a schematic block diagram of an input device event processing apparatus 900 according to an embodiment of the present application. It should be understood that apparatus 900 can execute the method performed by the first electronic device in the event processing of the input device shown in FIG5 to FIG8.

[0206] As shown in Figure 9, the event processing apparatus 900 for an input device includes a monitoring unit 910, a determining unit 920, a converting unit 930, and a communication unit 940. In one possible example, apparatus 900 may be a first electronic device, such as a PC. A first operating system is running on the first electronic device, the first electronic device is connected to a second electronic device, and the second electronic device runs a second operating system that is different from the first operating system.

[0207] The monitoring unit 910 is configured to detect a first event of the first input device or the second input device, the first electronic device is in a connected state with the first input device, and the first electronic device is in a connected state with the second input device;

[0208] The determining unit 920 is used to determine the current focus device of the first input device;

[0209] The conversion unit 930 is configured to, when the focus device is the second electronic device, generate event information based on the event type of the first event and a first mapping relationship, the event information including a key scan code and the first event type, the first mapping relationship including a correspondence between the key scan code and a first key code, the key scan code being a key scan code corresponding to the first event in the second operating system, and the first key code being a key code corresponding to the first event in the first operating system;

[0210] The communication unit 940 is configured to send the event information to the second electronic device, where the event information is used to convert the first event into an event under the second operating system.

[0211] Optionally, as an embodiment, the communication unit 940 is configured to send the event information to the second electronic device, specifically including:

[0212] The event information is sent to the second electronic device based on a first transmission format, where the first transmission format is a key event transmission format predefined by the first electronic device and the second electronic device.

[0213] Optionally, as an embodiment, the first input device is a mouse; and the first event is an event generated by a user sliding a scroll wheel of the mouse or clicking a mouse button.

[0214] Optionally, as an embodiment, the second input device is a keyboard; and the first event is an event generated by a user pressing a key on the keyboard.

[0215] Optionally, as an embodiment, the apparatus 900 further includes:

[0216] A processing unit (not shown in FIG9 ) is configured to execute the first event in the first electronic device when the focus device is the first electronic device.

[0217] Optionally, as an embodiment, the first input device is a mouse; the determining unit 920 is configured to determine the focus device, specifically including:

[0218] determining a position of a cursor of the wireless mouse on a display screen of the first electronic device;

[0219] When the cursor of the wireless mouse moves from the display screen of the first electronic device to the display screen of the second electronic device, the focus device is the second electronic device;

[0220] When the cursor of the wireless mouse is located on the display screen of the first electronic device and has no tendency to slide out of the display screen of the first electronic device, the focus device is the first electronic device.

[0221] Optionally, as an embodiment, the first operating system is a Windows system, and the second operating system is an Android system.

[0222] In one possible example, the monitoring unit 910, the determining unit 920, the converting unit 930, and the communicating unit 940 can be implemented by a processor or a processing unit. It should be understood that the above-mentioned apparatus 900 is embodied in the form of a functional unit. The term "unit" here can be implemented in the form of software and / or hardware, and this embodiment of the application does not specifically limit this.

[0223] For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group processor, etc.) that executes one or more software or firmware programs and a memory, an integrated logic circuit, and / or other suitable devices that can provide the above functions. In a simple embodiment, those skilled in the art can imagine that the device 900 can take the form shown in Figure 2.

[0224] Figure 10 is a schematic block diagram of an input device event processing apparatus 1000 according to an embodiment of the present application. It should be understood that the apparatus 1000 can execute the method performed by the second electronic device in the input device event processing shown in Figures 5 to 8.

[0225] As shown in Figure 10, the input device event processing apparatus 1000 includes a receiving unit 1010 and a processing unit 1020. In one possible example, apparatus 1000 may be a second electronic device, such as a tablet. The second electronic device runs a second operating system, is connected to the first electronic device, and runs a first operating system in the first electronic device, which is different from the first operating system.

[0226] In some examples, the receiving unit 1010 is configured to receive event information from a first electronic device, the event information including a key scan code and a first event type identifier, the key scan code being a key scan code corresponding to a first event under the second operating system, the first electronic device running a first operating system, the first event being an event under the first operating system, and the first event being an event input by a first input device or a second input device detected by the first electronic device;

[0227] The processing unit 1020 is configured to obtain the key scan code and the first event type identifier according to the event information;

[0228] The processing unit 1020 is further configured to call an interface to respond based on the key scan code and the first event type identifier.

[0229] Optionally, as an embodiment, the processing unit 1020 is configured to call an interface to respond based on the key scan code and the first event type, specifically including:

[0230] The system interface is called to perform response processing on the key scan code and the first event type.

[0231] Optionally, as an embodiment, the key scan code is a key code corresponding to a lock screen event shortcut key, and the first event type is a key press type; and the calling of the system interface to respond to the key scan code and the first event type includes:

[0232] Calling a lock screen interface to lock the display screen of the electronic device.

[0233] Optionally, as an embodiment, the processing unit 1020 is configured to call an interface to respond based on the key scan code and the first event type, including:

[0234] The key scan code and the first event type are sent to the application program for response processing using an event distribution mechanism.

[0235] Optionally, as an embodiment, the key scan code includes a shortcut key related to a copy text event, and the first event type is a key press type;

[0236] The sending of the key scan code and the first event type to the application program for response processing by utilizing the event distribution mechanism includes:

[0237] The key scan code and the first event type are sent to a first application for response processing, the first application supports the copy text event, and the first application is an application currently running on the electronic device.

[0238] Optionally, as an embodiment, the processing unit 1020 is configured to obtain the key scan code and the first event type according to the event information, including:

[0239] The event information is parsed based on a first transmission format to obtain the key scan code and the first event type, where the first transmission format is a key event transmission format predefined by the first electronic device and the second electronic device.

[0240] Optionally, as an embodiment, the first operating system is a Windows system, and the second operating system is an Android system.

[0241] In one possible example, the receiving unit 1010 can be implemented by a wireless communication module. The processing unit 1020 can be implemented by a processor or a processing unit. It should be understood that the above-mentioned device 1000 is embodied in the form of a functional unit. The term "unit" here can be implemented in the form of software and / or hardware, and this embodiment of the application does not specifically limit this.

[0242] For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group processor, etc.) that executes one or more software or firmware programs and a memory, an integrated logic circuit, and / or other suitable devices that can provide the above functions. In a simple embodiment, those skilled in the art will appreciate that the device 1000 can take the form shown in Figure 2.

[0243] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0244] The present application also provides a communication system, including a first electronic device, a second electronic device, and a plurality of input devices.

[0245] The present application also provides a computer program product, which, when executed by a processor, implements the method described in any method embodiment of the present application.

[0246] The computer program product can be stored in a memory and finally converted into an executable target file that can be executed by a processor through preprocessing, compilation, assembly and linking.

[0247] The present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer, implements the method described in any method embodiment of the present application. The computer program can be a high-level language program or an executable target program.

[0248] The computer-readable storage medium may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0249] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0250] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0251] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0252] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0253] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0254] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory ROM, a random access memory RAM, a magnetic disk, or an optical disk.

[0255] It should be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0256] Additionally, the terms "system" and "network" are often used interchangeably in this document. The term "and / or" in this document simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates that the related objects are in an "or" relationship. For example, A / B can mean either A or B.

[0257] The terms (or numbers) "first", "second", ... etc. that appear in the embodiments of the present application are only used for descriptive purposes, that is, they are only used to distinguish different objects, such as different "electronic devices", etc., and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first", "second", ... etc. may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, "at least one (item)" refers to one or more. "Multiple" means two or more. "At least one of the following (item)" or similar expressions refers to any combination of these items, including any combination of a single (item) or plural (items).

[0258] For example, the meaning of expressions similar to "the item includes at least one of the following: A, B, and C" in the embodiments of the present application, unless otherwise specified, generally means that the item can be any one of the following: A; B; C; A and B; A and C; B and C; A, B and C; A and A; A, A and A; A, A and B; A, A and C, A, B and B; A, C and C; B and B, B, B and B, B, B and C, C and C; C, C and C, and other combinations of A, B and C. The above examples use A, B, and C as an example to illustrate the optional items of the item. When the expression is "the item includes at least one of the following: A, B, ..., and X", that is, when the expression has more elements, the items that can be applied to the item can also be obtained according to the above rules.

[0259] In short, the above description is only a preferred embodiment of the technical solution of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this application shall be included in the scope of protection of this application.

Claims

1. An event processing method for an input device, characterized in that: The method is applied to a first electronic device, wherein a first operating system is running in the first electronic device, the first electronic device is connected to a second electronic device, and the second electronic device is running a second operating system different from the first operating system. The method includes: A first event of a first input device or a second input device is detected, the first electronic device is in a connected state with the first input device, and the first electronic device is in a connected state with the second input device; Determining a current focus device of the first input device; When the focus device is the second electronic device, generating event information based on the event type of the first event and a first mapping relationship, the event information including a key scan code and the first event type, the first mapping relationship including a correspondence between the key scan code and a first key code, the key scan code being a key scan code corresponding to the first event in the second operating system, and the first key code being a key code for the first event in the first operating system; The event information is sent to the second electronic device, where the event information is used to convert the first event into an event under the second operating system.

2. The method according to claim 1, characterized in that The sending the event information to the second electronic device includes: The event information is sent to the second electronic device based on a first transmission format, where the first transmission format is a key event transmission format predefined by the first electronic device and the second electronic device.

3. The method according to claim 1 or 2, characterized in that The method further comprises: When the focus device is the first electronic device, the first event is executed in the first electronic device.

4. The method according to any one of claims 1 to 3, characterized in that The first operating system is Windows, and the second operating system is Android.

5. An event processing method for an input device, characterized in that: The method is applied to a second electronic device, wherein a second operating system is running in the second electronic device, the second electronic device is connected to a first electronic device, the first electronic device is running a first operating system, and the second operating system is different from the first operating system. The method includes: receiving event information from a first electronic device, the event information including a key scan code and a first event type, the key scan code being a key scan code corresponding to a first event under the second operating system, the first electronic device running a first operating system, the first event being an event under the first operating system, and the first event being an event input by a first input device or a second input device detected by the first electronic device; Acquire the key scan code and the first event type identifier according to the event information; An interface is called to respond based on the key scan code and the first event type.

6. The method according to claim 5, characterized in that The calling an interface to respond based on the key scan code and the first event type includes: The system interface is called to perform response processing on the key scan code and the first event type.

7. The method according to claim 5, characterized in that The calling an interface to respond based on the key scan code and the first event type includes: The key scan code and the first event type are sent to the application program for response processing using an event distribution mechanism.

8. The method according to any one of claims 5 to 7, characterized in that The acquiring the key scan code and the first event type according to the event information includes: The event information is parsed based on a first transmission format to obtain the key scan code and the first event type, where the first transmission format is a key event transmission format predefined by the first electronic device and the second electronic device.

9. The method according to any one of claims 5 to 8, characterized in that The first operating system is Windows, and the second operating system is Android.

10. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the processor and the memory are coupled, and the memory is used to store a computer program. When the computer program is executed by the processor, the electronic device executes the method according to any one of claims 1 to 4, or the electronic device executes the method according to any one of claims 5 to 9.

11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to perform the method according to any one of claims 1 to 4, or enables the processor to perform the method according to any one of claims 5 to 9.

12. A chip, characterized in that: The method comprises a processor, and when the processor executes instructions, the processor executes the method according to any one of claims 1 to 4, or executes the method according to any one of claims 5 to 9.