Method for sharing input device, and electronic device and storage medium
By configuring the keyboard and mouse sharing service and input management module in the operating system, the input device sharing between multiple devices is realized, which solves the cumbersome operation problems caused by the independence of input devices between terminal devices, and improves user experience and input efficiency.
Patent Information
- Application Number
- PCT/CN2024/083382
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-30
- Filing Date
- 2024-03-22
- Publication Date
- 2025-01-02
AI Technical Summary
The input devices between existing terminal devices are independent, and users need to switch operations frequently, resulting in cumbersome operations and affecting user experience and efficiency.
The key-and-mouse sharing service and input management module are configured in the operating system to realize input device sharing between multiple devices. By listening and intercepting input events, it is forwarded to the counterpart devices, avoiding users switching back and forth between different devices.
Simplifies user operations, improves input efficiency and user experience, and allows users to use the same input device to control multiple devices, reducing operational complexity.
Smart Images

Figure CN2024083382_02012025_PF_FP_ABST
Abstract
Description
Method for sharing input device, electronic device and storage medium
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on June 30, 2023, with application number 202310801731.5 and application name “Method, electronic device and storage medium for sharing 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 terminal interaction technology, and in particular to a method for sharing an input device, an electronic device, and a storage medium. Background Art
[0003] With the development of terminal technology, the types and number of terminal devices are increasing. These include mobile phones, tablets, computers, and wearable devices. Currently, a single terminal device is no longer sufficient to meet user needs. Users can use multiple terminal devices, such as mobile phones, tablets, and computers, to meet their work and study needs. However, since each terminal device is independent and has its own input device, when multiple terminals need to be processed, users need to switch back and forth between the input devices of different terminals, which is cumbersome and detrimental to the user experience.
[0004] Summary of the Invention
[0005] This application provides a method for sharing an input device, an electronic device, and a storage medium, which can realize the sharing of input devices among multiple devices, allowing users to use the same input device to control multiple devices, avoiding switching back and forth between different input devices, thereby simplifying user operations and improving input efficiency. The technical solution is as follows:
[0006] In a first aspect, a method for sharing an input device is provided. The method is applied to a first electronic device connected to an input device for inputting control commands, serving as a source device for the shared input device. The first electronic device is configured with a keyboard and mouse sharing service and an input management module in its operating system. The keyboard and mouse sharing service enables sharing of the input device between the first electronic device and other electronic devices, and the input management module manages input events on the first electronic device.
[0007] After the keyboard and mouse sharing service is started, it can trigger the input management module to monitor input events of the input device. Afterwards, if an operation (second operation) is received to trigger the second electronic device to share the input device of the first electronic device, in response to the operation, the keyboard and mouse sharing service can control the screen of the first electronic device to stop displaying the mouse cursor, and send an interception instruction to the input management module, so that the input management module sends the monitored first input event to the keyboard and mouse sharing service according to the interception instruction. After receiving the first input event, the keyboard and mouse sharing service can send the first input event to the second electronic device so that the second electronic device responds to the first input event.
[0008] By configuring a keyboard and mouse sharing service and input management module in the source device's operating system, these services monitor and intercept input events from the source device, forwarding them to the peer device so that the peer device can respond to the source device's input events. This enables shared input between the source and peer devices, allowing users to control multiple devices using the same input device, eliminating the need to switch between different input devices. This simplifies user operations, improves input efficiency, and enhances user experience. This solution is particularly suitable for source devices running Android operating systems, expanding the application scenarios for shared input devices.
[0009] Among them, the input device can be a mouse device, a keyboard device, a touchpad, a touch screen device, a sensor device, etc., which is not limited in the embodiments of the present application. For example, the input device is an external input device, such as an external mouse or an external keyboard. Through the method of sharing input devices provided in the embodiments of the present application, input events of the external input device can be intercepted, and the intercepted input events can be forwarded to the second electronic device for response, thereby enabling the second electronic device to share the external input device of the first electronic device, so that the user can use the external input device of the first electronic device to input in the second electronic device.
[0010] The second operation refers to an operation that triggers the second electronic device to share the input device of the first electronic device, that is, a switching operation that switches the input device to the second electronic device for use. As an example, whether the input device is switched to another device for use can be indicated by whether the mouse cursor of the first electronic device crosses. For example, if the mouse cursor crosses, it indicates that the input device is switched to the other device for use, and if the mouse cursor does not cross, it indicates that the input device is not switched to the other device for use. The mouse cursor crossing refers to the mouse cursor moving outside the screen of the first electronic device, for example, the mouse cursor moves outside the screen of the first electronic device and in the direction of the second electronic device.
[0011] After the keyboard and mouse sharing service is started, you can configure an input event listener for the input management module at an appropriate time. The input management module can use the configured input event listener to monitor input events from input devices. By configuring an input event listener for the input management module, you can monitor input events from input devices.
[0012] In some embodiments, after the keyboard and mouse sharing service is started, an input event listener may be configured for the input management module.
[0013] In some embodiments, after the keyboard and mouse sharing service is activated, an input event listener can be configured for the input management module when a connection is detected between the first electronic device and the second electronic device. By configuring the input event listener for the input management module when a connection is detected between the first electronic device and the second electronic device, triggering input event monitoring, monitoring power consumption can be reduced and meaningless monitoring can be avoided.
[0014] The input management module may include a first input management service and a first phone window manager. The first input management service is configured to monitor mouse events and send the monitored mouse events to the keyboard and mouse sharing service. Mouse events refer to input events from a mouse device, such as click events, movement events, or scroll wheel events. The first input management service is an extension of the system's native input management service, extending the functionality of the native input management service by including the ability to monitor and intercept mouse events.
[0015] The first phone window manager is configured to monitor keyboard events and may also send the monitored keyboard events to the keyboard and mouse sharing service. Keyboard events refer to key press events on a keyboard device. The first phone window manager may be an extension of the system's native phone window manager, extending the functionality of the native phone window manager with the ability to monitor and intercept keyboard events.
[0016] In some embodiments, the keyboard and mouse sharing service may configure a keyboard and mouse event listener for the first input management service, so that the input management service monitors mouse events through the configured keyboard and mouse event listener. In this way, monitoring of mouse events can be achieved.
[0017] In some embodiments, the keyboard and mouse sharing service can configure a keyboard and mouse event listener for the first phone window manager, so that the first phone window manager listens to key events including keyboard events through the configured keyboard and mouse event listener. In this way, keyboard events can be monitored.
[0018] In some embodiments, the input management module may further control the first electronic device to not respond to the first input event based on the interception instruction. This ensures that only the second electronic device responds to the first input event, preventing both the first and second electronic devices from responding to the first input event simultaneously. This avoids confusion in input event responses and improves the accuracy of controlling the electronic device using the input device.
[0019] In some embodiments, the input management module may send a stop distribution instruction to the input distributor, and the input distributor does not distribute the first input event according to the stop distribution instruction, so that the first electronic device does not respond to the first input event.
[0020] Typically, for example, when the second electronic device does not share the input device of the first electronic device, after the input distributor receives the input event read by the input reader, it can distribute the input event to the response module corresponding to the input event in the first electronic device, and the response module responds to the input event, thereby enabling the first electronic device to respond to the input event. In an embodiment of the present application, in order to control the first electronic device not to respond to the input event, a stop distribution instruction can be sent to the input distributor, so that the stop distribution instruction controls the input distributor not to respond to the input event, thereby controlling the first electronic device not to respond to the input event.
[0021] In some embodiments, the input management module includes a first input management service. The first input management service can send a first stop-distribution instruction to the input distributor based on the interception instruction. The input distributor can stop distributing mouse events based on the first stop-distribution instruction. In this way, the first electronic device can stop responding to mouse events, avoid confusion in responding to mouse events, improve the accuracy of responding to mouse events, and thereby improve the accuracy of the user's control of the device using the mouse.
[0022] In some embodiments, the input management module includes a first phone window manager. The first phone window manager can send a second stop-distribution instruction to the input distributor. The input distributor can, in response to the second stop-distribution instruction, stop distributing keyboard events. In this way, the first electronic device can stop responding to keyboard events, thereby avoiding confusion in responding to keyboard events, improving the accuracy of responding to keyboard events, and thereby improving the accuracy of the user's keyboard control of the device.
[0023] In some embodiments, after the first phone window manager monitors the first key event, it can determine whether the first key event is a keyboard event. If it is determined that the first key event is a keyboard event, the first key event is sent to the keyboard and mouse sharing service. If it is determined that the first key event is not a keyboard event, the first key event is not sent to the keyboard and mouse sharing service. In this way, only key events of the external keyboard device of the first electronic device can be intercepted and forwarded. For other key events, such as system key events of the first electronic device, the first electronic device itself still responds.
[0024] The system key event refers to a key event of a native key of the first electronic device. For example, the native key may be a power button, a volume button, etc. of the first electronic device.
[0025] In some embodiments, after the first input management service monitors the first mouse event, it can determine whether the first mouse event is an input event of a mouse device. If so, the first mouse event is sent to the keyboard and mouse sharing service. If not, the first key event is not sent to the keyboard and mouse sharing service. In this way, only mouse events of an external mouse device of the first electronic device can be intercepted and forwarded. For other mouse events, such as mouse events triggered by a touchpad, the first electronic device itself still responds.
[0026] In some embodiments, before the input management module sends the monitored first input event to the keyboard and mouse sharing service, the input reader reads the first input event, then calls the input notification method of the input distributor, and sends the first input event to the input management module through the input notification method.
[0027] In this way, the input reader can send the read input events to the input management module, thereby enabling the input management module to monitor the input events.
[0028] In some embodiments, the input reader may call a mouse notification method of the input dispatcher to send the first mouse event to the first input management service via the input notification method. The input reader may call a keyboard notification method of the input dispatcher to send the first keyboard event to the first phone window manager via the keyboard notification method.
[0029] In this way, the input reader can send the read mouse events to the first input management module and send the read keyboard events to the first phone window manager, thereby monitoring the mouse events and keyboard events.
[0030] In some embodiments, after the keyboard and mouse sharing service is started, the state of the input reader, the first input management service, and the first phone window manager may be initialized at an appropriate time. For example, after detecting that the first electronic device has established a connection with the second electronic device, the state of the input reader, the first input management service, and the first phone window manager may be initialized.
[0031] The operation of initializing the state of the input reader, the first input management service, and the first phone window manager includes: determining the keyboard and mouse sharing state of the keyboard and mouse sharing service, and sending initialization state parameters to the input reader, the first input management service, and the first phone window manager, so that the input reader, the first input management service, and the first phone window manager initialize the stored keyboard and mouse sharing state according to the initialization state parameters. The keyboard and mouse sharing state may include whether the first electronic device has established a connection with the second electronic device, whether the input device has been switched to the second electronic device for use, etc. The initialization state parameters include the current keyboard and mouse sharing state, so that the input reader, the first input management service, and the first phone window manager initialize the stored keyboard and mouse sharing state to the current keyboard and mouse sharing state.
[0032] In some embodiments, the operation of the keyboard and mouse sharing service controlling the screen of the first electronic device to stop displaying the mouse cursor includes: the keyboard and mouse sharing service sends a first control instruction to the input reader, and the input reader turns off the mouse cursor drawing function according to the first control instruction, so that the screen of the first electronic device stops displaying the mouse cursor.
[0033] In addition, if the keyboard and mouse sharing service detects a change in the keyboard and mouse sharing state, it may also update the keyboard and mouse sharing state stored in the input reader, the first input management service, and the first phone window manager according to the changed keyboard and mouse sharing state.
[0034] By initializing and updating the status of the input reader, the first input management service and the first phone window manager, the input reader can control the turning on or off of the mouse cursor drawing function according to the keyboard and mouse sharing status, the first input management service can control the interception of mouse events according to the keyboard and mouse sharing status, and the first phone window manager can control the interception of keyboard events according to the keyboard and mouse sharing status.
[0035] For example, the first control instruction may be second keyboard and mouse sharing state information, which is used to instruct the second electronic device to share the input device of the first electronic device, i.e., the input device of the first electronic device is switched to the second electronic device for use. For another example, the interception instruction may also be second keyboard and mouse sharing state information.
[0036] In some embodiments, the keyboard and mouse sharing service can trigger the input management module to monitor input events of the input device and send the monitored input events to the keyboard and mouse sharing service. Before the keyboard and mouse sharing service controls the screen of the first electronic device to stop displaying the mouse cursor and sends an interception instruction to the input management module, the input management module can also monitor a second input event and send the second input event to the keyboard and mouse sharing service. If the keyboard and mouse sharing service determines that the mouse cursor has crossed based on the second input event, it determines that an operation of the second electronic device to share the first electronic device has been received, and then controls the screen of the first electronic device to stop displaying the mouse cursor, and sends an interception instruction to the input management module. The mouse cursor crossing refers to the movement of the mouse cursor of the first electronic device outside the screen of the first electronic device, such as moving outside the left boundary of the screen, or moving outside the right boundary of the screen.
[0037] In this way, the user can control the mouse cursor to cross by moving the mouse, that is, control the mouse cursor to move outside the screen of the first electronic device, such as moving outside the left boundary of the screen, or moving outside the right boundary of the screen, to switch the input device of the first electronic device to the second electronic device for use, which is convenient for user operation and improves the flexibility and efficiency of shared input devices.
[0038] In a second aspect, an apparatus for sharing an input device is provided, wherein the apparatus for sharing an input device has the function of implementing the method for sharing an input device in the first aspect. The apparatus for sharing an input device includes at least one module, wherein the at least one module is configured to implement the method for sharing an input device in the first aspect.
[0039] In a third aspect, an apparatus for sharing an input device is provided. The apparatus for sharing an input device includes a processor and a memory, wherein the memory is used to store a program that supports the apparatus for sharing an input device in executing the method for sharing an input device provided in the first aspect, as well as data used to implement the method for sharing an input device provided in the first aspect. The processor is configured to execute the program stored in the memory. The apparatus for sharing an input device may also include a communication bus that establishes a connection between the processor and the memory.
[0040] In a fourth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium. When the computer-readable storage medium is run on a computer, the computer executes the method for sharing an input device as described in the first aspect.
[0041] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the method for sharing an input device as described in the first aspect.
[0042] The technical effects obtained by the above-mentioned second, third, fourth and fifth aspects are similar to the technical effects obtained by the corresponding technical means in the above-mentioned first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] FIG1 shows a schematic diagram of a communication system;
[0044] FIG2 shows a schematic diagram of keyboard and mouse traversal;
[0045] FIG3 shows a schematic diagram of a keyboard and mouse reverse traversal;
[0046] FIG4 shows a schematic diagram of an interface for setting keyboard and mouse sharing through a setting interface;
[0047] FIG5 shows a schematic structural diagram of a terminal;
[0048] FIG6 shows a block diagram of a software system of a terminal;
[0049] FIG7 shows a logic diagram of implementing sharing of input devices between a tablet and a PC;
[0050] FIG8 shows a flow chart of a method for sharing an input device;
[0051] FIG9 shows a flow chart of another method for sharing an input device;
[0052] FIG10 shows a schematic structural diagram of an electronic device. DETAILED DESCRIPTION
[0053] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0054] It should be understood that the term "multiple" used in this application refers to two or more. In the description of this application, unless otherwise specified, " / " represents "or." For example, A / B can represent either A or B. "And / or" in this document simply describes an association relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exists simultaneously, or B exists alone. Furthermore, to facilitate the clear description of the technical solutions of this application, terms such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that terms such as "first" and "second" do not limit the quantity or order of execution, and do not necessarily imply differences. In the description of the embodiments of this application, unless otherwise specified, "multiple" refers to two or more. For example, "multiple processing units" refers to two or more processing units; "multiple systems" refers to two or more systems.
[0055] Before explaining in detail the method for sharing an input device provided in the embodiment of the present application, the application scenarios involved in the embodiment of the present application are first explained.
[0056] Multi-device collaboration is a distributed technology applied to multiple electronic devices. It enables two or more electronic devices to collaborate across systems and devices, enabling resource sharing and collaborative operations.
[0057] Multi-device collaboration can be applied between electronic devices of the same or different types. These include, but are not limited to, mobile phones, tablets, laptops, large-screen devices (e.g., smart TVs and smart screens), personal computers (PCs), handheld computers, netbooks, personal digital assistants (PDAs), wearable electronic devices, in-vehicle devices, and virtual reality devices.
[0058] Multi-device collaboration needs to be implemented based on communication connections between devices. The communication connection can be a wired communication connection or a wireless communication connection. Among them, the wired communication connection solution can include, for example, USB On-The-Go (OTG) technology; the wireless communication solution can include, for example, wireless fidelity (Wi-Fi), Wi-Fi Direct (Wi-Fi Direct), Bluetooth (BT), near field communication technology (NFC), infrared technology (IR), etc.
[0059] With the continuous development of terminal technology, multi-device collaboration has produced many different types of collaboration, such as keyboard and mouse collaboration.
[0060] Keyboard and mouse collaboration: Keyboard and mouse collaboration refers to sharing input devices, such as a mouse and keyboard, between multiple devices. For example, electronic device A and electronic device B share electronic device A's input device. In other words, a user can use the shared input device to input on both electronic device A and electronic device B.
[0061] In order to better understand the embodiments of the present application, the communication system to which the embodiments of the present application are applicable is first introduced.
[0062] Please refer to Figure 1, which shows a schematic diagram of a communication system. As shown in Figure 1, the communication system includes a tablet 101, a computer 102 and a mobile phone 103. The tablet 101 is externally connected to a mouse and a keyboard. Among them, the operating systems of the tablet 101 and the mobile phone 103 are Android systems, and the operating system of the computer 102 is Windows systems. The tablet 101, the computer 102 and the mobile phone 103 can share the mouse and keyboard external to the tablet 101. That is, the user can use the mouse and keyboard external to the tablet 101 to input on the tablet 101, or use the mouse and keyboard external to the tablet 101 to input on the computer 102 or the mobile phone 103. In this case, the tablet 101 can be called a source device or a sending end, and the computer 102 and the mobile phone 103 can be called a peer device or a receiving end, but the embodiments of the present application are not limited to this.
[0063] As shown in the figure, the tablet 101 is connected to an input device such as a mouse and keyboard via a wired connection, for example, via a USB interface. It should be understood that the tablet 101 can also be connected to an input device such as a mouse and keyboard via a wireless connection, for example, via a short-range wireless communication technology, such as Wi-Fi or Bluetooth. It should also be understood that FIG1 only uses a mouse and keyboard as an example of an input device shared by multiple devices. The input device can also be a touch screen device or a sensor device, and the embodiments of the present application do not limit the shared input device.
[0064] In the case of sharing a keyboard and mouse, if the keyboard and mouse are switched between different devices, keyboard and mouse cross-talk can be achieved between the tablet 101 and the computer 102, and keyboard and mouse cross-talk can be achieved between the tablet 101 and the mobile phone 103. For example, the left or right side of the tablet 101 can achieve keyboard and mouse cross-talk with one device, that is, the tablet 101 can support the mouse to cross from the left side of the tablet 101 screen to another device, and can also support the mouse to cross from the right side of the tablet 101 screen to another device. If the tablet 101 can achieve keyboard and mouse cross-talk with the computer 102 and the mobile phone 103, the computer 102 is on the right side of the tablet 101 and the mobile phone 103 is on the left side of the tablet 101, or the computer 102 is on the left side of the tablet 101 and the mobile phone 103 is on the right side of the tablet 101. If the computer 102 and the mobile phone 103 are both on the left side of the tablet 101, or the computer 102 and the mobile phone 103 are both on the right side of the tablet 101, the tablet 101 can achieve keyboard and mouse cross-talk with one device (computer 102 or mobile phone 103) at a time.
[0065] After the keyboard and mouse of the tablet 101 are transferred to the computer 102 and / or mobile phone 103, the user can use the mouse of the tablet 101 to click, drag or double-click the computer 102 and / or mobile phone 103, and can use the keyboard of the tablet 101 to input information on the computer 102 and / or mobile phone 103.
[0066] For example, please refer to Figure 2, which shows a schematic diagram of keyboard and mouse crossover. As shown in Figure 2a, tablet 101 is connected to an external mouse and keyboard. The mouse and keyboard are currently being used to input on tablet 101, and mouse cursor 1011 is displayed on the screen of tablet 101. Alternatively, tablet 101 and computer 102 can share a mouse and keyboard. If the keyboard and mouse are switched from tablet 101 to computer 102, tablet 101 can achieve keyboard and mouse crossover with computer 102. That is, mouse cursor 1011 displayed on tablet 101 can cross from the screen of tablet 101 to the screen of computer 102. For example, a user can move the mouse cursor 1011 by moving the mouse. When tablet 101 detects the crossover operation of mouse cursor 1011, the interface shown in Figure 2b can be displayed, with mouse cursor 1011 displayed on the screen of computer 102. The crossover operation of mouse cursor 1011 can be an operation of moving the mouse cursor outside the screen of tablet 101. For example, referring to Figure 2a, the crossing operation of the mouse cursor 1011 is to control the mouse cursor 1011 to move outside the right edge of the screen by moving the mouse. It should be understood that the user can also switch the keyboard and mouse from the tablet 101 to the computer 102 through other operations, and this embodiment of the application is not limited to this.
[0067] As shown in FIG2 a, the mouse cursor 1011 is displayed as a circle on the screen of the tablet 101, and as shown in FIG2 b, the mouse cursor 1011 can be displayed as a pointer on the screen of the computer 102. It is understood that the embodiment of the present application only uses the above-mentioned mouse cursor display form as an example, and the mouse cursor on the tablet 101 or the computer 102 can also be displayed in other forms, and the embodiment of the present application is not limited to this.
[0068] Furthermore, after the mouse cursor 1011 moves from the tablet 101 to the computer 102, the user can input information into the computer 102 using the keyboard of the tablet 101. For example, as shown in Figure 2(b), the user can click the "Document 1" icon with the mouse cursor 1011. In response to the user clicking the "Document 1" icon, the computer 102 can display the interface shown in Figure 2(c). As shown in Figure 2(c), the computer 102 displays the edit page for Document 1. The user can enter information "My Documents" on the edit page for Document 1 using the keyboard of the tablet 101. In response to the user entering information on the edit page for Document 1, the computer 102 displays "My Documents" on the edit page for Document 1.
[0069] In addition, if the keyboard and mouse are switched from the computer 102 to the tablet 101 for use, the mouse cursor 1011 can also cross from the computer 102 back to the tablet 101. Please refer to Figure 3, which shows a schematic diagram of a keyboard and mouse reverse crossing. As shown in Figure a in Figure 3, the mouse cursor 1011 is displayed on the screen of the computer 102. The user can move the mouse to perform the crossing operation of the mouse cursor 1011. When the computer 102 detects the crossing operation of the mouse cursor 1011, the interface shown in Figure b in Figure 3 can be displayed. As shown in Figure b in Figure 3, the mouse cursor 1011 is redisplayed on the screen of the tablet 101. Among them, the crossing operation of the mouse cursor 1011 can be an operation of moving the mouse cursor to the outside of the screen of the computer 102. Please refer to Figure a in Figure 3. The crossing operation of the mouse cursor 1011 is an operation of controlling the mouse cursor 1011 to move outside the left boundary of the screen by moving the mouse.
[0070] The tablet 101, computer 102, and mobile phone 103 may share an input device if the tablet 101, computer 102, and mobile phone 103 are logged in using the same account; and / or the tablet 101, computer 102, and mobile phone 103 are connected via Wi-Fi or Bluetooth. Wi-Fi may include a local area network or peer-to-peer (P2P) communication.
[0071] Tablet 101 can sense all devices that meet the conditions for sharing input devices, and the number of input devices shared with tablet 101 can be one or more. When tablet 101 senses more than two devices, tablet 101 can share the input device with the device selected by the user based on the user's operation of selecting the device. Alternatively, tablet 101 can independently select the device to share the input device based on preset rules. The embodiments of this application do not limit the preset rules.
[0072] The tablet 101 is connected to the computer 102 and the mobile phone 103 to realize device sharing, including two implementation methods. One possible implementation method is manual selection. The manual selection option allows the user of the tablet 101 to independently select the option to connect the device. When the automatic selection option is turned off (or not turned on), the user can manually drag or click on the connectable device in the visual interface to connect the tablet 101 to the computer 102 and the mobile phone 103. Another possible implementation method is automatic selection. When the automatic selection option is turned on and the computer 102 and the mobile phone 103 meet the conditions for sharing input devices, the tablet 101 can automatically connect to the computer 102 and the mobile phone 103. Among them, the automatic selection option can be in different positions in different devices. For example, the automatic selection option can be in the settings interface or control center of the tablet 101 and the mobile phone 103. The automatic selection option can be in the computer manager of the computer 102.
[0073] Exemplarily, FIG4 shows a schematic diagram of an interface for setting keyboard and mouse sharing through a setting interface. If the user wants to set the relevant parameters of keyboard and mouse sharing, the user can click the setting icon. In response to the user's click operation, the tablet 101 displays the setting interface, as shown in FIG4 a. The setting interface may include options such as Bluetooth, mobile data, and smart interconnection, and of course, other setting options. The user clicks on the smart interconnection option. In response to the user's operation of clicking on the smart interconnection option, the tablet 101 may display the keyboard and mouse sharing setting interface as shown on the right side of FIG4 a. As shown in FIG4 a, the keyboard and mouse sharing setting interface includes a switch control for keyboard and mouse sharing. If the user wants to turn on the function of sharing input devices on the tablet 101, he can click on the switch control for keyboard and mouse sharing. In response to the user's operation of clicking on the switch control for keyboard and mouse sharing, as shown in FIG4 b, the switch control for keyboard and mouse sharing switches to the on state.
[0074] In addition, as shown in Figure 4b, after the keyboard and mouse sharing switch control is switched to the on state, the keyboard and mouse sharing settings interface can also display an automatic connection option and an automatic direction switching option. The user can click the automatic connection option to enable the automatic connection function, and click the automatic direction switching option to enable the automatic direction switching function. After the automatic connection function is enabled, the tablet 101 can automatically connect to available devices. For example, the user can trigger the tablet 101 to automatically connect to available devices by placing the mouse cursor close to the edge of the screen twice in a row. Among them, available devices are devices that can establish a shared input device connection with the tablet 101, that is, devices that meet the conditions for sharing input devices. After the automatic direction switching function is enabled, the tablet 101 can automatically switch the screen arrangement position according to the changes in the device placement. For example, when it is detected that the computer 102 is placed on the left side of the tablet 101, the keyboard and mouse traversal direction is configured to traverse from the left side of the screen to the screen of the computer 102; when it is detected that the computer 102 is placed on the right side of the tablet 101, the keyboard and mouse traversal direction is configured to traverse from the right side of the screen to the screen of the computer 102.
[0075] In addition, the keyboard and mouse settings interface can also display the device identification of available devices. As shown in Figure 4b, the keyboard and mouse settings interface can display the available devices: YOYO computer, YOYO mobile phone and HONOR Pad. Based on the device identification of the available devices, the user can independently select the device to establish a connection from the available devices. For example, the user can click on the YOYO computer. In response to the user's click operation, the tablet 101 establishes a connection between the tablet 101 and the YOYO computer. After the tablet 101 is connected to the YOYO computer, the tablet 101 can display the keyboard and mouse sharing settings interface as shown in Figure 4c. As shown in Figure 4c, the keyboard and mouse sharing settings interface can display an indication that the tablet 101 and the YOYO computer are connected, and can also display the crossing direction options, such as the crossing direction options including the left crossing option and the right crossing option. Assuming that the YOYO computer is placed on the right side of the tablet 101, the user can click the right-side crossing option. In response to the user's click operation, the tablet 101 can configure the keyboard and mouse crossing direction of the shared input device of the tablet 101 and the YOYO computer to cross to the right side of the screen, that is, the mouse cursor of the tablet 101 can cross from the right side of the screen to the YOYO computer.
[0076] It should be understood that Figure 4 only uses the example of enabling the keyboard and mouse sharing function through the setting interface and setting the relevant functional parameters of the keyboard and mouse sharing function. In other embodiments, the keyboard and mouse sharing function can also be enabled and the relevant functional parameters of the keyboard and mouse sharing function can be set in other ways. The embodiments of the present application do not limit this.
[0077] It should be noted that the above embodiment only uses the sharing of a mouse and keyboard between multiple devices as an example. Multiple devices can also share other input devices, and the embodiments of this application are not limited to this. In addition, the above embodiment only uses the source device as a tablet and the peer devices as a computer and a mobile phone as an example. It should be understood that in other embodiments, the source device and the peer device can also be other devices.
[0078] The operating system of the source device is Windows or Android, and the operating system of the peer device can also be Windows or Android.
[0079] In some embodiments, a solution for sharing input devices between the source device and the peer device is proposed for scenarios where the source device's operating system is Windows. However, due to differences between operating systems, a solution for sharing input devices that works for a source device with a Windows operating system may not work for a source device with an Android operating system.
[0080] In an embodiment of the present application, in order to enable input device sharing between devices when the operating system of the source device is an Android system, the following method for sharing input devices is proposed: a keyboard and mouse sharing service and an input management module are configured in the operating system of the source device, wherein the keyboard and mouse sharing service is used to implement the service of sharing input devices between the source device and the peer device, and the input management module is used to manage input events of the source electronic device. When the source device is connected to an input device for inputting control instructions, after the keyboard and mouse sharing service is started, it can trigger the input management module to monitor input events of the input device. Afterwards, if an operation is received to trigger the peer device to share the input device of the source device, in response to the operation, the keyboard and mouse sharing service can control the screen of the source device to stop displaying the mouse cursor, and send an interception instruction to the input management module so that the input management module sends the subsequent monitored input events to the keyboard and mouse sharing service according to the interception instruction. After receiving the input event sent by the input management module, the keyboard and mouse sharing service forwards the input event to the peer device so that other devices can respond to the input event.
[0081] By configuring a keyboard and mouse sharing service and input management module in the operating system of the source device, the keyboard and mouse sharing service and input management module monitor and intercept input events from the source device, and then forward them to the peer device, allowing the peer device to respond to the input events from the source device. This enables shared input devices between the source and peer devices, allowing users to control multiple devices using the same input device, eliminating the need to switch back and forth between different input devices. This simplifies user operations, improves input efficiency, and enhances user experience. Furthermore, this solution is applicable to source devices running the Android operating system, expanding the application scenarios for shared input devices.
[0082] In addition, based on the interception instruction, the input management module can not only send the subsequently monitored input events to the keyboard and mouse sharing service, but also control the source device to not respond to the monitored input events. For example, the input management module can send a stop distribution instruction to the input distributor. The input distributor can stop distributing the input event based on the stop distribution instruction, that is, it will not send the input event to the corresponding response module in the source device for response, so that the source device will not respond to the input event.
[0083] As an example, the input device is an external input device, such as an external mouse or an external keyboard. Through the method for sharing input devices provided in the embodiment of the present application, input events of the external input device can be intercepted and the intercepted input events can be forwarded to the peer device for response.
[0084] For ease of explanation, in the following embodiments, the source device is referred to as a first electronic device, and the peer device is referred to as a second electronic device.
[0085] The first electronic device and the second electronic device may be terminal devices. Next, the structure of the first electronic device is introduced by taking the first electronic device as a terminal device as an example.
[0086] FIG5 shows a schematic diagram of the structure of a terminal. Referring to FIG5 , the terminal 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. Among them, the sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0087] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the terminal 100. In other embodiments of the present application, the terminal 100 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.
[0088] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, 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.
[0089] The controller may be the nerve center and command center of the terminal 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0090] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0091] In some embodiments, the processor 110 may include one or more interfaces, such as 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, etc.
[0092] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C interfaces. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C interface, thereby implementing the touch function of the terminal 100.
[0093] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S interfaces. The processor 110 can be coupled to the audio module 170 via the I2S interface to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.
[0094] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset.
[0095] The UART interface is a universal serial data bus used for asynchronous communication. The UART interface can be a bidirectional communication bus. The UART interface can convert the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.
[0096] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the terminal 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the terminal 100.
[0097] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0098] The USB interface 130 is an interface that complies with USB standards and specifications, and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the terminal 100, or to transfer data between the terminal 100 and peripheral devices. It can also be used to connect headphones to play audio. The USB interface 130 can also be used to connect to other terminals, such as augmented reality devices. The USB interface 130 can also be used to connect input devices, such as a mouse, keyboard, touchscreen device, or sensor device.
[0099] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely illustrative and does not constitute a structural limitation on the terminal 100. In other embodiments of the present application, the terminal 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0100] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the terminal 100. While charging the battery 142, the charging management module 140 can also provide power to the terminal 100 via the power management module 141.
[0101] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0102] The wireless communication function of the terminal 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0103] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal 100 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.
[0104] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied on the terminal 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 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 mobile communication module 150 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 mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0105] 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 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0106] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. applied on the terminal 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0107] In some embodiments, the terminal 100 can be connected to an input device such as a mouse or keyboard via the wireless communication module 160. For example, the terminal 100 can be connected to the input device via Bluetooth.
[0108] In some embodiments, the terminal 100 may also establish a connection with other devices through the wireless communication module 160 to share the input device with the other devices through the established connection.
[0109] In some embodiments, antenna 1 of terminal 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that terminal 100 can communicate with a network and other devices via wireless communication technologies. Wireless communication technologies 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), BT, GNSS, WLAN, NFC, FM, and / or IR technology. GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), the quasi-zenith satellite system (QZSS) and / or the satellite based augmentation system (SBAS).
[0110] Terminal 100 implements display functions through a GPU, display screen 194, and an application processor. The GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0111] Display screen 194 is used to display images, videos, and the like. Display screen 194 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). In some embodiments, terminal 100 may include one or N display screens 194, where N is an integer greater than one.
[0112] The terminal 100 can realize the shooting function through the ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0113] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and transformed into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.
[0114] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the terminal 100 may include 1 or N cameras 193, where N is an integer greater than 1.
[0115] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the terminal 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0116] Video codecs are used to compress or decompress digital video. Terminal 100 may support one or more video codecs. This allows terminal 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0117] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU enables intelligent cognitive applications in the terminal 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0118] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0119] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the terminal 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created by the terminal 100 during use (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 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.
[0120] The terminal 100 can implement audio functions, such as music playback and recording, through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D and the application processor.
[0121] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.
[0122] The speaker 170A, also called a "horn", is used to convert an audio electrical signal into a sound signal. The terminal 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0123] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the terminal 100 receives a call or voice message, the voice can be heard by placing the receiver 170B close to the ear.
[0124] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The terminal 100 can be provided with at least one microphone 170C. In other embodiments, the terminal 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the terminal 100 can also be provided with three, four or more microphones 170C to realize sound signal collection, noise reduction, and identification of sound sources, and realize directional recording function, etc.
[0125] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0126] The buttons 190 include a power button, a volume button, etc. The buttons 190 may be mechanical buttons or touch buttons. The terminal 100 may receive button inputs and generate key signal inputs related to user settings and function control of the terminal 100.
[0127] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. Touch operations on different areas of the display screen 194 can also correspond to different vibration feedback effects. Different application scenarios (such as: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0128] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0129] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or removed from the terminal 100 by inserting it into or removing it from the SIM card interface 195. The terminal 100 can support 1 or N SIM card interfaces, where N is an integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The terminal 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the terminal 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the terminal 100 and cannot be separated from the terminal 100.
[0130] Next, the software system of the terminal 100 will be described.
[0131] The software system of the terminal 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to exemplify the software system of the terminal 100.
[0132] Figure 6 shows a block diagram of the software system of terminal 100. Referring to Figure 6 , the layered architecture divides the software into several layers, each with distinct roles and responsibilities. Layers communicate with each other via software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer (Fraemwork), the native service layer (Native), and the driver layer, from top to bottom.
[0133] The application layer may include a series of application packages. As shown in FIG6 , the application package may include a keyboard and mouse sharing service. The keyboard and mouse sharing service is used to implement a service for sharing input devices between the terminal 100 and other devices.
[0134] In addition, the application package may also include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0135] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions. As shown in Figure 6 , the application framework layer may include an input management module (Figure 6 uses the example of an input management module including a first input management service and a first phone window manager), a first input manager, and an input management interface.
[0136] Among them, the input management module is used to manage input events of input devices connected to the terminal 100. In an embodiment of the present application, the input management module can also be used to monitor input events of the input devices of the terminal 100 and send the monitored input events to the keyboard and mouse sharing service. That is, the input management module can be used to intercept input events of the input devices of the terminal 100 and forward the intercepted input events to the keyboard and mouse sharing service. The first input management service is used to monitor mouse events of the terminal 100 and can also send the monitored mouse events to the keyboard and mouse sharing service. Mouse events refer to input events of a mouse device, such as mouse click events, movement events, and scroll wheel events. The first input management service is an input management service that is extended based on the system's native input management service. Based on the functions of the system's native input management service, it expands the functions of monitoring and intercepting mouse events. For example, the first input management service can be HwInputMangerService. The first phone window manager is used to monitor keyboard events of the terminal 100 and can also send the monitored keyboard events to the keyboard and mouse sharing service. Keyboard events refer to key press events of a keyboard device. The first phone window manager can be an extended phone window manager based on the system's native phone window manager, which extends the functions of monitoring and intercepting keyboard events based on the functions of the system's native phone window manager. For example, the first phone window manager is HwPhoneWindowManager.
[0137] In addition, the first input management service can be configured with interception logic. Through the configured interception logic, only specific types of mouse events can be intercepted, that is, only specific types of mouse events are sent to the keyboard and mouse sharing service. For other types of mouse events, they are not intercepted, that is, they are not sent to the keyboard and mouse sharing service, but continue to be responded to by the terminal 100. For example, after receiving a mouse event reported by the input reader, the interception logic can be used to identify whether the mouse event is triggered by an external mouse device. If so, it is intercepted; otherwise, it is not intercepted.
[0138] In addition, the first phone window manager can be configured with interception logic. Through the configured interception logic, only specific types of key events can be intercepted, that is, only specific types of key events are sent to the keyboard and mouse sharing service. For other types of key events, they are not intercepted, that is, they are not sent to the keyboard and mouse sharing service, but continue to be responded to by the terminal 100. For example, after receiving a key event reported by the input reader, the interception logic can be used to identify whether the key event is a key event triggered by an external keyboard device. If so, it is intercepted; otherwise, it is not intercepted.
[0139] Among them, the input management interface (InputMnagerEx) is the external interface of the input management module, and the first input manager is the internal interface of the input management module. The external module needs to call the input management module through the input management interface and the first input management. For example, the process of the external module calling the input management module includes: the external module first calls the input management interface, calls the first input manager through the input management interface, and then calls the input management module through the first input manager. For example, the first input management service or the first phone window manager is called through the first input manager. The first input manager is an input manager extended based on the system's native input manager. For example, the first input manager is HwInputManager.
[0140] In addition, as shown in Figure 6, the application framework layer can also include a second input management service, a keyboard and mouse event listener, an input filter, a window management callback, and a native input management service. Among them, the second input management service is the system's native input management service (InputMangerService), which is used to manage input events. The keyboard and mouse event listener (MouseAndKeyboardEventListener) is used to listen to keyboard events and mouse events. The input filter (InputFilter) is used to filter input events to filter out input events that meet the requirements. The window management callback (WindowManagerCallbacks) is used to determine the window on which the mouse event affects. The native input management service (NativeInputManagerService) is used to manage the underlying input event data.
[0141] As an example, the input management module can monitor input events through the input event listener configured by the keyboard and mouse sharing service. The input event listener may include a keyboard and mouse event listener, etc. For example, the keyboard and mouse sharing service can call the input management interface, call the first input manager through the input management interface, and configure the input event listener for the input management module through the first input manager, so that the input management module can monitor input events through the configured input event listener. For example, the first input manager can configure a keyboard and mouse event listener for the first input management service, so that the first input management service can monitor mouse events through the configured keyboard and mouse event listener. For another example, the first input manager can configure a keyboard and mouse event listener for the first phone window manager, so that the first phone window manager can monitor keyboard events through the configured keyboard and mouse event listener.
[0142] The input event listener can be a callback listener for input events, and correspondingly, the keyboard and mouse event listener can be a callback listener for keyboard and mouse events. The keyboard and mouse sharing service configures an input event listener for the input management module by registering a callback listener in the input reader for the input management module. This allows the input reader to read input events and then, via the registered callback listener, pass the input events back to the input management module. For example, a callback listener for mouse events can be registered in the input reader for the first input management service, and a callback listener for keyboard events can be registered in the input reader for the first phone window manager.
[0143] In addition, the application framework layer may also include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc., which is not limited in the embodiments of the present application.
[0144] The local service layer mainly includes some local services and link libraries. Please refer to Figure 6. The local service layer can include input passer (InputFlinger) and input library (Libinput).
[0145] Among them, the input transmitter is mainly responsible for reading and distributing raw input events. As shown in Figure 6, the input transmitter includes the second input manager, the input reader (InputReader), the input distributor (InputDispatcher), the input module (InputDevice), and the event center (EventHub). The second input manager is the system's native input manager. The input reader is used to read input events and also to turn on and off the mouse cursor drawing function. The input distributor is used to distribute input events. The input module corresponds to the input device node of the driver layer and is created by the event center based on the newly added input device node. The event center is used to read raw input events and also to create input devices.
[0146] The input library primarily supports the event distribution process. As shown in Figure 6, the input library can include input transport (InputTransport), input publisher (InputPublisher), input message (InputMessager), input consumer (InputConsumer), input channel (InputChannel), and velocity tracker (VelocityTracker).
[0147] The driver layer includes at least input device nodes, such as input device node 1 and input device node 2. In addition, the driver layer also includes display driver and processor driver.
[0148] After input devices such as the mouse, keyboard, and touchpad are connected to the terminal 100, the terminal 100 can create a device node in the driver layer according to the device driver of the input device. When an input device is connected to the terminal 100, after the terminal 100 creates a corresponding device node for the connected input device in the driver layer, it can add the information of the created device node to the device node directory. The event center can scan the device node directory, read the newly added device node from the device node directory, and create an input module for the newly added device node in the local service layer. When the device node reports an input event, the event center can read the original input event reported by the device node and send the original input event to the input reader. After the input reader receives the original input event sent by the event center, it can encapsulate the original input event, generate a specific type of input event, and then send the generated input event to the input management module through the input event listener configured by the input management module. The input management module then sends the input event to the keyboard and mouse sharing service for processing.
[0149] Next, with reference to FIG6 , the workflow of the terminal 100 software is exemplarily described.
[0150] Please refer to Figure 7, which shows a logical diagram for implementing shared input devices between a tablet and a PC. As shown in Figure 7, after the keyboard and mouse sharing service is started, keyboard and mouse event listeners can be configured for the first input management service and the first phone window manager, respectively. Afterwards, on the one hand, if the input reader reads a mouse event, it can call the mouse notification method of the input distributor, and send the mouse event to the first input management service through the mouse notification method. The first input management service receives the mouse event and sends the received mouse event to the keyboard and mouse sharing service. On the other hand, if the input reader reads a keyboard event, it can call the key notification method of the input distributor, and send the keyboard event to the first phone window manager through the key notification method. The first phone window manager receives the keyboard event and sends the received keyboard event to the keyboard and mouse sharing service.
[0151] In addition, after the keyboard and mouse sharing service receives a mouse event sent by the first input management service, the keyboard and mouse sharing service can also determine whether the mouse cursor has crossed based on the received mouse event. For example, after the input reader reports a mouse event, if the keyboard and mouse sharing service determines that the mouse cursor has crossed based on the mouse event monitored by the first input manager, the keyboard and mouse sharing service can perform the following operations: 1. Send control instruction 1 to the input reader, causing the input reader to disable the mouse cursor drawing function according to control instruction 1; 2. Forward the mouse event monitored by the first input management service to the PC; 3. Send setting parameters to the first input management service and the first phone window manager, the setting parameters including first keyboard and mouse service status information, the first status information being used to indicate mouse cursor crossing. Based on the first keyboard and mouse service status information, the first input management service can send stop distribution instruction 1 to the input distributor, causing the input distributor to stop distributing mouse events according to stop distribution instruction 1. The first phone window manager can send stop distribution instruction 2 to the input distributor based on the first keyboard and mouse service status information, causing the input distributor to stop distributing keyboard events according to stop distribution instruction 2. Afterwards, if the keyboard and mouse sharing service receives a mouse event monitored by the first input manager, it forwards the received mouse event to the PC for processing. If it receives a keyboard event monitored by the first phone window manager, it forwards the received keyboard event to the PC for processing. The PC includes an event receiving module and an event response module. The PC can receive mouse events or keyboard events forwarded by the keyboard and mouse sharing service through the event receiving module and respond to the received mouse events or keyboard events through the event response module.
[0152] In addition, as shown in Figure 7, the first input management service is configured with a filter input event (FilterInputEvent) mechanism and an interception logic. The filter input event mechanism is used to intercept the mouse events reported by the input reader, and the interception logic is used to determine whether the read mouse events meet the interception conditions. The input distributor can call the filter input event mechanism of the first input management service, and use the filter input event mechanism to first determine whether the mouse events reported by the input reader meet the interception conditions based on the interception logic. If so, the mouse events are intercepted, that is, the mouse events are sent to the keyboard and mouse sharing service. Similarly, the first telephone window management service is configured with a pre-queue key interception mechanism (IinterceptKeyBeforeQueueing) and an interception logic. The pre-queue key interception mechanism is used to intercept the key events reported by the input reader, and the interception logic is used to determine whether the key events reported by the input reader meet the interception conditions. The input dispatcher can call the first window manager's front-of-line keystroke interception mechanism. This mechanism first determines, based on interception logic, whether the keystroke event reported by the input reader meets the interception criteria. If so, the keystroke event is intercepted and sent to the keyboard and mouse sharing service. For example, the mechanism determines whether the keystroke event is from an external keyboard. If so, the keystroke event is sent to the keyboard and mouse sharing service.
[0153] Next, the solution of sharing input device provided in the embodiment of the present application is described in detail with reference to FIG6 and FIG7 .
[0154] FIG8 and FIG9 show a flow chart of a method for sharing an input device. As shown in FIG8 , the method includes the following steps:
[0155] Step 801: The user performs operation 1, which is to start the keyboard and mouse sharing service of the tablet.
[0156] Operation 1 may be clicking a switch control for the keyboard and mouse sharing service displayed on a related interface of the tablet. The switch control for the keyboard and mouse sharing service is used to turn the keyboard and mouse sharing service on or off. For example, referring to Figure 4 a, Operation 1 may be clicking a switch control for the keyboard and mouse sharing service in the keyboard and mouse sharing settings interface.
[0157] Step 802: In response to operation 1, the keyboard and mouse sharing service is started.
[0158] After the keyboard and mouse sharing service is started, the keyboard and mouse sharing status of the keyboard and mouse sharing service can be detected. The keyboard and mouse sharing status can include whether the tablet has established a connection with other devices, whether the input device has been switched to the other device for use, etc. The established connection refers to a connection that can share the input device with other devices.
[0159] In an embodiment of the present application, whether the input device has been switched to another device can be indicated by whether the tablet's mouse cursor has crossed over. For example, if the mouse cursor crosses over, it indicates that the input device has been switched to another device, and if the mouse cursor does not cross over, it indicates that the input device has not been switched to another device. Wherein, the mouse cursor crossing over means that the mouse cursor moves outside the tablet screen.
[0160] It should be understood that the keyboard and mouse sharing state may also include other states, and whether the input device is switched to other devices for use may also be indicated by other information, which is not limited in this embodiment of the present application.
[0161] Step 803: The user performs operation 2, which is an operation of establishing a connection between the tablet and the PC.
[0162] Operation 2 is used to trigger the tablet to establish a connection with the PC, and the established connection is a connection that can share input devices.
[0163] As an example, Operation 2 may be an operation of selecting a PC from available devices, where an available device is a device that meets the conditions for sharing input devices with the tablet, such as a device logged into the same account as the tablet. For example, referring to Figure 4(b), the keyboard and mouse sharing settings interface includes device identifiers for available devices, which include PC (YOYO's computer). Operation 2 may be an operation of clicking "YOYO's computer."
[0164] In addition, operation 2 may also be other operations for triggering the tablet to establish a connection with the PC, for example, operation 2 is an operation of placing the mouse pointer close to the edge of the tablet twice in succession.
[0165] In an embodiment of the present application, in response to operation 2, the keyboard and mouse sharing service may initialize the states of the input reader, the first input management service, and the first phone window manager, and configure monitoring for the first input management service and the first phone window manager. The process of initializing the states and configuring monitoring may include the following steps 804-810.
[0166] Step 804: In response to operation 2, the keyboard and mouse sharing service sends initialization state parameters of the keyboard and mouse sharing service to the input reader. The initialization state parameters include keyboard and mouse sharing state 1, which is used to indicate that the tablet and the computer are connected.
[0167] That is, the keyboard and mouse sharing service can configure the initialization keyboard and mouse sharing state of the keyboard and mouse sharing service for the input reader, and the initialization keyboard and mouse sharing state is keyboard and mouse sharing state 1.
[0168] The keyboard and mouse sharing status of the keyboard and mouse sharing service may include whether the tablet and computer are connected, whether the mouse cursor crosses, etc. The initialization status parameter of the keyboard and mouse sharing service includes the initialization keyboard and mouse sharing status, which is keyboard and mouse sharing status 1.
[0169] After receiving the initialization state parameters, the input reader may store the initialization state parameters.
[0170] It should be understood that state initialization and configuration monitoring can also be performed at other times, and accordingly, the configured initialization keyboard and mouse sharing state can also be other initialization sharing states, and the embodiments of the present application are not limited to this. For example, state initialization and configuration monitoring can also be performed after the keyboard and mouse sharing service is started, and accordingly, the initialization keyboard and mouse sharing state can be keyboard and mouse sharing state 3, which is used to indicate that the tablet and computer are not connected.
[0171] Step 805: In response to operation 2, the keyboard and mouse sharing service sends an initialization state parameter to the first input manager.
[0172] For example, the keyboard and mouse sharing service may call the first input manager according to the initialization state parameter to send the initialization state parameter to the first input manager.
[0173] In an embodiment of the present application, the keyboard and mouse sharing service can initialize the state of the first input management service and the first phone window manager through the first input manager. For example, the first input manager is called according to the initialization state parameters, and the initialization state parameters are sent to the first input management service and the first phone window manager through the first input manager.
[0174] As an example, the keyboard and mouse sharing service may first call the input management interface, and then call the first input manager through the input management interface.
[0175] Step 806: After receiving the keyboard and mouse sharing state 1, the first input manager sends an initialization state parameter to the first input management service.
[0176] Step 807: After receiving the keyboard and mouse sharing state 1, the first input manager sends an initialization state parameter to the first phone window manager.
[0177] After receiving the initialization state parameter, the first input management service and the first phone window manager may store the initialization state parameter.
[0178] Step 808: In response to operation 2, the keyboard and mouse sharing service sends a configuration monitoring instruction to the first input manager.
[0179] For example, the keyboard and mouse sharing service may call the first input manager according to the configuration monitoring instruction to send the configuration monitoring instruction to the first input manager.
[0180] The configuration monitoring instruction is used to instruct configuration of keyboard and mouse event monitors for the first input management service and the first phone window manager.
[0181] Step 809: The first input manager configures a keyboard and mouse event listener for the first input management service according to the configuration listening instruction.
[0182] Step 810: The first input manager configures a keyboard and mouse event listener for the first phone window manager according to the configuration monitoring instruction.
[0183] Afterwards, the first input management service can monitor mouse events through the keyboard and mouse event listener, and the first phone window manager can monitor key events through the keyboard and mouse event listener, where the key events include keyboard events.
[0184] Step 811: The user moves the mouse.
[0185] For example, the user can control the mouse cursor to cross by moving the mouse, that is, control the mouse cursor to move outside the screen of the tablet.
[0186] Step 812: The input reader reads mouse event 1.
[0187] After the user moves the mouse, the input reader can read mouse event 1. Mouse event 1 is the mouse event triggered by the user moving the mouse.
[0188] Step 813: The input reader calls the input distributor and sends mouse event 1 to the input distributor.
[0189] For example, the input reader may call the mouse notification method of the input dispatcher to process mouse event 1 through the mouse notification method.
[0190] Step 814: The input distributor sends mouse event 1 to the first input management service.
[0191] For example, the input distributor may send mouse event 1 to the first input management service through a mouse notification method based on the keyboard and mouse event listener configured by the first input manager.
[0192] In addition, the input distributor may also distribute mouse event 1 so that the tablet responds to mouse event 1 .
[0193] Step 815: The first input management service sends mouse event 1 to the keyboard and mouse sharing service.
[0194] After receiving the mouse event 1, the first input management service may send the mouse event 1 to the keyboard and mouse sharing service.
[0195] After receiving mouse event 1, the keyboard and mouse sharing service can determine whether the mouse cursor has crossed based on mouse event 1. If so, step 817 and subsequent steps are executed. If not, no processing is performed, that is, step 817 and subsequent steps are not executed, and the service continues to receive mouse events reported by the first input management service and determines whether the mouse cursor has crossed based on the reported mouse events.
[0196] Step 816 : The keyboard and mouse sharing service determines the mouse cursor crossing according to mouse event 1 .
[0197] After the keyboard and mouse sharing service determines that the mouse cursor has crossed, the keyboard and mouse sharing status stored in the input reader, the first input management service, and the first phone window manager may be updated. For example, the status update may be implemented through the following steps 817 to 822.
[0198] By updating the keyboard and mouse sharing status stored in the first input management service, the first input management service can be configured to intercept mouse events. By updating the keyboard and mouse sharing status stored in the first phone window manager, the first phone window manager can be configured to intercept keyboard events.
[0199] After the keyboard and mouse sharing service determines that the mouse cursor has crossed based on mouse event 1, the keyboard and mouse sharing service may also send mouse event 1 to the PC, which then responds to mouse event 1. In response to mouse event 1, the PC may display the mouse pointer at a fixed position on the screen, such as in the center of the screen. Alternatively, in response to mouse event 1, the PC may display the mouse pointer on the screen based on the offset of mouse event 1, although this is not limited in this embodiment of the present application.
[0200] For example, the keyboard and mouse sharing service may send mouse event 1 to the event receiving module of the PC, and then the event receiving module sends mouse event 1 to the event response module, and the event response module responds to mouse event 1.
[0201] Step 817: The keyboard and mouse sharing service sends the keyboard and mouse sharing state 2 to the input reader. The keyboard and mouse sharing state 2 is used to indicate that the mouse cursor has crossed.
[0202] Step 818: The input reader disables the mouse cursor drawing function according to the keyboard and mouse sharing state 2.
[0203] After receiving the keyboard and mouse sharing state 2 , the input reader may also update the stored keyboard and mouse sharing state according to the keyboard and mouse sharing state 2 , for example, updating the stored keyboard and mouse sharing state from the keyboard and mouse sharing state 1 to the keyboard and mouse sharing state 2 .
[0204] In an embodiment of the present application, the input reader can control the turning on and off of the mouse cursor drawing function according to the keyboard and mouse sharing state. For example, when the keyboard and mouse sharing state is keyboard and mouse sharing state 1, the input reader can keep the mouse cursor drawing function in the turned on state, and when the keyboard and mouse sharing state is keyboard and mouse sharing state 2, the input reader can keep the mouse cursor drawing function in the turned off state. If the input reader detects that the keyboard and mouse sharing state has switched to keyboard and mouse sharing state 2, the input reader can turn off the mouse cursor drawing function, and if the input reader detects that the keyboard and mouse sharing state has switched from keyboard and mouse sharing state 2 to another state, the input reader can turn on the mouse cursor drawing function.
[0205] Step 819: The keyboard and mouse sharing service sends the keyboard and mouse sharing status 2 to the first input management service.
[0206] The keyboard and mouse sharing service may call the first input manager, and send the keyboard and mouse sharing state 2 to the first input management service through the first input manager.
[0207] Step 820: After receiving the keyboard and mouse sharing state, the first input management service updates the stored keyboard and mouse sharing state to keyboard and mouse sharing state 2.
[0208] For example, the first input management service updates the stored keyboard and mouse sharing state 1 to keyboard and mouse sharing state 2.
[0209] In an embodiment of the present application, the first input management service can control the first input management service to enable or disable a function of intercepting mouse events based on the keyboard and mouse sharing state. The function of intercepting mouse events refers to the first input management service sending the monitored mouse events to the keyboard and mouse sharing service, or sending the monitored mouse events to the keyboard and mouse sharing service, and controlling the tablet to not respond to the monitored mouse events.
[0210] Step 821: The keyboard and mouse sharing service sends the keyboard and mouse sharing status 2 to the first phone window manager.
[0211] The keyboard and mouse sharing service may call the first input manager, and send the keyboard and mouse sharing state 2 to the first phone window manager through the first input manager.
[0212] Step 822: The first phone window manager updates the stored keyboard and mouse sharing state to keyboard and mouse sharing state 2.
[0213] In an embodiment of the present application, the first phone window manager can control the first phone window manager to enable or disable a function of intercepting keyboard events based on the keyboard and mouse sharing state. The function of intercepting keyboard events refers to the first phone window manager sending the monitored keyboard events to the keyboard and mouse sharing service, or sending the monitored keyboard events to the keyboard and mouse sharing service, and controlling the tablet to not respond to the monitored keyboard events.
[0214] After the first input management service updates the keyboard and mouse sharing state to keyboard and mouse sharing state 2, it can enable the function of intercepting mouse events based on keyboard and mouse sharing state 2 and subsequently intercept mouse events. After the first phone window manager updates the keyboard and mouse sharing state to keyboard and mouse sharing state 2, it can enable the function of intercepting keyboard events based on keyboard and mouse sharing state 2 and subsequently intercept keyboard events.
[0215] As shown in FIG9 , the process of the first input management service intercepting mouse events and the first phone window manager intercepting keyboard events may include the following steps:
[0216] Step 823: The user moves the mouse.
[0217] Step 824: The input reader reads mouse event 2.
[0218] After the input reader reads mouse event 2, it can send mouse event 2 to the first input management service through the keyboard and mouse event listener configured by the first input management service. For example, the input reader can call the input dispatcher, and the input dispatcher can send mouse event 2 to the first input management service based on the keyboard and mouse event listener configured by the first input management service.
[0219] For example, the input reader may call the mouse notification method of the input distributor, and send the mouse event 2 to the first input management service based on the keyboard and mouse event listener configured by the first input management service through the mouse notification method.
[0220] Step 825: The input reader sends mouse event 2 to the input distributor.
[0221] Step 826: The input distributor sends mouse event 2 to the first input management service through the keyboard and mouse event listener configured by the first input management service.
[0222] For example, the input distributor may send the mouse event 2 to the first input management service through the mouse notification method based on the keyboard and mouse event listener configured by the first input management service.
[0223] After the first input management service receives mouse event 2, if it detects that the mouse sharing state is keyboard and mouse sharing state 2, on the one hand, it can send mouse event 2 to the keyboard and mouse sharing service, and on the other hand, it can send an instruction to stop event distribution to the input distributor, so that the input distributor stops distributing mouse event 2.
[0224] Step 827: The first input management service sends mouse event 2 to the keyboard and mouse sharing service according to the keyboard and mouse sharing state 2.
[0225] Step 828: The keyboard and mouse sharing service sends mouse event 2 to the event receiving module of the PC.
[0226] Step 829: The event receiving module of the PC sends mouse event 2 to the event responding module of the PC.
[0227] Step 830: The event response module of the PC responds to mouse event 2.
[0228] Step 831: The first input management service sends a stop distribution instruction 1 to the input distributor according to the keyboard and mouse sharing state 1.
[0229] The stop distribution instruction 1 is used to instruct the input distributor to stop distributing mouse events.
[0230] Step 832: The input distributor stops distributing mouse event 2 according to the stop distribution instruction 1, so that the tablet does not respond to mouse event 2.
[0231] Typically, for example, when the keyboard and mouse sharing state is in a state other than keyboard and mouse sharing state 2, after receiving a mouse event, the input distributor can distribute the mouse event to the response module corresponding to the mouse event in the tablet, and the response module can respond to the mouse event, thereby enabling the tablet to respond to the mouse event. In the embodiment of the present application, in order to control the tablet to not respond to mouse event 2, a stop distribution instruction can be sent to the input distributor to prevent the input distributor from distributing mouse event 2.
[0232] After step 832 , the tablet may loop through steps 824 to 832 to intercept and forward the next mouse event.
[0233] Step 833: The user presses a keyboard key.
[0234] Step 834: The input reader reads keyboard event 1.
[0235] After the input reader reads keyboard event 1, it can send mouse event 1 to the first phone window manager via the keyboard and mouse event listener configured by the first phone window manager. For example, the input reader can call an input dispatcher, which, through the input dispatcher, sends keyboard event 1 to the first phone window manager based on the keyboard and mouse event listener configured by the first phone window manager.
[0236] For example, the input reader may call the keyboard notification method of the input distributor, and send keyboard event 1 to the first phone window manager based on the keyboard and mouse event listener configured by the first phone window manager through the keyboard notification method.
[0237] Step 835: The input reader sends keyboard event 1 to the input distributor.
[0238] For example, the input distributor may send keyboard event 1 to the first input management service through a mouse notification method based on the keyboard and mouse event listener configured by the first input management service.
[0239] Step 836: The input distributor sends keyboard event 1 to the first phone window manager through the keyboard and mouse event listener configured by the first phone window manager.
[0240] After the input distributor sends the keyboard event 1 to the first phone window manager, the first phone window manager may receive the keyboard event 1 through a configured keyboard event listener.
[0241] After the first phone window manager receives keyboard event 1, if it detects that the mouse sharing state is keyboard and mouse sharing state 2, it can send keyboard event 1 to the keyboard and mouse sharing service on the one hand, and on the other hand, it can send an instruction to stop event distribution to the input distributor, so that the input distributor stops distributing keyboard event 1.
[0242] Step 837: The first phone window manager sends keyboard event 1 to the keyboard and mouse sharing service according to the keyboard and mouse sharing state 2.
[0243] Step 838: The keyboard and mouse sharing service sends keyboard event 1 to the event receiving module of the PC.
[0244] Step 839: The event receiving module of the PC sends keyboard event 1 to the event responding module of the PC.
[0245] Step 840: The event response module of the PC responds to keyboard event 1.
[0246] Step 841: The first phone window manager sends a stop distribution instruction 2 to the input distributor according to the keyboard and mouse sharing state 2.
[0247] The stop distribution instruction 2 is used to instruct the input distributor to stop distributing keyboard events.
[0248] Step 842: The input distributor stops distributing keyboard event 1 according to the stop distribution instruction 2, so that the tablet does not respond to keyboard event 1.
[0249] Under normal circumstances, for example, when the keyboard and mouse sharing state is in a state other than keyboard and mouse sharing state 2, after receiving a keyboard event, the input distributor can distribute the keyboard event to the response module corresponding to the keyboard event in the tablet, and the response module can respond to the keyboard event, thereby realizing the tablet's response to the keyboard event. In this embodiment of the present application, in order to control the tablet to not respond to keyboard event 1, a stop distribution instruction can be sent to the input distributor to prevent the input distributor from distributing keyboard event 1.
[0250] After step 842 , the tablet may loop through steps 834 to 843 to intercept and forward the next keyboard event.
[0251] It should be noted that after configuring the keyboard and mouse event listener, the first phone window manager can monitor not only keyboard events but also other key events. Key events, in addition to keyboard events, can also include other key events, such as system key events. System key events refer to key events of the tablet's native keys, such as the tablet's built-in power button, volume button, and so on. After the first phone window manager monitors a key event, it can also first determine whether the key event is a keyboard event. If so, it executes the interception and forwarding mechanism described above. If not, it does not execute the interception and forwarding mechanism described above.
[0252] For example, after the input reader reads a key event, the key event can be sent to the first phone window manager, such as by sending the key event to the first phone window manager through the input distributor. After the first phone window manager uses the configured keyboard and mouse event listener, it can first determine whether the key event is a keyboard event. If so, there are two cases: the first case is that when the keyboard and mouse sharing state is keyboard and mouse sharing state 2, the keyboard event is sent to the keyboard and mouse sharing service, and the tablet is controlled not to respond to the keyboard event; the second case is that when the keyboard and mouse sharing state is other than keyboard and mouse sharing state 2, the keyboard event is not sent to the keyboard and mouse sharing service, or the keyboard event is sent to the keyboard and mouse sharing service, and the tablet is not controlled not to respond to the keyboard event. In addition, if the keyboard and mouse sharing state is not, the keyboard event is not sent to the keyboard and mouse sharing service, or the keyboard event is sent to the keyboard and mouse sharing service, and the tablet is not controlled not to respond to the keyboard event.
[0253] In addition, after step 842, when the user moves the mouse to control the mouse cursor to traverse in the reverse direction, the tablet no longer forwards the input event to the PC, but instead responds on its own. For example, the keyboard and mouse sharing service no longer forwards mouse events sent from the first input management service or keyboard events sent from the first phone window manager to the PC. In addition, the keyboard and mouse sharing service can also update the status of the input reader, the first input management service, and the first phone window manager based on the current keyboard and mouse sharing status. Reverse traversal of the mouse cursor refers to the mouse cursor moving outside the PC screen, such as outside the left or right border of the PC screen.
[0254] For example, after step 842, the first input management service sends the monitored mouse event 3 to the keyboard and mouse sharing service. If the keyboard and mouse sharing service determines that the mouse cursor has crossed in the opposite direction based on mouse event 3, the input event forwarding function is turned off, that is, the mouse events or keyboard events after mouse event 3 are no longer forwarded to the PC. For mouse event 3, the keyboard and mouse sharing service may forward it to the PC or not, and this embodiment of the present application does not limit this. In addition, the keyboard and mouse sharing service may also control the input reader to enable the mouse cursor drawing function, and may also control the input distributor to start event distribution for received input events. For example, the keyboard and mouse sharing service may update the status of the input reader, the first input management service, and the first phone window manager based on the current keyboard and mouse sharing status, and through the status update, control the input reader to enable the mouse cursor drawing function, and control the input distributor to start event distribution for received input events.
[0255] It should be noted that the order of step numbering in the embodiments of the present application does not limit the order of step execution. Some steps can be executed sequentially or in parallel, and the embodiments of the present application do not limit this.
[0256] Figure 10 shows a schematic diagram of the structure of an electronic device, which is a second electronic device, such as the computer 102 or mobile phone 103 shown in Figure 1. The operating system of the second electronic device can be Android or Windows. Referring to Figure 9, the electronic device includes at least one processor 201, a communication bus 202, a memory 203, and at least one communication interface 204.
[0257] The processor 201 may be a microprocessor (including a central processing unit (CPU) etc.), an application-specific integrated circuit (ASIC), or may be one or more integrated circuits for controlling the execution of the program of the present application.
[0258] The communication bus 202 may include a pathway for transmitting information between the aforementioned components.
[0259] The memory 203 may be a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable read-only memory (EEPROM), an optical disc (including a compact disc read-only memory (CD-ROM), a compact disc, a laser disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 203 may exist independently and be connected to the processor 201 via the communication bus 202. The memory 203 may also be integrated with the processor 201.
[0260] The communication interface 204 uses any device such as a transceiver to communicate with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc.
[0261] In a specific implementation, as an embodiment, the processor 201 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG9 .
[0262] In a specific implementation, as an embodiment, an electronic device may include multiple processors, such as processor 201 and processor 205 shown in Figure 9. Each of these processors may be a single-core processor or a multi-core processor. The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0263] In a specific implementation, as an embodiment, the electronic device may further include an output device 206 and an input device 207. The output device 206 communicates with the processor 201 and can display information in a variety of ways. For example, the output device 206 can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 207 communicates with the processor 201 and can receive user input in a variety of ways. For example, the input device 207 can be a mouse, a keyboard, a touch screen device, or a sensor device.
[0264] The electronic device can be a general-purpose electronic device or a dedicated electronic device. In a specific implementation, the electronic device can be a desktop computer, a portable computer, a network server, a PDA, a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device. The embodiments of the present application do not limit the type of electronic device.
[0265] The memory 203 is used to store the program code 210 for executing the solution of the present application, and the processor 201 is used to execute the program code 210 stored in the memory 203. The electronic device can implement the method of sharing the input device provided in the above embodiment through the processor 201 and the program code 210 in the memory 203.
[0266] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (such as a coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0267] The above are optional embodiments provided for this application and are not intended to limit this application. Any modifications, equivalent replacements, improvements, etc. made within the technical scope disclosed in this application should be included in the scope of protection of this application.
Claims
1. A method for sharing an input device, characterized in that: Applied to a first electronic device, the first electronic device is connected to an input device for inputting control instructions, the operating system of the first electronic device includes a keyboard and mouse sharing service and an input management module, the keyboard and mouse sharing service is used to implement a service of sharing the input device between the first electronic device and other electronic devices, and the input management module is used to manage input events of the first electronic device; the method includes: In response to the first operation, the keyboard and mouse sharing service is started; The keyboard and mouse sharing service triggers the input management module to monitor input events of the input device; In response to a second operation, the keyboard and mouse sharing service controls the screen of the first electronic device to stop displaying the mouse cursor, and sends an interception instruction to the input management module, wherein the second operation is used to trigger the second electronic device to share the input device of the first electronic device; The input management module sends the monitored first input event to the keyboard and mouse sharing service according to the interception instruction; The keyboard and mouse sharing service receives the first input event, and sends the first input event to the second electronic device, so that the second electronic device responds to the first input event.
2. The method according to claim 1, characterized in that The keyboard and mouse sharing service triggers the input management module to monitor input events of the input device, including: The keyboard and mouse sharing service configures an input event listener for the input management module; The input management module monitors input events of the input device through the configured input event listener.
3. The method according to claim 2, characterized in that The input device includes a mouse device, and the input management module includes a first input management service; The keyboard and mouse sharing service configures an input event listener for the input management module, including: The keyboard and mouse sharing service configures a keyboard and mouse event listener for the first input management service; The input management module monitors the input event of the input device through the configured input event listener, including: The input management service monitors mouse events through the configured keyboard and mouse event listener, and the mouse events refer to input events of the mouse device.
4. The method according to claim 2 or 3, characterized in that The input device includes a keyboard device, and the input management module includes a first phone window manager; The keyboard and mouse sharing service configures an input event listener for the input management module, including: The keyboard and mouse sharing service configures a keyboard and mouse event listener for the first phone window manager; The input management module monitors the input event of the input device through the configured input event listener, including: The first telephone window manager monitors key events through the configured keyboard and mouse event listener, and the key events include keyboard events, and the keyboard events refer to key events of the keyboard device.
5. The method according to any one of claims 1 to 4, characterized in that: After the keyboard and mouse sharing service sends the interception instruction to the input management module, the method further includes: The input management module controls the first electronic device not to intercept the first input Respond to events.
6. The method according to claim 5, characterized in that The operating system further comprises an input distributor, wherein the input distributor is used to distribute input events; The input management module controls the first electronic device not to respond to the first input event, including: The input management module sends a stop distribution instruction to the input distributor; The input distributor does not distribute the first input event according to the stop distribution instruction, so that the first electronic device does not respond to the first input event.
7. The method according to claim 6, characterized in that The input device includes a mouse device, the first input event is a first mouse event, and the input management module includes a first input management service; The first input management service sends a first stop distribution instruction to the input distributor; The input distributor does not distribute the first mouse event according to the first stop distribution instruction, so that the first electronic device does not respond to the first mouse event.
8. The method according to claim 6, characterized in that The input device includes a keyboard device, the first input event is a first keyboard event, and the input management module includes a first telephone window manager; The first telephone window manager sends a second stop distribution instruction to the input distributor; The input distributor does not distribute the first keyboard event according to the second stop distribution instruction, so that the first electronic device does not respond to the first keyboard event.
9. The method according to any one of claims 1 to 8, characterized in that: The input device includes a keyboard device, the input management module includes a first phone window manager, and before the input management module sends the monitored first input event to the keyboard and mouse sharing service, the input management module further includes: The first telephone window manager monitors a first key event; The first telephone window manager determines whether the first key event is a keyboard event, where the keyboard event refers to a key event of the keyboard device; The input management module sends the monitored first input event to the keyboard and mouse sharing service, including: If the input management module determines that the first key event is the keyboard event, the input management module sends the first key event to the keyboard and mouse sharing service.
10. The method according to claim 9, characterized in that The method further comprises: If the input management module determines that the first key event is not the keyboard event, the first key event is not sent to the keyboard and mouse sharing service.
11. The method according to any one of claims 1 to 10, characterized in that: The input device includes a mouse device, the first input event is a first mouse event of the mouse device, and the input management module includes a first input management service; The input management module sends the monitored first input event to the keyboard and mouse sharing service according to the interception instruction, including: The first input management service sends the monitored first mouse event to the keyboard and mouse sharing service according to the interception instruction; The keyboard and mouse sharing service receives the first input event, and sends the first input event to the second electronic device, so that the second electronic device responds to the first input event, including: The keyboard and mouse sharing service receives the first mouse event and sends the first mouse event to the second electronic device, so that the second electronic device responds to the first mouse event.
12. The method according to any one of claims 1 to 10, characterized in that: The input device includes a keyboard device, the first input event is a first keyboard event of the keyboard device, and the input management module includes a first telephone window manager; The input management module sends the monitored first input event to the keyboard and mouse sharing service according to the interception instruction, including: The first telephone window manager sends the monitored first keyboard event to the keyboard and mouse sharing service according to the interception instruction; The keyboard and mouse sharing service receives the first input event, and sends the first input event to the second electronic device, so that the second electronic device responds to the first input event, including: The keyboard and mouse sharing service receives the first keyboard event, and sends the first keyboard event to the second electronic device, so that the second electronic device responds to the first keyboard event.
13. The method according to any one of claims 1 to 12, characterized in that: The method further comprises: If the keyboard and mouse sharing service detects that the first electronic device is connected to the second electronic device, the step of triggering the input management module to monitor input events of the input device is executed.
14. The method according to claim 13, characterized in that The operating system further includes an input reader, the input reader being used to read input events and to enable or disable a mouse cursor drawing function; After the keyboard and mouse sharing service detects that the first electronic device is connected to the second electronic device, the method further includes: The keyboard and mouse sharing service sends first keyboard and mouse sharing state information to the input reader, where the first keyboard and mouse sharing state information is used to indicate that the first electronic device is connected to the second electronic device.
15. The method according to any one of claims 1 to 14, wherein the interception instruction is second keyboard and mouse sharing state information, and the second keyboard and mouse sharing state information is used to instruct the second electronic device to share the input device of the first electronic device.
16. The method according to any one of claims 1 to 15, characterized in that: The operating system further includes an input reader, the input reader being used to read input events and to enable or disable a mouse cursor drawing function; The keyboard and mouse sharing service controls the screen of the first electronic device to stop displaying the mouse cursor, including: The keyboard and mouse sharing service sends a first control instruction to the input reader; The input reader turns off the drawing function of the mouse cursor according to the first control instruction, so that the screen of the first electronic device stops displaying the mouse cursor.
17. The method according to claim 16, characterized in that The first control instruction is second keyboard and mouse sharing state information, and the second keyboard and mouse sharing state information is used to instruct the second electronic device to share the input device of the first electronic device.
18. The method according to any one of claims 1 to 17, characterized in that: The operating system further includes an input reader and an input distributor, wherein the input reader is used to read input events, and the input distributor is used to distribute input events; Before the input management module sends the monitored first input event to the keyboard and mouse sharing service, the input management module further includes: The input reader reads the first input event; The input reader calls the input event notification method of the input distributor, and sends the first input event to the input management module through the input event notification method.
19. The method according to any one of claims 1 to 18, characterized in that: The keyboard and mouse sharing service triggers the input management module to monitor input events of the input device, including: The keyboard and mouse sharing service triggers the input management module to monitor input events of the input device, and sends the monitored input events to the keyboard and mouse sharing service; The keyboard and mouse sharing service controls the screen of the first electronic device to stop displaying the mouse cursor, before sending an interception instruction to the input management module, further comprising: The input management module monitors a second input event; The input management module sends the second input event to the keyboard and mouse sharing service; The keyboard and mouse sharing service receives the second input event; If the keyboard and mouse sharing service determines that the mouse cursor crosses according to the second input event, the keyboard and mouse sharing service determines that the second operation is received, and the mouse cursor crosses when the mouse cursor of the first electronic device moves outside the screen of the first electronic device.
20. An electronic device, characterized in that: The electronic device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the method according to any one of claims 1 to 19 when executed by the processor.
21. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 19.
22. A method for sharing an input device, characterized in that: Applied to a first electronic device, the first electronic device is a mobile phone or a tablet computer, the first electronic device is connected to an input device for inputting control instructions, the input device at least includes a mouse, and the method includes: In response to the first operation, starting the keyboard and mouse sharing function; receiving a first input event of the input device; In response to the received first input event not being a mouse crossing event in which a mouse cursor corresponding to the mouse moves out of the screen from a side of the screen, displaying a mouse cursor corresponding to the mouse on a screen of the first electronic device, and distributing the first input event to a response object corresponding to the first input event; In response to the received first input event being the mouse cursor crossing event, the screen of the first electronic device stops displaying the mouse cursor corresponding to the mouse and intercepts the first input event; The intercepted first input event is sent to a second electronic device that shares a keyboard and mouse with the first electronic device, so that the second electronic device responds to the first input event.
23. The method of claim 22, wherein: Before the keyboard and mouse sharing function is started in response to the first operation, the method further includes: Displaying a first interface, wherein the first interface includes a switch control for a keyboard and mouse sharing service; In response to the first operation, starting the keyboard and mouse sharing function includes: In response to a click operation on the switch control of the keyboard and mouse sharing service, the keyboard and mouse sharing function is started.
24. The method according to claim 22 or 23, characterized in that After starting the keyboard and mouse sharing function, the method further includes: The second interface is displayed, and the second interface includes device identifications of available devices, and the available devices include at least the second device; In response to a click operation on the device identifier of the second device, a connection is established with the second electronic device, so that the second electronic device can share the keyboard and mouse with the first electronic device.
25. The method according to any one of claims 22 to 24, characterized in that: The operating system of the first electronic device includes a keyboard and mouse sharing service and an input management module, and the starting of the keyboard and mouse sharing function in response to the first operation includes: In response to the first operation, starting the keyboard and mouse sharing service; The keyboard and mouse sharing service triggers the input management module to monitor input events of the input device; In response to the received first input event being the mouse cursor crossing event, the screen of the first electronic device stops displaying the mouse cursor corresponding to the mouse, intercepts the first input event, and sends the intercepted first input event to a second electronic device that shares a keyboard and mouse with the first electronic device, including: In response to the received first input event being the mouse cursor crossing event, the keyboard and mouse sharing service controls the screen of the first electronic device to stop displaying the mouse cursor, and sends an interception instruction to the input management module; The input management module sends the monitored first input event to the keyboard and mouse sharing service according to the interception instruction; The keyboard and mouse sharing service receives the first input event and sends the first input event to the second electronic device.
26. The method of claim 25, wherein: The keyboard and mouse sharing service triggers the input management module to monitor input events of the input device, including: The keyboard and mouse sharing service configures an input event listener for the input management module; The input management module monitors the input events of the input device through the configured input event listener.
27. The method of claim 26, wherein: The input management module includes a first input management service; The keyboard and mouse sharing service configures an input event listener for the input management module, including: The keyboard and mouse sharing service configures a keyboard and mouse event listener for the first input management service; The input management module monitors the input event of the input device through the configured input event listener, including: The input management service monitors the mouse events of the mouse through the configured keyboard and mouse event listener.
28. The method of claim 26, wherein: The input device further comprises a keyboard device, and the input management module comprises a first telephone window manager; The keyboard and mouse sharing service configures an input event listener for the input management module, including: The keyboard and mouse sharing service configures a keyboard and mouse event listener for the first phone window manager; The input management module monitors the input event of the input device through the configured input event listener, including: The first telephone window manager monitors key events through the configured keyboard and mouse event listener, and the key events include keyboard events of the keyboard device.
29. The method according to any one of claims 25 to 28, characterized in that: After the keyboard and mouse sharing service sends the interception instruction to the input management module, the method further includes: The input management module controls the first electronic device not to respond to the first input event according to the interception instruction.
30. The method of claim 29, wherein: The operating system also includes an input distributor; The input management module controls the first electronic device not to respond to the first input event, including: The input management module sends a stop distribution instruction to the input distributor; The input distributor does not distribute the first input event according to the stop distribution instruction, so that the first electronic device does not respond to the first input event.
31. The method of claim 30, wherein: The first input event is a first mouse event, and the input management module includes a first input management service; The first input management service sends a first stop distribution instruction to the input distributor; The input distributor does not distribute the first mouse event according to the first stop distribution instruction, so that the first electronic device does not respond to the first mouse event.
32. The method of claim 30, wherein: The first input event is a first keyboard event, and the input management module includes a first phone window manager; The first telephone window manager sends a second stop distribution instruction to the input distributor; The input distributor does not distribute the first keyboard event according to the second stop distribution instruction, so that the first electronic device does not respond to the first keyboard event.
33. The method according to any one of claims 25 to 32, characterized in that: The first input event is a first key event, the input management module includes a first phone window manager, and before the input management module sends the monitored first input event to the keyboard and mouse sharing service, the input management module further includes: The first telephone window manager monitors the first key event; The first telephone window manager determines whether the first key event is a keyboard event; The input management module sends the monitored first input event to the keyboard and mouse sharing service, including: If the input management module determines that the first key event is the keyboard event, the input management module sends the first key event to the keyboard and mouse sharing service.
34. The method of claim 33, wherein: The method further comprises: If the input management module determines that the first key event is not the keyboard event, the first key event is not sent to the keyboard and mouse sharing service.
35. The method according to any one of claims 25 to 34, characterized in that: The first input event is a first mouse event, and the input management module includes a first input management service; The input management module sends the monitored first input event to the keyboard and mouse sharing service according to the interception instruction, including: The first input management service sends the monitored first mouse event to the keyboard and mouse sharing service according to the interception instruction; The keyboard and mouse sharing service receives the first input event, and sends the first input event to the second electronic device, so that the second electronic device responds to the first input event, including: The keyboard and mouse sharing service receives the first mouse event and sends the first mouse event to the second electronic device, so that the second electronic device responds to the first mouse event.
36. The method according to any one of claims 25 to 34, characterized in that: The first input event is a first keyboard event, and the input management module includes a first phone window manager; The input management module sends the monitored first input event to the keyboard and mouse sharing service according to the interception instruction, including: The first telephone window manager sends the monitored first keyboard event to the keyboard and mouse sharing service according to the interception instruction; The keyboard and mouse sharing service receives the first input event, and sends the first input event to the second electronic device, so that the second electronic device responds to the first input event, including: The keyboard and mouse sharing service receives the first keyboard event, and sends the first keyboard event to the second electronic device, so that the second electronic device responds to the first keyboard event.
37. The method according to any one of claims 25 to 36, characterized in that: The method further comprises: If the keyboard and mouse sharing service detects that the first electronic device is connected to the second electronic device, the step of triggering the input management module to monitor input events of the input device is executed.
38. The method of claim 37, wherein: The operating system also includes an input reader; After the keyboard and mouse sharing service detects that the first electronic device is connected to the second electronic device, the method further includes: The keyboard and mouse sharing service sends first keyboard and mouse sharing state information to the input reader, where the first keyboard and mouse sharing state information is used to indicate that the first electronic device is connected to the second electronic device.
39. The method according to any one of claims 25 to 38, wherein the interception instruction is second keyboard and mouse sharing state information, and the second keyboard and mouse sharing state information is used to indicate that the second electronic device shares the input device of the first electronic device.
40. The method according to any one of claims 25 to 39, characterized in that: The operating system also includes an input reader; The keyboard and mouse sharing service controls the screen of the first electronic device to stop displaying the mouse cursor, including: The keyboard and mouse sharing service sends a first control instruction to the input reader; The input reader turns off the drawing function of the mouse cursor according to the first control instruction, so that the screen of the first electronic device stops displaying the mouse cursor.
41. The method of claim 40, wherein: The first control instruction is second keyboard and mouse sharing state information, and the second keyboard and mouse sharing state information is used to instruct the second electronic device to share the input device of the first electronic device.
42. The method according to any one of claims 25 to 41, characterized in that: The operating system also includes an input reader and an input distributor; Before the input management module sends the monitored first input event to the keyboard and mouse sharing service, the method further includes: The input reader reads the first input event; The input reader calls the input event notification method of the input distributor, and sends the first input event to the input management module through the input event notification method.
Citation Information
Patent Citations
Mouse and keyboard sharing method and system
CN103425408A
Method and apparatus based on shared peripheral operation among multiple devices
CN107360543A
Method and device for sharing a mouse among multiple pieces of equipment, terminal equipment and storage medium
CN113377272A
Cross-device object dragging method and device
CN114089900A
Cross-device object dragging method and device
CN114089901A
Cited By
Input device sharing method and system based on multiple hosts
CN119718151A
A method and device for implementing a secure keyboard based on a honkong system
CN122691470A