Input device sharing method, 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
- CN202310801731.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2043-06-30
AI Technical Summary
The input devices between existing terminal devices are independent, resulting in frequent switching between different devices, which is cumbersome and not conducive to user experience.
Configure the key-and-mouse sharing service and input management module in the operating system to realize the sharing of input devices between multiple devices. By listening and intercepting input events, the events are forwarded to the counterpart devices, and users can avoid switching back and forth between different devices.
It simplifies user operations, improves input efficiency and user experience, and is suitable for a variety of operating system scenarios such as Android system.
Smart Images

Figure CN119225542A_ABST
Abstract
Description
Technical Field
[0001] 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
[0002] With the development of terminal technology, the types and number of terminal devices are increasing. Among them, the terminal devices may include: mobile phones, tablets, computers, and wearable devices. At present, one terminal device can no longer meet the needs of users. Users can use multiple terminal devices, such as mobile phones, tablets, and computers to meet the needs of work and study. However, since each terminal device is independent and each terminal device has its own matching input device, when multiple terminal devices have business that needs to be handled by the user, the user needs to switch back and forth between the input devices of different terminal devices, which is cumbersome and not conducive to user experience. Summary of the invention
[0003] The present application provides a method for sharing an input device, an electronic device, and a storage medium, which can realize sharing of input devices among multiple devices, so that a user can use the same input device to control multiple devices, avoiding switching operations back and forth between different input devices, thereby simplifying the user's operation and improving input efficiency. The technical solution is as follows:
[0004] In a first aspect, a method for sharing an input device is provided, which is applied to a first electronic device, wherein the first electronic device is connected to an input device for inputting a control command and is a source device for sharing the input device. The first electronic device is configured with a keyboard and mouse sharing service and an input management module in an operating system, wherein 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.
[0005] After the keyboard and mouse sharing service is started, the input management module can be triggered to monitor input events of the input device. Afterwards, if an 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.
[0006] By configuring the keyboard and mouse sharing service and input management module in the operating system of the source device, the input events of the source device are monitored and intercepted through the keyboard and mouse sharing service and input management module, and then forwarded to the peer device after interception, so that the peer device responds to the input events of the source device, and the source device and the peer device share the input device, so that the user can use the same input device to control multiple devices, avoiding switching operations between different input devices, thereby simplifying the user's operation and improving input efficiency and user experience. Moreover, this solution is applicable to source devices whose operating system is the Android system, expanding the application scenarios of shared input devices.
[0007] 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.
[0008] 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 other devices 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 other devices for use, and if the mouse cursor does not cross, it indicates that the input device is not switched to other devices 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.
[0009] 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 listen to the input events of the input device through the configured input event listener. By configuring the input event listener for the input management module, you can implement the listening of the input events of the input device.
[0010] In some embodiments, after the keyboard and mouse sharing service is started, an input event listener may be configured for the input management module.
[0011] In some embodiments, after the keyboard and mouse sharing service is started, when it is detected that the first electronic device is connected to the second electronic device, an input event listener can be configured for the input management module. By configuring the input event listener for the input management module when it is detected that the first electronic device is connected to the second electronic device, the monitoring of the input event is triggered, which can save monitoring power consumption and avoid meaningless monitoring.
[0012] The input management module may include a first input management service and a first phone window manager. The first input management service is used to monitor mouse events, and may 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 click events, movement events, or wheel scrolling events of a mouse device. The first input management service is an input management service extended based on the system's native input management service, and extends the functions of monitoring and intercepting mouse events based on the functions of the system's native input management service.
[0013] The first phone window manager is used to monitor keyboard events and can also send the monitored keyboard events to the keyboard and mouse sharing service. Keyboard events refer to key events of keyboard devices. The first phone window manager can be a phone window manager based on the system's native phone window manager or an extended phone window manager. On the basis of the functions of the system's native phone window manager, the functions of monitoring and intercepting keyboard events are expanded.
[0014] 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 listens to mouse events through the configured keyboard and mouse event listener. In this way, the monitoring of mouse events can be achieved.
[0015] 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.
[0016] In some embodiments, the input management module can also control the first electronic device not to respond to the first input event according to the interception instruction. In this way, it can be ensured that only the second electronic device responds to the first input event, avoiding the first electronic device and the second electronic device from responding to the first input event at the same time, thereby avoiding confusion in input event responses and improving the accuracy of using the input device to control the electronic device.
[0017] 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.
[0018] Under normal circumstances, for example, when the second electronic device does not share the state of 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 realizing the response of the first electronic device to the input event. In the 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 as to control the input distributor not to respond to the input event through the stop distribution instruction, thereby realizing the control of the first electronic device not to respond to the input event.
[0019] In some embodiments, the input management module includes a first input management service, and the first input management service can send a first stop distribution instruction to the input distributor according to the interception instruction, and the input distributor can stop distributing the mouse event according to the first stop distribution instruction. In this way, the first electronic device can be prevented from responding to the mouse event, thereby avoiding confusion in the response to the mouse event, improving the accuracy of responding to the mouse event, and thus improving the accuracy of the user controlling the device through the mouse.
[0020] In some embodiments, the input management module includes a first phone window manager, and the first phone window manager can send a second stop distribution instruction to the input distributor, and the input distributor can stop distributing mouse events according to the second stop distribution instruction. In this way, the first electronic device can be prevented from responding to mouse events, thereby avoiding confusion in responding to keyboard events, improving the accuracy of responding to keyboard events, and further improving the accuracy of users controlling the device through the keyboard.
[0021] 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, it is possible to intercept and forward only the key events of the external keyboard device of the first electronic device, and other key events, such as the system key events of the first electronic device, are still responded to by the first electronic device itself.
[0022] 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 key, a volume key, etc. of the first electronic device.
[0023] 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, it is possible to intercept and forward only the mouse events of the external mouse device of the first electronic device, and other mouse events, such as mouse events triggered by the touchpad, are still responded to by the first electronic device itself.
[0024] 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; the input reader 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.
[0025] In this way, the input reader can send the read input events to the input management module, and then the input management module can monitor the input events.
[0026] In some embodiments, the input reader may call a mouse notification method of the input distributor, and send the first mouse event to the first input management service through the input notification method. The input reader may call a keyboard notification method of the input distributor, and send the first keyboard event to the first phone window manager through the keyboard notification method.
[0027] In this way, the input reader can send the read mouse events to the first input management module and the read keyboard events to the first phone window manager, thereby monitoring the mouse events and keyboard events.
[0028] In some embodiments, after the keyboard and mouse sharing service is started, 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 is connected to the second electronic device, the input reader, the first input management service, and the first phone window manager may be initialized.
[0029] The operation of initializing the state for 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 tablet 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.
[0030] 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 to make the screen of the first electronic device stop displaying the mouse cursor.
[0031] In addition, if the keyboard and mouse sharing service detects that the keyboard and mouse sharing state has changed, it can 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.
[0032] 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.
[0033] For example, the first control instruction may be the 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, that is, 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 the second keyboard and mouse sharing state information.
[0034] 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 crosses according to the second input event, it determines that the operation of the second electronic device to share the first electronic device is 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. Among them, the mouse cursor crossing refers to the mouse cursor of the first electronic device moving outside the screen of the first electronic device, such as moving outside the left border of the screen, or moving outside the right border of the screen.
[0035] 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 border of the screen, or moving outside the right border of the screen, to switch the input device of the first electronic device to the second electronic device for use, which facilitates user operation and improves the flexibility and efficiency of shared input devices.
[0036] In a second aspect, a device for sharing an input device is provided, wherein the device for sharing an input device has the function of implementing the method for sharing an input device in the first aspect. The device for sharing an input device includes at least one module, wherein the at least one module is used to implement the method for sharing an input device provided in the first aspect.
[0037] In a third aspect, a device for sharing an input device is provided, wherein the structure of the device for sharing an input device includes a processor and a memory, wherein the memory is used to store a program that supports the device for sharing an input device to execute the method for sharing an input device provided in the first aspect, and to store data involved in implementing the method for sharing an input device in the first aspect. The processor is configured to execute the program stored in the memory. The device for sharing an input device may also include a communication bus, wherein the communication bus is used to establish a connection between the processor and the memory.
[0038] In a fourth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on a computer, the computer executes the method for sharing an input device as described in the first aspect.
[0039] 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.
[0040] 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
[0041] Figure 1 A schematic diagram of a communication system is shown;
[0042] Figure 2 A schematic diagram of keyboard and mouse traversal is shown;
[0043] Figure 3 A schematic diagram of reverse traversal of keyboard and mouse is shown;
[0044] Figure 4 A schematic diagram of an interface for setting keyboard and mouse sharing through a setting interface is shown;
[0045] Figure 5 A schematic diagram of the structure of a terminal is shown;
[0046] Figure 6 A block diagram of a software system of a terminal is shown;
[0047] Figure 7 A logical schematic diagram of implementing sharing of input devices between a tablet and a PC is shown;
[0048] Figure 8 A flow chart of a method for sharing an input device is shown;
[0049] Fig. 9 Another method flow chart of sharing input device is shown;
[0050] Fig.10 A structural schematic diagram of an electronic device is shown. DETAILED DESCRIPTION
[0051] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0052] It should be understood that the "multiple" mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solution of this application, the words "first" and "second" are used to distinguish the same or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not limit them to be different. In the description of the embodiments of this application, unless otherwise specified, the meaning of "multiple" refers to two or more. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.
[0053] Before explaining in detail the method for sharing an input device provided in the embodiment of the present application, the application scenario involved in the embodiment of the present application is first explained.
[0054] Multi-device collaboration is a distributed technology applied to multiple electronic devices. Using multi-device collaboration technology, two or more electronic devices can collaborate across systems and devices to achieve resource sharing and collaborative operation.
[0055] Multi-device collaboration can be applied to electronic devices of the same or different types. The types of electronic devices include but are not limited to mobile phones, tablet computers, laptops, large-screen devices (such as smart TVs, smart screens), personal computers (persona1computers, PCs), handheld computers, netbooks, personal digital assistants (personal digital assistants, PDAs), wearable electronic devices, vehicle-mounted devices, virtual reality devices, and other devices.
[0056] Multi-device collaboration needs to be implemented based on the communication connection between devices. The communication connection can be a wired communication connection or a wireless communication connection. Among them, the solution for wired communication connection can include USB On-The-Go (OTG) technology, for example; the solution for wireless communication can include wireless fidelity (Wi-Fi), Wi-Fi Direct (Wi-Fi Direct), Bluetooth (BT), near field communication (NFC), infrared technology (IR), etc.
[0057] With the continuous development of terminal technology, multi-device collaboration has produced many different types of collaboration, such as keyboard and mouse collaboration.
[0058] Keyboard and mouse collaboration: Keyboard and mouse collaboration refers to sharing input devices between multiple devices, such as sharing a mouse, keyboard, etc. For example, electronic device A and electronic device B share the input device of electronic device A, that is, the user can use the shared input device to input in electronic device A, and can also use the shared input device to input in electronic device B.
[0059] 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.
[0060] Please refer to Figure 1 , Figure 1 A schematic diagram of a communication system is shown. Figure 1 As shown, 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 system. 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 opposite devices or receiving ends, but the embodiments of the present application are not limited to this.
[0061] As shown in the figure, the tablet 101 is connected to input devices such as a mouse and a keyboard via a wired method, for example, via a USB interface. It should be understood that the tablet 101 can also be connected to input devices such as a mouse and a keyboard via a wireless method, for example, via a short-range wireless communication technology, which can be Wi-Fi or Bluetooth. It should also be understood that Figure 1 The input devices shared by multiple devices are only taken as a mouse and a keyboard as an example. The input devices can also be touch screen devices or sensor devices, etc. The embodiments of the present application do not limit the shared input devices.
[0062] In the case of sharing a keyboard and mouse, if the keyboard and mouse are switched between different devices, keyboard and mouse crossover can be achieved between the tablet 101 and the computer 102, and keyboard and mouse crossover can be achieved between the tablet 101 and the computer 102. For example, the left or right side of the tablet 101 can achieve keyboard and mouse crossover with a device, that is, the tablet 101 can support the mouse from the left side of the tablet 101 screen to another device, and can also support the mouse from the right side of the tablet 101 screen to another device. If the tablet 101 can achieve keyboard and mouse crossover 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 crossover with one device (computer 102 or mobile phone 103) at a time.
[0063] After the keyboard and mouse of the tablet 101 are transferred to the computer 102 and / or the mobile phone 103, the user can use the mouse of the tablet 101 to click, drag or double-click the computer 102 and / or the mobile phone 103, and can use the keyboard of the tablet 101 to input information on the computer 102 and / or the mobile phone 103.
[0064] For example, please refer to Figure 2 , Figure 2 A schematic diagram of keyboard and mouse traversal is shown. Figure 2 As shown in Figure a, the tablet 101 is connected to an external mouse and keyboard. The mouse and keyboard are currently inputting on the tablet 101, and the mouse cursor 1011 is displayed on the screen of the tablet 101. In addition, the tablet 101 and the computer 102 can share the mouse and keyboard. If the keyboard and mouse are switched from the tablet 101 to the computer 102 for use, the tablet 101 can achieve keyboard and mouse crossover with the computer 102, that is, the mouse cursor 1011 displayed on the tablet 101 can cross from the screen of the tablet 101 to the screen of the computer 102. For example, the user can achieve the crossover operation of the mouse cursor 1011 by moving the mouse. When the tablet 101 detects the crossover operation of the mouse cursor 1011, it can display Figure 2 The interface shown in Figure b is as follows: Figure 2 As shown in FIG. b, the mouse cursor 1011 is displayed on the screen of the computer 102. The crossing operation of the mouse cursor 1011 may be an operation of moving the mouse cursor to the outside of the screen of the tablet 101. For example, please refer to Figure 2In the figure b, the crossing operation of the mouse cursor 1011 is to control the mouse cursor 1011 to move outside the right boundary 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 the embodiment of the present application is not limited to this.
[0065] like Figure 2 As shown in FIG. a, the mouse cursor 1011 is displayed in the form of a circle on the screen of the tablet 101. Figure 2 As shown in FIG. b, the mouse cursor 1011 can be displayed in the form of a pointer on the screen of the computer 102. It can be understood that the embodiment of the present application only takes the above-mentioned mouse cursor display form as an example, and the mouse cursor can also be displayed in other forms on the tablet 101 or the computer 102, and the embodiment of the present application does not limit this.
[0066] In addition, after the mouse cursor 1011 passes from the tablet 101 to the computer 102, the user can input in the computer 102 through the keyboard of the tablet 101. Figure 2 In Figure b, the user can click the icon of "Document 1" with the mouse cursor 1011, and the computer 102 can display the "Document 1" icon in response to the user clicking the icon of "Document 1". Figure 2 The interface is shown in Figure c. Figure 2 As shown in Figure c, the computer 102 displays the editing page of Document 1. The user can input information "My Document" on the editing page of Document 1 through the keyboard of the tablet 101, and the computer 102 displays "My Document" on the editing page of Document 1 in response to the user's operation of inputting information on the editing page of Document 1.
[0067] In addition, if the keyboard and mouse are switched from the computer 102 to the tablet 101, the mouse cursor 1011 can also pass from the computer 102 back to the tablet 101. Figure 3 , Figure 3 A schematic diagram of reverse traversal of keyboard and mouse is shown. Figure 3 As shown in FIG. a, the mouse cursor 1011 is displayed on the screen of the computer 102. The user can move the mouse to realize the crossing operation of the mouse cursor 1011. When the computer 102 detects the crossing operation of the mouse cursor 1011, it can display Figure 3 The interface shown in Figure b is as follows: Figure 3 As shown in FIG. b, the mouse cursor 1011 is re-displayed on the screen of the tablet 101. The crossing operation of the mouse cursor 1011 may be an operation of moving the mouse cursor to the outside of the screen of the computer 102. Figure 3 In figure a, 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.
[0068] The condition for the tablet 101, computer 102 and mobile phone 103 to share the input device is that the tablet 101, computer 102 and mobile phone 103 use the same account to log in; 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).
[0069] The tablet 101 can sense all devices that meet the conditions for sharing input devices, but the number of input devices that can be shared with the tablet 101 can be two. When the tablet 101 senses more than two devices, the tablet 101 can share the input device with the device selected by the user based on the user's operation of selecting the device, or the tablet 101 can autonomously select the device to share the input device based on a preset rule, and the embodiment of the present application does not limit the preset rule.
[0070] Tablet 101 is connected to computer 102 and mobile phone 103 to realize device sharing, including two implementation methods. One possible implementation method is manual selection. The manual selection option is an option for tablet 101 to independently select the connection device. When the automatic selection option is turned off (or not turned on), the user can manually drag or click the connectable device in the visual interface to realize the connection between tablet 101 and computer 102 and mobile phone 103. Another possible implementation method is automatic selection. When the automatic selection option is turned on and the computer 102 and mobile phone 103 meet the conditions for sharing input devices, tablet 101 can automatically connect to computer 102 and 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 setting interface or control center of tablet 101 and mobile phone 103. The automatic selection option can be in the computer housekeeper of computer 102.
[0071] For example, Figure 4 A schematic diagram of an interface for setting keyboard and mouse sharing through a setting interface is shown. 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, such as Figure 4 As shown in Figure a of FIG. 1 , the setting interface may include options such as Bluetooth, mobile data, and smart interconnection, and may also include other setting options. The user clicks the smart interconnection option, and in response to the user clicking the smart interconnection option, the tablet 101 may display the following Figure 4 The keyboard and mouse sharing settings interface is shown in Figure a. Figure 4 As shown in Figure a of FIG, the keyboard and mouse sharing setting interface includes a keyboard and mouse sharing switch control. If the user wants to enable the function of sharing input devices on the tablet 101, the keyboard and mouse sharing switch control can be clicked. In response to the user clicking the keyboard and mouse sharing switch control operation, as shown in FIG. Figure 4 As shown in Figure b, the switch control for keyboard and mouse sharing is switched to the on state.
[0072] In addition, if Figure 4 As shown in Figure b, after the switch control of keyboard and mouse sharing is switched to the on state, the keyboard and mouse sharing setting interface can also display the automatic connection option and the automatic direction switching option. The user can click the automatic connection option to turn on the automatic connection function, and click the automatic direction switching option to turn on the automatic direction switching function. After the automatic connection function is turned on, the tablet 101 can automatically connect to available devices. For example, the user can place the mouse cursor close to the edge of the screen twice in a row to trigger the tablet 101 to automatically connect to available devices. Among them, the available device refers to a device that can establish a connection with the tablet 101 to share input devices, that is, a device that meets the conditions for sharing input devices. After the automatic direction switching function is turned on, the tablet 101 can automatically switch the screen arrangement position following the change in the device placement position. For example, when it is detected that the computer 102 is placed on the left side of the tablet 101, the keyboard and mouse crossing direction is configured to cross 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 crossing direction is configured to cross from the right side of the screen to the screen of the computer 102.
[0073] In addition, the keyboard and mouse settings interface can also display the device identifiers of available devices, such as Figure 4 As shown in Figure b, the keyboard and mouse settings interface can display available devices: YOYO computer, YOYO mobile phone and HONOR Pad. The user can independently select a device to establish a connection from the available devices based on the device identification of the available devices. For example, the user can click on the YOYO computer, and 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 following Figure 4 The keyboard and mouse sharing settings interface is shown in Figure c. Figure 4 As shown in Figure c in the figure, the keyboard and mouse sharing setting interface can display the indication information 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 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 between 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.
[0074] It should be understood that Figure 4The description is merely given by taking the example of enabling the keyboard and mouse sharing function through the setting interface and setting the related functional parameters of the keyboard and mouse sharing function. In other embodiments, the keyboard and mouse sharing function may be enabled and the related functional parameters of the keyboard and mouse sharing function may be set in other ways, and the embodiments of the present application do not limit this.
[0075] It should be noted that the above embodiment is only an example of sharing a mouse and keyboard between multiple devices. Multiple devices can also share other input devices, and the embodiments of the present application do not limit this. In addition, the above embodiment is only an example of the source device being a tablet and the peer device being a computer and a mobile phone. It should be understood that in other embodiments, the source device and the peer device can also be other devices.
[0076] Among them, the operating system of the source device is Windows system or Android system, and the operating system of the peer device is Windows system or Android system.
[0077] In some embodiments, a solution for sharing input devices between the source device and the peer device is proposed for the scenario where the operating system of the source device is Windows. However, due to differences between different operating systems, the solution for sharing input devices applicable to the source device whose operating system is Windows is not applicable to the scenario where the operating system of the source device is Android.
[0078] 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 a Windows 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 the 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, the input management module can be triggered to monitor the input events of the input device. Afterwards, if an operation for triggering the peer device to share the input device of the source device is received, 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 respond to the input event.
[0079] By configuring the keyboard and mouse sharing service and input management module in the operating system of the source device, the input events of the source device are monitored and intercepted through the keyboard and mouse sharing service and input management module, and then forwarded to the peer device after interception, so that the peer device responds to the input events of the source device, and the source device and the peer device share the input device, so that the user can use the same input device to control multiple devices, avoiding switching operations between different input devices, thereby simplifying the user's operation and improving input efficiency and user experience. Moreover, this solution is applicable to source devices whose operating system is the Android system, expanding the application scenarios of shared input devices.
[0080] In addition, the input management module can control the source device not to respond to the input event it has listened to, in addition to sending the subsequent listened input event to the keyboard and mouse sharing service according to the interception instruction. For example, the input management module can send a stop distribution instruction to the input distributor, and the input distributor can stop distributing the input event according to the stop distribution instruction, that is, it will not send the input event to the response module corresponding to the input event in the tablet for response, so that the tablet will not respond to the input event.
[0081] 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 opposite device for response.
[0082] For ease of explanation, in the following embodiments, the source device is referred to as a first electronic device, and the opposite device is referred to as a second electronic device.
[0083] The first electronic device and the second electronic device may be terminal devices. Next, taking the first electronic device as a terminal device as an example, the structure of the first electronic device is introduced.
[0084] Figure 5 A schematic diagram of the structure of a terminal is shown. Figure 5The 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 screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0085] It is to be understood that the structure illustrated in the embodiment of the present application does 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 in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0086] 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 processor (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), etc. Different processing units may be independent devices or integrated into one or more processors.
[0087] 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.
[0088] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0089] 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.
[0090] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple sets of I2C interfaces. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C interfaces. For example, the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C interface, thereby realizing the touch function of the terminal 100.
[0091] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple groups of I2S interfaces. The processor 110 can be coupled to the audio module 170 via the I2S interface to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
[0092] 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 to realize the function of answering calls through a Bluetooth headset.
[0093] The UART interface is a universal serial data bus 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 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0094] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting 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.
[0095] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the 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.
[0096] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the terminal 100, and can also be used to transmit data between the terminal 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The USB interface 130 can also be used to connect other terminals, such as AR devices, etc. The USB interface 130 can also be used to connect input devices. The input device can be a mouse, a keyboard, a touch screen device, or a sensor device, etc.
[0097] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration 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 in the above embodiments, or a combination of multiple interface connection methods.
[0098] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the terminal 100. While the charging management module 140 is charging the battery 142, it may also power the terminal 100 through the power management module 141.
[0099] 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 screen 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 number, battery health status (leakage, impedance), etc. 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.
[0100] 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.
[0101] 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 the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0102] 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.
[0103] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent 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 the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a 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.
[0104] 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., which are applied to 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, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0105] In some embodiments, the terminal 100 can be connected to input devices such as a mouse and a keyboard through the wireless communication module 160. For example, the terminal 100 can be connected to the input device through Bluetooth.
[0106] 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.
[0107] In some embodiments, the antenna 1 of the terminal 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the terminal 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. 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).
[0108] The terminal 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0109] The display screen 194 is used to display images, videos, etc. The 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 or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal 100 may include 1 or N display screens 194, where N is an integer greater than 1.
[0110] The terminal 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.
[0111] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0112] 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 to be converted 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.
[0113] 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 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0114] Video codecs are used to compress or decompress digital videos. Terminal 100 may support one or more video codecs. Thus, terminal 100 may play or record videos in various coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0115] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the terminal 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0116] 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 a data storage function, such as storing music, video and other files in the external memory card.
[0117] 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 may 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 may 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.
[0118] The terminal 100 can implement audio functions, such as music playing and recording, through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D and the application processor.
[0119] 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 arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0120] The speaker 170A, also called a "speaker", 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.
[0121] 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 received by placing the receiver 170B close to the ear.
[0122] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can make a sound by putting his mouth close to microphone 170C to input the sound signal into microphone 170C. Terminal 100 may be provided with at least one microphone 170C. In other embodiments, terminal 100 may be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, terminal 100 may also be provided with three, four or more microphones 170C to realize collection of sound signals, noise reduction, identification of sound source, realization of directional recording function, etc.
[0123] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130, or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0124] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The terminal 100 may receive key input and generate key signal input related to user settings and function control of the terminal 100.
[0125] 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 acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. Touch operations acting 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.
[0126] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0127] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the terminal 100 by inserting it into the SIM card interface 195 or pulling it out 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.
[0128] Next, the software system of the terminal 100 will be described.
[0129] The software system of the terminal 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software system of the terminal 100.
[0130] Figure 6 1 shows a block diagram of a software system of the terminal 100. Figure 6 The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer (Fraemwork), the local service layer (Native) and the driver layer.
[0131] The application layer can include a series of application packages. Figure 6As shown, the application package may include a keyboard and mouse sharing service. The keyboard and mouse sharing service is used to implement a service of sharing input devices between the terminal 100 and other devices.
[0132] In addition, the application package may also include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0133] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 6 As shown, the application framework layer may include an input management module, a first input manager and an input management interface.
[0134] The input management module is used to manage input events of input devices connected to the terminal 100. In the 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. Figure 6 As shown, the input management module may include a first input management service and a first phone window manager. The first input management service is used to monitor the 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 wheel scrolling events. The first input management service is an input management service extended based on the system's native input management service. On the basis of the functions of the system's native input management service, the functions of monitoring and intercepting mouse events are extended. For example, the first input management service may be HwInputMangerService. The first phone window manager is used to monitor the 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 events of keyboard devices. The first phone window manager may be an extended phone window manager based on the system's native phone window manager. On the basis of the functions of the system's native phone window manager, the functions of monitoring and intercepting keyboard events are extended. For example, the first phone window manager may be HwPhoneWindowManager.
[0135] In addition, the first input management service may be configured with interception logic, and through the configured interception logic, only a specific type of mouse event may be intercepted, that is, only a specific type of mouse event is sent to the keyboard and mouse sharing service, and other types of mouse events are not intercepted, that is, 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 may be used to identify whether the mouse event is a mouse event triggered by an external mouse device, and if so, it is intercepted, and if not, it is not intercepted.
[0136] In addition, the first phone window manager can be configured with an interception logic, and through the configured interception logic, only a specific type of key events can be intercepted, that is, only a specific type of key events are sent to the keyboard and mouse sharing service, and other types of key events are not intercepted, that is, not sent to the keyboard and mouse sharing service, but continue to be responded 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, and if not, it is not intercepted.
[0137] 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 telephone 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.
[0138] In addition, if Figure 6As shown, 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 acts. The native input management service (NativeInputManagerService) is used to manage the underlying input event data.
[0139] As an example, the input management module can listen to input events through the input event listener configured by the keyboard and mouse sharing service, and 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 listen to input events through the configured input event listener. For example, the keyboard and mouse event listener is configured for the first input management service through the first input manager, so that the first input management service can listen to mouse events through the configured keyboard and mouse event listener. For another example, the keyboard and mouse event listener is configured for the first phone window manager through the first input manager, so that the first phone window manager can listen to keyboard events through the configured keyboard and mouse event listener.
[0140] Among them, the input event listener can be a listener callback for the input event, and correspondingly, the keyboard and mouse event listener can be a listener callback for the keyboard and mouse events. The keyboard and mouse sharing service configures the input event listener for the input management module, which means registering a listener callback in the input reader for the input management module, so that after the input reader reads the input event, it calls the input event back to the input management module through the registered listener callback. For example, a listener callback for mouse events is registered in the input reader for the first input management service, and a listener callback for keyboard events is registered in the input reader for the first phone window manager.
[0141] 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 to the embodiments of the present application.
[0142] The local service layer mainly includes some local services and link libraries. Please refer to Figure 6, the local service layer can include an input passer (InputFlinger) and an input library (Libinput).
[0143] Among them, the input transmitter is mainly responsible for reading and distributing the original input events. Figure 6 As shown, the input transmitter includes the second input manager, input reader (InputReader), input distributor (InputDispatcher), input module (InputDevice) and event center (EventHub). The second input manager is the native input manager of the system. The input reader is used to read input events and also to turn on and off the drawing function of the mouse cursor. 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 according to the newly added input device node. The event center is used to read raw input events and also to create input devices.
[0144] The input library mainly supports the event distribution process. Figure 6 As shown, the input library may include input transport (InputTransport), input publisher (InputPublisher), input message (InputMessager), input consumer (InputConsumer), input channel (InputChannel) and velocity tracker (VelocityTracker) and the like.
[0145] 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.
[0146] After input devices such as a 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, the information of the created device node can be added 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, and then the input management module sends the input event to the keyboard and mouse sharing service for processing.
[0147] Next, combine Figure 6 , which illustrates the workflow of the terminal 100 software.
[0148] Please refer to Figure 7 , Figure 7 A logic diagram for implementing shared input devices between a tablet and a PC is shown. Figure 7 As shown, after the keyboard and mouse sharing service is started, the 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, the mouse notification method of the input distributor can be called, and the mouse event is sent 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, the key notification method of the input distributor can be called, and the keyboard event is sent 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.
[0149] In addition, after the keyboard and mouse sharing service receives the mouse event sent by the first input management service, the keyboard and mouse sharing service can also determine whether the mouse cursor crosses according to 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 crosses according to 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 so that the input reader turns off 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, and the setting parameters include the first keyboard and mouse service status information, and the first status information is used to indicate that the mouse cursor crosses. The first input management service can send a stop distribution instruction 1 to the input distributor according to the first keyboard and mouse service status information, so that the input distributor stops distributing mouse events according to the stop distribution instruction 1. The first phone window manager can send a stop distribution instruction 2 to the input distributor according to the first keyboard and mouse service status information, so that the input distributor stops distributing keyboard events according to the stop distribution instruction 2. Afterwards, if the keyboard and mouse sharing service receives a mouse event monitored by the first input manager, the received mouse event is forwarded to the PC for processing; if the keyboard event monitored by the first phone window manager is received, the received keyboard event is forwarded to the PC for processing. The PC includes an event receiving module and an event response module. The PC can receive the mouse event or keyboard event forwarded by the keyboard and mouse sharing service through the event receiving module, and respond to the received mouse event or keyboard event through the event response module.
[0150] In addition, if Figure 6As shown, 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 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 the filter input event mechanism first determines 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 interception key mechanism (IinterceptKeyBeforeQueueing) and an interception logic. The pre-queue interception key mechanism is used to intercept 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 distributor may call the front-end interception key mechanism of the first window manager, and the front-end interception key mechanism first determines whether the key event reported by the input reader meets the interception condition based on the interception logic. If so, the key event is intercepted, that is, the key event is sent to the keyboard and mouse sharing service. For example, it is determined whether the key event is a key event of an external keyboard, and if so, the key event is sent to the keyboard and mouse sharing service.
[0151] Next, combine Figure 6 and Figure 7 , the scheme of sharing input device provided in the embodiment of the present application is described in detail.
[0152] Figure 8 and Fig. 9 A flow chart of a method for sharing an input device is shown, such as Figure 8 As shown, the method comprises the following steps:
[0153] Step 801: The user performs operation 1, which is an operation of starting the keyboard and mouse sharing service of the tablet.
[0154] Operation 1 may be an operation of clicking a switch control of a keyboard and mouse sharing service displayed on a related interface of the tablet. The switch control of the keyboard and mouse sharing service is used to turn on or off the keyboard and mouse sharing service of the tablet. For example, please refer to Figure 4 In Figure a, operation 1 is to click the switch control of the keyboard and mouse sharing service in the keyboard and mouse sharing setting interface.
[0155] Step 802: In response to operation 1, the keyboard and mouse sharing service is started.
[0156] 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 other devices for use, etc. Among them, the established connection refers to a connection that can share the input device with other devices.
[0157] In the embodiment of the present application, whether the input device is switched to another device can be indicated by whether the mouse cursor of the tablet crosses. For example, if the mouse cursor crosses, it indicates that the input device is switched to another device, and if the mouse cursor does not cross, it indicates that the input device is not switched to another device. Wherein, the mouse cursor crosses means that the mouse cursor moves outside the screen of the tablet.
[0158] 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.
[0159] Step 803: The user performs operation 2, which is an operation of establishing a connection between the tablet and the PC.
[0160] 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.
[0161] As an example, operation 2 may be an operation of selecting a PC from available devices, where the available devices are devices that meet the conditions for sharing input devices with the tablet, such as devices logged into the same account as the tablet. Figure 4 In Figure b, the setting interface of keyboard and mouse sharing includes device identifiers of available devices, and the device identifiers of available devices include PC (YOYO's computer). Operation 2 can be an operation of clicking "YOYO's computer".
[0162] 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.
[0163] In the embodiment of the present application, in response to operation 2, the keyboard and mouse sharing service can initialize the state 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 state and configuring monitoring may include the following steps 804-810.
[0164] 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, where the initialization state parameters include keyboard and mouse sharing state 1, and the keyboard and mouse sharing state 1 is used to indicate that the tablet and the computer are connected.
[0165] 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.
[0166] The keyboard and mouse sharing status of the keyboard and mouse sharing service may include whether the tablet and the 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, and the initialization keyboard and mouse sharing status is keyboard and mouse sharing status 1.
[0167] After the input reader receives the initialization state parameters, it can store the initialization state parameters.
[0168] It should be understood that the 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, which is not limited in the embodiments of the present application. For example, the 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 the computer are not connected.
[0169] Step 805: In response to operation 2, the keyboard and mouse sharing service sends an initialization state parameter to the first input manager.
[0170] 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.
[0171] In the 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 parameter, and the initialization state parameter is sent to the first input management service and the first phone window manager through the first input manager.
[0172] 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.
[0173] 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.
[0174] 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.
[0175] After receiving the initialization state parameter, the first input management service and the first phone window manager may store the initialization state parameter.
[0176] Step 808: In response to operation 2, the keyboard and mouse sharing service sends a configuration monitoring instruction to the first input manager.
[0177] 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.
[0178] The configuration monitoring instruction is used to instruct to configure the keyboard and mouse event monitors for the first input management service and the first telephone window manager.
[0179] 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.
[0180] 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.
[0181] 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.
[0182] Step 811: The user moves the mouse.
[0183] 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.
[0184] Step 812: The input reader reads mouse event 1.
[0185] 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.
[0186] Step 813: The input reader calls the input distributor and sends mouse event 1 to the input distributor.
[0187] For example, the input reader may call the mouse notification method of the input distributor to process mouse event 1 through the mouse notification method.
[0188] Step 814: The input distributor sends mouse event 1 to the first input management service.
[0189] 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.
[0190] In addition, the input distributor can also distribute mouse event 1 so that the tablet responds to mouse event 1.
[0191] Step 815: The first input management service sends mouse event 1 to the keyboard and mouse sharing service.
[0192] After receiving the mouse event 1, the first input management service may send the mouse event 1 to the keyboard and mouse sharing service.
[0193] After receiving the mouse event 1, the keyboard and mouse sharing service can determine whether the mouse cursor has crossed according to the 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 mouse event reported by the first input management service is continuously received, and the mouse cursor is determined whether the mouse cursor has crossed according to the reported mouse event.
[0194] Step 816: The keyboard and mouse sharing service determines the mouse cursor crossing according to mouse event 1.
[0195] 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.
[0196] By updating the keyboard and mouse sharing status stored in the first input management service, the function of the first input management service to intercept mouse events can be configured. By updating the keyboard and mouse sharing status stored in the first phone window manager, the function of the first phone window manager to intercept keyboard events can be configured.
[0197] After the keyboard and mouse sharing service determines that the mouse cursor has crossed according to mouse event 1, the keyboard and mouse sharing service may also send mouse event 1 to the PC for the PC to respond 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 displaying the mouse pointer at the center of the screen. Alternatively, in response to mouse event 1, the PC may also display the mouse pointer on the screen according to the offset of mouse event 1, which is not limited in the embodiments of the present application.
[0198] 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.
[0199] 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 crosses.
[0200] Step 818: The input reader turns off the mouse cursor drawing function according to the keyboard and mouse sharing state 2.
[0201] 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 keyboard and mouse sharing state from the keyboard and mouse sharing state 1 to the keyboard and mouse sharing state 2 .
[0202] In an embodiment of the present application, the input reader can control the opening and closing of the drawing function of the mouse cursor according to the keyboard and mouse sharing state. For example, when the keyboard and mouse sharing state is the keyboard and mouse sharing state 1, the input reader can keep the drawing function of the mouse cursor in the opening state, and when the keyboard and mouse sharing state is the keyboard and mouse sharing state 2, the input reader can keep the drawing function of the mouse cursor in the closing state. If the input reader detects that the keyboard and mouse sharing state is switched to the keyboard and mouse sharing state 2, the drawing function of the mouse cursor can be turned off, and if the input reader detects that the keyboard and mouse sharing state is switched from the keyboard and mouse sharing state 2 to other states, the drawing function of the mouse cursor can be turned on.
[0203] Step 819: The keyboard and mouse sharing service sends the keyboard and mouse sharing status 2 to the first input management service.
[0204] 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.
[0205] 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.
[0206] For example, the first input management service updates the stored keyboard and mouse sharing state 1 to keyboard and mouse sharing state 2.
[0207] In the embodiment of the present application, the first input management service can control the first input management service to enable or disable the function of intercepting mouse events according to the keyboard and mouse sharing state. The function of intercepting mouse events means that the first input management service sends the monitored mouse events to the keyboard and mouse sharing service, or sends the monitored mouse events to the keyboard and mouse sharing service, and controls the tablet not to respond to the monitored mouse events.
[0208] Step 821: The keyboard and mouse sharing service sends the keyboard and mouse sharing status 2 to the first phone window manager.
[0209] 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.
[0210] Step 822: The first phone window manager updates the stored keyboard and mouse sharing state to keyboard and mouse sharing state 2.
[0211] In the embodiment of the present application, the first phone window manager can control the first phone window manager to turn on or off the function of intercepting keyboard events according to the keyboard and mouse sharing state. The function of intercepting keyboard events means that the first phone window manager sends the monitored keyboard events to the keyboard and mouse sharing service, or sends the monitored keyboard events to the keyboard and mouse sharing service, and controls the tablet not to respond to the monitored keyboard events.
[0212] After the first input management service updates the keyboard and mouse sharing state to keyboard and mouse sharing state 2, the function of intercepting mouse events can be enabled according to keyboard and mouse sharing state 2, and mouse events can be intercepted in the future. After the first telephone window manager updates the keyboard and mouse sharing state to keyboard and mouse sharing state 2, the function of intercepting keyboard events can be enabled according to keyboard and mouse sharing state 2, and keyboard events can be intercepted in the future.
[0213] like Fig. 9 As shown, 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:
[0214] Step 823: The user moves the mouse.
[0215] Step 824: The input reader reads mouse event 2.
[0216] After the input reader reads the mouse event 2, the mouse event 2 can be sent 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 distributor, and through the input distributor, the mouse event 2 is sent to the first input management service based on the keyboard and mouse event listener configured by the first input management service.
[0217] For example, the input reader may call the mouse notification method of the input distributor, and through the mouse notification method, 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.
[0218] Step 825: The input reader sends mouse event 2 to the input distributor.
[0219] 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.
[0220] 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.
[0221] 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.
[0222] 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.
[0223] Step 828: The keyboard and mouse sharing service sends mouse event 2 to the event receiving module of the PC.
[0224] Step 829: The event receiving module of the PC sends mouse event 2 to the event responding module of the PC.
[0225] Step 830: The event response module of the PC responds to mouse event 2.
[0226] 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.
[0227] The stop distribution instruction 1 is used to instruct the input distributor to stop distributing the mouse event 2 .
[0228] 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.
[0229] Under normal circumstances, for example, when the keyboard and mouse sharing state is in a state other than the keyboard and mouse sharing state 2, after receiving the 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 responds to the mouse event, thereby realizing the tablet's response to the mouse event. In the embodiment of the present application, in order to control the tablet not to respond to mouse event 2, a stop distribution instruction can be sent to the input distributor, so that the input distributor does not distribute the event for mouse event 2.
[0230] After step 832, the tablet may loop through steps 824 to 832 to intercept and forward the next mouse event.
[0231] Step 833: The user presses a keyboard key.
[0232] Step 834: The input reader reads keyboard event 1.
[0233] After the input reader reads the keyboard event 1, the mouse event 1 can be sent to the first phone window manager through the keyboard and mouse event listener configured by the first phone window manager. For example, the input reader can call the input distributor, and through the input distributor, the keyboard event 1 is sent to the first phone window manager based on the keyboard and mouse event listener configured by the first phone window manager.
[0234] For example, the input reader may call the keyboard notification method of the input distributor, and through the keyboard notification method, 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.
[0235] Step 835: The input reader sends keyboard event 1 to the input distributor.
[0236] For example, the input distributor may send keyboard event 1 to the first input management service through a mouse notification method based on a keyboard and mouse event listener configured by the first input management service.
[0237] 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.
[0238] After the input distributor sends the keyboard event 1 to the first phone window manager, the first phone window manager can receive the keyboard event 1 through the configured keyboard event listener.
[0239] 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, on the one hand, it can send keyboard event 1 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 keyboard event 1.
[0240] 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.
[0241] Step 838: The keyboard and mouse sharing service sends keyboard event 1 to the event receiving module of the PC.
[0242] Step 839: The event receiving module of the PC sends keyboard event 1 to the event responding module of the PC.
[0243] Step 840: The event response module of the PC responds to keyboard event 1.
[0244] 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.
[0245] The stop distribution instruction 2 is used to instruct the input distributor to stop distributing the keyboard event 1 .
[0246] Step 842: The input distributor stops distributing keyboard event 1 according to stop distribution instruction 2, so that the tablet does not respond to keyboard event 1.
[0247] 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 the 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 responds to the keyboard event, thereby realizing the tablet's response to the keyboard event. In the embodiment of the present application, in order to control the tablet not to respond to keyboard event 1, a stop distribution instruction can be sent to the input distributor, so that the input distributor does not distribute the event for keyboard event 1.
[0248] After step 842, the tablet may loop through steps 834 to 843 to intercept and forward the next keyboard event.
[0249] It should be noted that after the first phone window manager is configured with a keyboard and mouse event listener, it can not only listen to keyboard events, but also other key events. Among them, key events can include other key events in addition to keyboard events, such as system key events. Among them, system key events refer to key events of the tablet's native keys, such as the power button, volume button, etc. of the tablet. After the first phone window manager listens to the key event, it can also first determine whether the key event is a keyboard event. If so, the above-mentioned interception and forwarding mechanism is executed. If not, the above-mentioned interception and forwarding mechanism is not executed.
[0250] For example, after the input reader reads the key event, the key event can be sent to the first phone window manager, such as sending the key event to the first phone window manager through the input distributor. After the first phone window manager passes the configured keyboard and mouse event listener, it can first determine whether the key event is a keyboard event. If so, it includes the following two situations: In the first situation, 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; in the second situation, when the keyboard and mouse sharing state is other states 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 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.
[0251] 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 responds by the tablet itself. For example, the keyboard and mouse sharing service no longer sends the mouse events sent from the first input management service or the keyboard events sent by 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 according to the current keyboard and mouse sharing status. Among them, the reverse traversal of the mouse cursor refers to the movement of the mouse cursor outside the screen of the PC, such as moving outside the left border of the PC screen, or moving outside the right border of the PC screen.
[0252] 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 crosses in the reverse direction according to mouse event 3, the input event forwarding function is turned off, that is, the mouse event or keyboard event after mouse event 3 is no longer forwarded to the PC. For mouse event 3, the keyboard and mouse sharing service may forward it to the PC or may not forward it to the PC, and this is not limited in the embodiments of the present application. 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 telephone window manager according to 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.
[0253] 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.
[0254] Fig.10 A schematic diagram of the structure of an electronic device is shown, and the electronic device is a second electronic device, such as Figure 1 The computer 102 or mobile phone 103 shown in FIG. The operating system of the second electronic device may be an Android system or a Windows system. Fig. 9 The electronic device includes at least one processor 201, a communication bus 202, a memory 203 and at least one communication interface 204.
[0255] 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.
[0256] The communication bus 202 may include a pathway for transmitting information between the above-mentioned components.
[0257] 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 compressed optical 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 the 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.
[0258] The communication interface 204 uses any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc.
[0259] In a specific implementation, as an embodiment, the processor 201 may include one or more CPUs, such as Fig. 9 CPU0 and CPU1 are shown in the figure.
[0260] In a specific implementation, as an embodiment, the electronic device may include multiple processors, such as Fig. 9 201 and processor 205 shown in FIG. Each of these processors may be a single-core processor or a multi-core processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0261] 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 may display information in a variety of ways. For example, the output device 206 may 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 may receive user input in a variety of ways. For example, the input device 207 may be a mouse, a keyboard, a touch screen device, or a sensor device.
[0262] The electronic device may be a general electronic device or a dedicated electronic device. In a specific implementation, the electronic device may be a desktop computer, a portable computer, a network server, a palmtop computer, a mobile phone, a tablet computer, a wireless terminal device, a communication device or an embedded device. The embodiment of the present application does not limit the type of the electronic device.
[0263] 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 input devices provided in the above embodiment through the processor 201 and the program code 210 in the memory 203.
[0264] 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 may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may 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 may be transmitted from a website site, computer, server or data center by wired (such as: coaxial cable, optical fiber, data subscriber line (Digital Subscriber Line, DSL)) or wireless (such as: infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may 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 (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a digital versatile disc (DVD)), or a semiconductor medium (such as a solid state disk (SSD)).
[0265] The above are optional embodiments provided for the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the technical scope disclosed in the present application shall be included in the protection scope of the present 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 respond to the first input event according to the interception instruction.
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.
Citation Information
Patent Citations
Input function control method, input function control device and storage medium
CN113687765A
Input device sharing method, electronic device and system
CN114579016A
Display method and device
CN114816294A
operating system
JP2007507779A