WO2025001352A1 - 共享输入设备的方法、电子设备及存储介质 - Google Patents
共享输入设备的方法、电子设备及存储介质 Download PDFInfo
- Publication number
- WO2025001352A1 WO2025001352A1 PCT/CN2024/083382 CN2024083382W WO2025001352A1 WO 2025001352 A1 WO2025001352 A1 WO 2025001352A1 CN 2024083382 W CN2024083382 W CN 2024083382W WO 2025001352 A1 WO2025001352 A1 WO 2025001352A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- input
- keyboard
- mouse
- event
- electronic device
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/02—Input arrangements using manually operated switches, e.g. using keyboards or dials
- G06F3/023—Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
- G06F3/0233—Character input methods
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/02—Input arrangements using manually operated switches, e.g. using keyboards or dials
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/02—Input arrangements using manually operated switches, e.g. using keyboards or dials
- G06F3/0227—Cooperation and interconnection of the input arrangement with other functional units of a computer
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/02—Input arrangements using manually operated switches, e.g. using keyboards or dials
- G06F3/023—Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Definitions
- 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.
- terminal devices may include: mobile phones, tablets, computers, and wearable devices.
- 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.
- each terminal device is independent and each terminal device has its own matching input device, when multiple terminal devices have services that need to be handled by users, users need to switch back and forth between the input devices of different terminal devices, which is cumbersome and not conducive to user experience.
- 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:
- 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.
- the input management module can be triggered to monitor input events of the input device. Afterwards, if an operation (second operation) is received to trigger the second electronic device to share the input device of the first electronic device, in response to the operation, the keyboard and mouse sharing service can control the screen of the first electronic device to stop displaying the mouse cursor, and send an interception instruction to the input management module, so that the input management module sends the monitored first input event to the keyboard and mouse sharing service according to the interception instruction. After receiving the first input event, the keyboard and mouse sharing service can send the first input event to the second electronic device, so that the second electronic device responds to the first input event.
- second operation an 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.
- the keyboard and mouse sharing service can send the first input event to the second electronic device, so that the second electronic device respond
- 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.
- This solution It is especially suitable for source devices whose operating system is Android, and expands the application scenarios of shared input devices.
- 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.
- the input device is an external input device, such as an external mouse or an external keyboard.
- 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.
- 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.
- the input management module can listen to the input events of the input device through the configured input event listener.
- the input event listener for the input management module, you can implement the listening of the input events of the input device.
- an input event listener may be configured for the input management module.
- an input event listener can be configured for the input management module.
- the monitoring of the input event is triggered, which can save monitoring power consumption and avoid meaningless monitoring.
- 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.
- 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 extended based on the system's native phone window manager, and based on the functions of the system's native phone window manager, the functions of monitoring and intercepting keyboard events are extended.
- 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. This prevents 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.
- 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.
- the input distributor when the second electronic device does not share the input device of the first electronic device, after the input distributor receives the input event read by the input reader, it can distribute the input event to the response module corresponding to the input event in the first electronic device, and the response module responds to the input event, thereby realizing the response of the first electronic device 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.
- 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.
- 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.
- 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 keyboard events according to the second stop distribution instruction.
- the first electronic device can be prevented from responding to keyboard 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.
- the first phone window manager 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.
- the system key event refers to a key event of a native key of the first electronic device.
- the native key may be a power key, a volume key, etc. of the first electronic device.
- 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.
- the input reader reads the first input event, then calls the input notification method of the input distributor, and sends the first input event to the input management module through the input notification method.
- 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.
- 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.
- 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.
- 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.
- 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 first electronic device has established a connection with the second electronic device, whether the input device is 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.
- 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.
- 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.
- 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
- the first phone window manager can control the interception of keyboard events according to the keyboard and mouse sharing status
- 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.
- the interception instruction may also be the second keyboard and mouse sharing state information.
- 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.
- 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.
- 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.
- the user can control the mouse cursor to cross by moving the mouse, that is, control the mouse cursor to the first electronic device.
- the input device of the first electronic device can be switched to the second electronic device for use by moving the input device outside the screen, such as moving outside the left border of the screen or outside the right border of the screen, which facilitates user operation and improves the flexibility and efficiency of sharing input devices.
- a device for sharing an input device 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.
- a device for sharing an input device 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.
- a computer-readable storage medium 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.
- a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method for sharing an input device as described in the first aspect.
- FIG1 shows a schematic diagram of a communication system
- FIG2 shows a schematic diagram of keyboard and mouse traversal
- FIG4 is a schematic diagram showing an interface for setting keyboard and mouse sharing through a setting interface
- FIG5 shows a schematic diagram of the structure of a terminal
- FIG6 shows a block diagram of a software system of a terminal
- FIG7 shows a logic diagram of implementing sharing of input devices between a tablet and a PC
- FIG8 shows a flow chart of a method for sharing an input device
- FIG9 shows a flow chart of another method for sharing an input device
- FIG. 10 shows a schematic structural diagram of an electronic device.
- multiple refers to two or more.
- multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.
- Multi-device collaboration is a distributed technology applied to multiple electronic devices.
- two or more electronic devices can collaborate across systems and devices to achieve resource sharing and collaborative operation.
- 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.
- the communication connection can be a wired communication connection or a wireless communication connection.
- the solution of wired communication connection can include USB On-The-Go (OTG) technology, for example;
- the solution of wireless communication can include wireless fidelity (Wi-Fi), Wi-Fi Direct (Wi-Fi Direct), Bluetooth (BT), near field communication (NFC), infrared technology (IR), etc.
- Keyboard and mouse collaboration refers to sharing input devices between multiple devices, such as sharing a mouse, keyboard, etc.
- 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.
- 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 wirelessly, for example, via a short-range wireless communication technology, which can be Wi-Fi or Bluetooth. It should also be understood that FIG. 1 only takes the input devices shared by multiple devices as a mouse and a keyboard as an example, and 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. Certainly.
- 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 mobile phone 103.
- 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.
- 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.
- 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.
- FIG. 2 shows a schematic diagram of a keyboard and mouse crossing.
- the tablet 101 is connected to an external mouse and keyboard, and the mouse and keyboard are currently input on the tablet 101, and the mouse cursor 1011 is displayed on the screen of the tablet 101.
- 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 crossing 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 crossing operation of the mouse cursor 1011 by moving the mouse.
- the interface shown in FIG. 2 b can be displayed.
- the mouse cursor 1011 is displayed on the screen of the computer 102.
- the crossing operation of the mouse cursor 1011 can be an operation of moving the mouse cursor to the outside of the screen of the tablet 101.
- 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.
- the mouse cursor 1011 is displayed in the form of a circle on the screen of the tablet 101, and as shown in Figure b of FIG2 , 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.
- the user can input in the computer 102 through the keyboard of the tablet 101.
- the user can click the icon of "Document 1" through the mouse cursor 1011, and the computer 102 can display the interface shown in Figure c of FIG2 in response to the user's operation of clicking the icon of "Document 1".
- 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.
- FIG. 3 shows a schematic diagram of the reverse switching of the keyboard and mouse.
- the mouse cursor 1011 is displayed on the screen of the computer 102.
- the user can move the mouse to The crossing operation of the mouse cursor 1011 is performed.
- the interface shown in FIG. 3 b can be displayed.
- the mouse cursor 1011 is re-displayed on the screen of the computer 101.
- the crossing operation of the mouse cursor 1011 can be an operation of moving the mouse cursor to the outside of the screen of the computer 102. Please refer to FIG. 3 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.
- 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).
- the tablet 101 can sense all devices that meet the conditions for sharing input devices, and the number of input devices shared with the tablet 101 can be one or more. 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 operation of the user selecting the device, or the tablet 101 can autonomously select the device for sharing the input device based on a preset rule, and the embodiment of the present application does not limit the preset rule.
- 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 allows the user of tablet 101 to independently select the option to connect the device.
- 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 connect tablet 101 to computer 102 and mobile phone 103.
- Another possible implementation method is automatic selection.
- the automatic selection option can be in different positions in different devices.
- 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.
- FIG4 shows a schematic diagram of an interface for setting keyboard and mouse sharing through a setting interface.
- the user wants to set the relevant parameters of keyboard and mouse sharing, the user can click the setting icon.
- the tablet 101 displays the setting interface, as shown in FIG4 a.
- the setting interface may include options such as Bluetooth, mobile data, and smart interconnection, and of course, other setting options may also be included.
- the tablet 101 may display the keyboard and mouse sharing setting interface as shown on the right side of FIG4 a.
- the keyboard and mouse sharing setting interface includes a switch control for keyboard and mouse sharing.
- the switch control for keyboard and mouse sharing can be clicked.
- the switch control for 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.
- 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.
- 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.
- 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.
- the keyboard and mouse settings interface can also display the device identification of the available devices.
- the keyboard and mouse settings interface can display the available devices: YOYO's computer, YOYO's mobile phone and HONOR Pad.
- the user can independently select the 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 keyboard and mouse sharing settings interface as shown in Figure c of Figure 4.
- the keyboard and mouse sharing settings 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 on the right side crossing option. In response to the user's click operation, the tablet 101 can configure the keyboard and mouse crossing direction of the shared input device of the tablet 101 and the YOYO computer to cross to the right side of the screen, that is, the mouse cursor of the tablet 101 can cross from the right side of the screen to the YOYO computer.
- Figure 4 only uses the example of enabling the keyboard and mouse sharing function through the setting interface and setting the relevant functional parameters of the keyboard and mouse sharing function.
- the keyboard and mouse sharing function can also be enabled and the relevant functional parameters of the keyboard and mouse sharing function can be set in other ways.
- the embodiments of the present application are not limited to this.
- 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.
- 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.
- the operating system of the source device is Windows or Android, and the operating system of the peer device can also be Windows or Android.
- 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.
- the solution for sharing input devices applicable to the source device operating system of Windows may not be applicable to the scenario where the operating system of the source device is Android.
- 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.
- the input management module can be triggered to monitor the input events of the input device.
- 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.
- the keyboard and mouse sharing service forwards the input event to the peer device so that other devices respond to the input event.
- 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, thus realizing the sharing of the source device and the peer device.
- Input devices allow users to use the same input device to control multiple devices, avoiding switching operations between different input devices, thereby simplifying user operations and improving input efficiency and user experience.
- this solution is applicable to source devices with Android operating systems, expanding the application scenarios of shared input devices.
- 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 monitored input event to the keyboard and mouse sharing service according to the interception instruction.
- the input management module can send a stop distribution instruction to the input distributor, and the input distributor can stop event distribution for the input event according to the stop distribution instruction, that is, the input event will not be sent to the response module corresponding to the input event in the source device for response, so that the source device will not respond to the input event.
- the input device is an external input device, such as an external mouse or an external keyboard.
- an external input device such as an external mouse or an external keyboard.
- the source device is referred to as a first electronic device, and the opposite device is referred to as a second electronic device.
- 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.
- FIG5 shows a schematic diagram of the structure of a terminal.
- the terminal 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
- SIM subscriber identification module
- the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
- the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal 100.
- 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.
- 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.
- AP application processor
- GPU graphics processor
- ISP image signal processor
- controller a memory
- video codec a digital signal processor
- DSP digital signal processor
- NPU neural-network processing unit
- Different processing units may be independent devices or integrated into one or more processors.
- 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.
- the processor 110 may also be provided with a memory for storing instructions and data.
- the memory in the processor 110 is a cache memory.
- the memory may store the instructions and data that the processor 110 has just used or used repeatedly. If the processor 110 needs to use the instruction or data again, it can 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.
- 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.
- I2C inter-integrated circuit
- I2S inter-integrated circuit sound
- PCM pulse code modulation
- UART universal asynchronous receiver/transmitter
- MIPI mobile industry processor interface
- GPIO general-purpose input/output
- SIM subscriber identity module
- USB universal serial bus
- the I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL).
- 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.
- 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.
- the I2S interface can be used for audio communication.
- 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.
- 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.
- the PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals.
- the audio module 170 and the wireless communication module 160 can be coupled via the PCM interface.
- 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.
- 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.
- the UART interface is generally used to connect the processor 110 and the wireless communication module 160.
- the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
- 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.
- 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.
- 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.
- the GPIO interface can be configured by software.
- the GPIO interface can be configured as a control signal or as a data signal.
- 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.
- the USB interface 130 is an interface that complies with the USB standard specification, and can specifically 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, or it can be used to charge the terminal 100.
- the USB interface 130 is used to transmit data between the terminal 100 and peripheral devices. It can also be used to connect headphones and play audio through the headphones.
- the USB interface 130 can also be used to connect other terminals, such as AR devices.
- the USB interface 130 can also be used to connect input devices.
- the input device can be a mouse, keyboard, touch screen device, or sensor device.
- 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.
- the terminal 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
- 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.
- the charging management module 140 may receive charging input from a wired charger through the USB interface 130.
- 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.
- 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.
- the power management module 141 can also be set in the processor 110.
- the power management module 141 and the charging management module 140 can also be set in the same device.
- 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.
- 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.
- antenna 1 can be reused as a diversity antenna for a wireless local area network.
- the antenna can be used in combination with a tuning switch.
- the mobile communication module 150 can provide solutions for wireless communications including 2G/3G/4G/5G applied to 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.
- at least some of the functional modules of the mobile communication module 150 can be set in the processor 110.
- 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.
- the modem processor may include a modulator and a demodulator.
- 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.
- 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.
- the modem processor may be an independent device.
- 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.
- the wireless communication module 160 can provide applications on the terminal 100, including wireless local area network (WLAN)
- the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
- the wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal, performs filtering processing, and sends the processed signal to the processor 110.
- the wireless communication module 160 may also receive a signal to be sent from the processor 110, modulate the frequency of the signal, amplify the signal, and convert it into an electromagnetic wave for radiation through the antenna 2.
- the terminal 100 can be connected to input devices such as a mouse and a keyboard through the wireless communication module 160.
- the terminal 100 can be connected to the input device through Bluetooth.
- 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.
- 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.
- GSM global system for mobile communications
- GPRS general packet radio service
- CDMA code division multiple access
- WCDMA wideband code division multiple access
- TD-SCDMA time-division code division multiple access
- LTE long term evolution
- BT GNSS
- WLAN wireless local area network
- NFC long term evolution
- FM long term evolution
- IR technology IR technology.
- GNSS can include the global positioning system (GPS), the global navigation satellite system (G
- 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.
- 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, quantum dot light-emitting diodes (QLED), etc.
- the terminal 100 may include 1 or N display screens 194, where N is an integer greater than 1.
- 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.
- ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted to the camera sensor through the lens. The light signal is converted into an electrical signal, and the camera sensor transmits the electrical signal to the 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 the camera 193.
- 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.
- CMOS complementary metal oxide semiconductor
- 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.
- the terminal 100 may include 1 or N cameras 193, where N is an integer greater than 1.
- 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.
- Video codecs are used to compress or decompress digital videos.
- Terminal 100 may support one or more video codecs.
- terminal 100 may play or record videos in various coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
- MPEG Moving Picture Experts Group
- MPEG2 MPEG2, MPEG3, MPEG4, etc.
- NPU is a neural network (NN) computing processor.
- NN neural network
- applications such as intelligent cognition of the terminal 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
- 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. For example, files such as music and videos can be stored in the external memory card.
- 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.
- 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.
- 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.
- UFS universal flash storage
- 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.
- audio functions such as music playing and recording
- 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.
- 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.
- 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.
- the receiver 170B also called a "handset" is used to convert the audio electrical signal into a sound signal.
- the voice can be answered by placing the receiver 170B close to the human ear.
- 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.
- the earphone interface 170D is used to connect a wired earphone.
- the earphone interface 170D may be the USB interface 130, or may be a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
- OMTP open mobile terminal platform
- CTIA cellular telecommunications industry association of the USA
- 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.
- 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.
- touch operations acting on different applications 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.
- Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
- the SIM card interface 195 is used to connect a SIM card.
- the SIM card can be connected to or separated from the terminal 100 by inserting it into or pulling it out of 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.
- 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.
- 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.
- FIG6 shows a block diagram of a software system of a terminal 100.
- the layered architecture divides the software into several layers, each layer having a clear role and division of labor.
- the layers communicate with each other through software interfaces.
- the Android system is divided into four layers, namely, from top to bottom, the application layer, the application framework layer (Fraemwork), the local service layer (Native) and the driver layer.
- the application layer may include a series of application packages. As shown in Fig. 6, 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.
- the application package may also include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
- the application framework layer provides an application programming interface (API) and a programming framework for the application programs of the application layer.
- the application framework layer includes some predefined functions.
- the application framework layer may include an input management module (in FIG6 , the input management module includes a first input management service and a first telephone window manager as an example), a first input manager, and an input management interface.
- the input management module is used to manage the input events of the input device connected to the terminal 100.
- the input management module can also be used to monitor the input events of the input device 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 the input events of the input device of the terminal 100, and forward the intercepted input events to the keyboard and mouse sharing service.
- the first input management service is used to monitor 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 mouse devices, 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.
- the functions of monitoring and intercepting mouse events are expanded.
- the first input management service can 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, which extends the functions of monitoring and intercepting keyboard events based on the functions of the system's native phone window manager.
- the first phone window manager is HwPhoneWindowManager.
- 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.
- 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.
- 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.
- 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.
- the input management interface (InputMnagerEx) is the external interface of the input management module
- 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.
- 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.
- 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.
- the first input manager is HwInputManager.
- the application framework layer may also include a second input management service, a keyboard and mouse event monitoring service, and a Listeners, input filters, window management callbacks and native input management services.
- the second input management service is the system's native input management service (InputMangerService), which is used to manage input events.
- MouseAndKeyboardEventListener is used to listen to keyboard events and mouse events.
- Input filter InputFilter
- Window management callback (WindowManagerCallbacks) is used to determine the window on which the mouse event acts.
- Native input management service (NativeInputManagerService) is used to manage the underlying input event data.
- 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.
- 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.
- 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.
- 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.
- the input event listener can be a listener callback for the input event
- 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.
- a listener callback for mouse events is registered in the input reader for the first input management service
- a listener callback for keyboard events is registered in the input reader for the first phone window manager.
- 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.
- 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).
- the local service layer can include an input passer (InputFlinger) and an input library (Libinput).
- the input transmitter is mainly responsible for reading and distributing the original input events.
- the input transmitter includes the second input manager, the input reader (InputReader), the input distributor (InputDispatcher), the input module (InputDevice) and the event center (EventHub).
- the second input manager is the native input manager of the system.
- the input reader is used to read input events and is also used 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 based on the newly added input device node.
- the event center is used to read the original input events and is also used to create input devices.
- the input library mainly supports the event distribution process.
- the input library can include input transport (InputTransport), input publisher (InputPublisher), input message (InputMessager), input consumer (InputConsumer), input channel (InputChannel) and velocity tracker (VelocityTracker).
- the driver layer includes at least input device nodes, such as input device node 1 and input device node 2.
- the driver layer also includes display driver and processor driver.
- the terminal 100 can create a device node in the driver layer according to the device driver of the input device.
- 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.
- the event center can read the original input event reported by the device node and send the original input event to the input reader.
- 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.
- Figure 7 shows a logical schematic diagram for implementing shared input devices between a tablet and a PC.
- keyboard and mouse event listeners can be configured for the first input management service and the first phone window manager respectively.
- 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.
- 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.
- 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.
- 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.
- 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 use the filter input event mechanism to first determine whether the mouse events reported by the input reader meet the interception conditions based on the interception logic. If so, the mouse events are intercepted, that is, the mouse events are sent to the keyboard and mouse sharing service.
- the first telephone window management service is configured with a pre-queue key interception mechanism (IinterceptKeyBeforeQueueing), and an interception logic.
- the pre-queue key interception mechanism is used to intercept 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 interception condition is met.
- the input distributor can call the first window manager's front-end interception key mechanism, and use the front-end interception key mechanism to first determine 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. If so, the key event is sent to the keyboard and mouse sharing service.
- FIG8 and FIG9 show a flow chart of a method for sharing an input device. As shown in FIG8 , the method includes the following steps:
- Step 801 The user performs operation 1, which is an operation of starting the keyboard and mouse sharing service of the tablet.
- 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, and 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.
- operation 1 may be an operation of clicking a switch control of a keyboard and mouse sharing service in a keyboard and mouse sharing setting interface.
- Step 802 In response to operation 1, 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.
- the established connection refers to a connection that can share the input device with other devices.
- 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.
- 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.
- Step 803 The user performs operation 2, which is an operation of establishing a connection between the tablet and the PC.
- 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.
- operation 2 may be an operation of selecting a PC from available devices, where an available device is a device that meets the conditions for sharing an input device with the tablet, such as a device logged into the same account as the tablet.
- an available device is a device that meets the conditions for sharing an input device with the tablet, such as a device logged into the same account as the tablet.
- the setting interface for sharing keyboard and mouse includes device identifiers of available devices, and the device identifiers of available devices include PC (YOYO's computer), and operation 2 may be an operation of clicking "YOYO's computer”.
- 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.
- the keyboard and mouse sharing service in response to operation 2, 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.
- 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.
- the initialization state parameters include keyboard and mouse sharing state 1
- the keyboard and mouse sharing state 1 is used to indicate that the tablet and the computer are connected.
- 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.
- 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.
- the input reader After the input reader receives the initialization state parameter, it can store the initialization state parameter.
- 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.
- 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.
- Step 805 In response to operation 2, the keyboard and mouse sharing service sends an initialization state parameter to the first input manager.
- 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.
- 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.
- 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.
- the first input management service and the first phone window manager may store the initialization state parameter.
- Step 808 In response to operation 2, the keyboard and mouse sharing service sends a configuration monitoring instruction to the first input manager.
- 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.
- 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.
- 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.
- 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.
- 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.
- Step 811 The user moves the mouse.
- 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.
- Step 812 The input reader reads mouse event 1.
- Mouse event 1 is the mouse event triggered by the user moving the mouse.
- Step 813 The input reader calls the input distributor and sends mouse event 1 to the input distributor.
- the input reader may call the mouse notification method of the input distributor to process mouse event 1 through the mouse notification method.
- Step 814 The input distributor sends mouse event 1 to the first input management service.
- 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.
- the input distributor can also distribute mouse event 1 so that the tablet responds to mouse event 1.
- Step 815 The first input management service sends mouse event 1 to the keyboard and mouse sharing service.
- the first input management service may send the mouse event 1 to the keyboard and mouse sharing service.
- 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.
- Step 816 The keyboard and mouse sharing service determines the mouse cursor crossing according to mouse event 1.
- 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.
- the status update may be implemented through the following steps 817 to 822.
- the function of the first input management service to intercept mouse events can be configured.
- the function of the first phone window manager to intercept keyboard events can be configured.
- the keyboard and mouse sharing service may also send mouse event 1 to the PC for the PC to respond 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.
- 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.
- 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.
- 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.
- Step 818 The input reader turns off the mouse cursor drawing function according to the keyboard and mouse sharing state 2.
- the input reader may also update the stored keyboard and mouse sharing state according to the keyboard and mouse sharing state 2 , for example, updating the stored keyboard and mouse sharing state from the keyboard and mouse sharing state 1 to the keyboard and mouse sharing state 2 .
- 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.
- 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 is kept in an on state
- the keyboard and mouse sharing state is the keyboard and mouse sharing state 2
- the drawing function of the mouse cursor can be kept in an off 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.
- Step 819 The keyboard and mouse sharing service sends the keyboard and mouse sharing status 2 to the first input management service.
- 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.
- 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.
- the first input management service updates the stored keyboard and mouse sharing state 1 to keyboard and mouse sharing state 2.
- 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.
- Step 821 The keyboard and mouse sharing service sends the keyboard and mouse sharing status 2 to the first phone window manager.
- 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.
- Step 822 The first phone window manager updates the stored keyboard and mouse sharing state to keyboard and mouse sharing state 2.
- 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.
- 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.
- 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
- keyboard events can be intercepted in the future.
- 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:
- Step 823 The user moves the mouse.
- Step 824 The input reader reads 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.
- 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.
- 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.
- Step 825 The input reader sends mouse event 2 to the input distributor.
- 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.
- 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.
- the first input management service 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.
- 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.
- Step 828 The keyboard and mouse sharing service sends mouse event 2 to the event receiving module of the PC.
- Step 829 The event receiving module of the PC sends mouse event 2 to the event responding module of the PC.
- Step 830 The event response module of the PC responds to mouse event 2.
- 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.
- the stop distribution instruction 1 is used to instruct the input distributor to stop distributing mouse events.
- 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.
- 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.
- 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.
- the tablet may loop through steps 824 to 832 to intercept and forward the next mouse event.
- Step 833 The user presses a keyboard key.
- Step 834 The input reader reads 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.
- 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.
- 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.
- Step 835 The input reader sends keyboard event 1 to the input distributor.
- 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.
- 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.
- the first phone window manager can receive the keyboard event 1 through the configured keyboard event listener.
- the first phone window manager 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.
- 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.
- Step 838 The keyboard and mouse sharing service sends keyboard event 1 to the event receiving module of the PC.
- Step 839 The event receiving module of the PC sends keyboard event 1 to the event responding module of the PC.
- Step 840 The event response module of the PC responds to keyboard event 1.
- 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.
- the stop distribution instruction 2 is used to instruct the input distributor to stop distributing keyboard events.
- 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.
- 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.
- 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.
- the tablet may loop through steps 834 to 843 to intercept and forward the next keyboard event.
- the first phone window manager can not only listen to keyboard events, but also other key events.
- key events can include other key events in addition to keyboard events, such as system key events.
- system key events refer to key events of the tablet's native keys, such as the power button, volume button, etc. of the tablet.
- 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.
- 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.
- the tablet no longer forwards the input event to the PC, but responds by the tablet itself.
- 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.
- 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.
- 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.
- the first input management service sends the monitored mouse event 3 to the keyboard and mouse sharing Service, if the keyboard and mouse sharing service determines that the mouse cursor has crossed in the reverse direction according to mouse event 3, the input event forwarding function is turned off, that is, the mouse events or keyboard events after mouse event 3 are no longer forwarded to the PC.
- 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.
- 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.
- 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.
- 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.
- FIG10 shows a schematic diagram of the structure of an electronic device, which is a second electronic device, such as the computer 102 or the mobile phone 103 shown in FIG1 .
- the operating system of the second electronic device can be an Android system or a Windows system.
- the electronic device includes at least one processor 201, a communication bus 202, a memory 203, and at least one communication interface 204.
- Processor 201 may be a microprocessor (including a central processing unit (CPU)), 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.
- CPU central processing unit
- ASIC application-specific integrated circuit
- the communication bus 202 may include a pathway for transmitting information between the above-mentioned components.
- 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 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.
- the communication interface 204 uses any transceiver-like device to communicate with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc.
- RAN radio access network
- WLAN wireless local area network
- the processor 201 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG. 9 .
- the electronic device may include multiple processors, such as processor 201 and processor 205 shown in FIG9 .
- processors may be a single-core processor or a multi-core processor.
- the processor here may refer to one or more devices, circuits, and/or processing cores for processing data (such as computer program instructions).
- 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.
- the output device 206 may be a liquid crystal display (LCD), a light emitting diode (LED), or a display device.
- the input device 207 can be a display device such as a LED, a cathode ray tube (CRT), or a projector.
- the input device 207 communicates with the processor 201 and can receive user input in a variety of ways.
- the input device 207 can be a mouse, a keyboard, a touch screen device, or a sensor device.
- the electronic device may be a general electronic device or a dedicated electronic device.
- 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.
- 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.
- the computer program product includes one or more computer instructions.
- the computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device.
- the computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
- the computer instructions can be transmitted from a website, computer, server or data center to another website, 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.).
- the computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that includes one or more available media integrated.
- 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 drive (SSD)), etc.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
- Input From Keyboards Or The Like (AREA)
Abstract
一种共享输入设备的方法、电子设备及存储介质装置,属于终端交互技术领域。方法包括:第一电子设备连接有输入设备,第一电子设备的操作系统包括键鼠共享服务和输入管理模块,键鼠共享服务启动后,触发输入管理模块监听输入设备的输入事件;响应于用于触发第二电子设备共享第一电子设备的输入设备的操作,键鼠共享服务控制第一电子设备的屏幕停止显示鼠标光标,向输入管理模块发送拦截指令;输入管理模块根据拦截指令,将监听到的第一输入事件发送给键鼠共享服务;键鼠共享服务接收第一输入事件,将第一输入事件发送给第二电子设备,以使第二电子设备对第一输入事件进行响应。如此,可以实现多设备间共享输入设备。
Description
本申请要求于2023年6月30日提交到国家知识产权局、申请号为202310801731.5、申请名称为“共享输入设备的方法、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及终端交互技术领域,特别涉及一种共享输入设备的方法、电子设备及存储介质。
随着终端技术的发展,终端设备的种类和数量也越来越多。其中,终端设备可以包括:手机、平板、电脑以及可穿戴设备等。目前,一个终端设备已不能满足用户的需求,用户可以使用多个终端设备,例如使用手机、平板以及电脑以满足工作和学习的需求。但是,由于各个终端设备之间是独立的,每个终端设备拥有与自身配套的输入设备,当多个终端设备均存在业务需要用户处理时,用户需要在不同的终端设备的输入设备之间来回切换操作,操作繁琐,不利于用户体验。
发明内容
本申请提供了一种共享输入设备的方法、电子设备及存储介质,可以实现多设备间共享输入设备,使得用户可以使用同一个输入设备操控多个设备,避免了在不同输入设备之间来回切换操作,从而简化了用户的操作,提高了输入效率。所述技术方案如下:
第一方面,提供了一种共享输入设备的方法,应用于第一电子设备,第一电子设备连接有用于输入控制指令的输入设备,为共享输入设备的源端设备。第一电子设备在操作系统中配置了键鼠共享服务和输入管理模块,键鼠共享服务用于实现第一电子设备与其他电子设备之间共享输入设备的业务,输入管理模块用于管理第一电子设备的输入事件。
键鼠共享服务启动后,可以触发输入管理模块监听输入设备的输入事件。之后,若接收到用于触发第二电子设备共享第一电子设备的输入设备的操作(第二操作),响应于该操作,键鼠共享服务可以控制第一电子设备的屏幕停止显示鼠标光标,以及向输入管理模块发送拦截指令,以使输入管理模块根据拦截指令,将监听到的第一输入事件发送给键鼠共享服务。键鼠共享服务接收到第一输入事件后,可以将第一输入事件发送给第二电子设备,以使第二电子设备对第一输入事件进行响应。
通过在源端设备的操作系统中配置键鼠共享服务和输入管理模块,通过键鼠共享服务和输入管理模块对源端设备的输入事件进行监听和拦截,拦截后再转发给对端设备,以使对端设备对源端设备的输入事件进行响应,实现了源端设备与对端设备共享输入设备,使得用户可以使用同一个输入设备操控多个设备,避免了在不同输入设备之间来回切换操作,从而简化了用户的操作,提高了输入效率和用户体验。这种方案
尤其适用于操作系统为安卓系统的源端设备,扩展了共享输入设备的应用场景。
其中,输入设备可以为鼠标设备、键盘设备、触摸板、触摸屏设备和传感设备等,本申请实施例对此不做限定。示例地,该输入设备为外接输入设备,如外接鼠标或外接键盘等。通过本申请实施例提供的共享输入设备的方法,可以拦截外接输入设备的输入事件,并将拦截到的输入事件转发给第二电子设备进行响应,从而实现第二电子设备共享第一电子设备的外接输入设备,以使用户可以使用第一电子设备的外接输入设备在第二电子设备中进行输入。
其中,第二操作是指触发第二电子设备共享第一电子设备的输入设备的操作,即将输入设备切换至第二电子设备使用的切换操作。作为一个示例,输入设备是否切换至其他设备使用可以用第一电子设备的鼠标光标是否穿越来指示,比如,若鼠标光标穿越则指示输入设备切换至其他设备使用,鼠标光标未穿越则指示输入设备未切换至其他设备使用。其中,鼠标光标穿越是指鼠标光标向第一电子设备的屏幕外移动,比如,鼠标光标向第一电子设备的屏幕外且指向第二电子设备的方向移动。
键鼠共享服务启动后,可以在合适的时机为输入管理模块配置输入事件监听器,输入管理模块可以通过配置的输入事件监听器监听输入设备的输入事件。通过为输入管理模块配置输入事件监听器,可以实现对输入设备的输入事件的监听。
在一些实施例中,可以在键鼠共享服务启动后,为输入管理模块配置输入事件监听器。
在一些实施例中,可以在键鼠共享服务启动后,检测到第一电子设备与第二电子设备建立连接时,为输入管理模块配置输入事件监听器。通过在检测到第一电子设备与第二电子设备建立连接时,为输入管理模块配置输入事件监听器,触发输入事件的监听,可以节省监听功耗,避免无意义的监听。
其中,输入管理模块可以包括第一输入管理服务和第一电话窗口管理器。第一输入管理服务用于监听鼠标事件,还可以将监听的鼠标事件发送给键鼠共享服务。鼠标事件是指鼠标设备的输入事件,如鼠标设备的点击事件、移动事件或滚轮滚动事件等。第一输入管理服务是基于系统原生的输入管理服务进行扩展的输入管理服务,在系统原生的输入管理服务具有的功能的基础上,扩展了监听和拦截鼠标事件的功能。
其中,第一电话窗口管理器用于监听键盘事件,还可以将监听的键盘事件发送给键鼠共享服务。键盘事件是指键盘设备的按键事件。第一电话窗口管理器可以是基于系统原生的电话窗口管理器进行扩展的电话窗口管理器,在系统原生的电话窗口管理器具备的功能的基础上,扩展了监听和拦截键盘事件的功能。
在一些实施例中,键鼠共享服务可以为第一输入管理服务配置键鼠事件监听器,以使输入管理服务通过配置的键鼠事件监听器监听鼠标事件。如此,可以实现对鼠标事件的监听。
在一些实施例中,键鼠共享服务可以为第一电话窗口管理器配置键鼠事件监听器,以使第一电话窗口管理器通过配置的键鼠事件监听器监听包括键盘事件的按键事件。如此,可以实现对键盘事件的监听。
在一些实施例中,输入管理模块还可以根据拦截指令,控制第一电子设备不对第一输入事件进行响应。如此,可以保证只有第二电子设备对第一输入事件进行响应,
避免第一电子设备和第二电子设备同时对第一输入事件进行响应,从而避免了输入事件响应混乱,提高了使用输入设备操控电子设备的精准性。
在一些实施例中,输入管理模块可以向输入分发器发送停止分发指令,输入分发器根据停止分发指令,不对第一输入事件进行事件分发,以使第一电子设备不对第一输入事件进行响应。
通常情况下,比如在第二电子设备未共享第一电子设备的输入设备的情况下,输入分发器接收到输入读取器读取的输入事件后,可以将输入事件分发至第一电子设备中该输入事件对应的响应模块,由该响应模块对该输入事件进行响应,从而实现第一电子设备对该输入事件的响应。本申请实施例中,为了控制第一电子设备不对该输入事件进行响应,可以向输入分发器发送停止分发指令,以通过停止分发指令控制输入分发器不对该输入事件进行响应,进而实现控制第一电子设备不对输入事件进行响应。
在一些实施例中,输入管理模块包括第一输入管理服务,第一输入管理服务可以根据该拦截指令向输入分发器发送第一停止分发指令,输入分发器根据第一停止分发指令,可以不对鼠标事件进行事件分发。如此,可以实现第一电子设备不对鼠标事件进行响应,避免了对鼠标事件的响应混乱,提高了响应鼠标事件的精准度,进而提高了用户通过鼠标操控设备的精准度。
在一些实施例中,输入管理模块包括第一电话窗口管理器,第一电话窗口管理器可以向输入分发器发送第二停止分发指令,输入分发器可以根据第二停止分发指令,不对键盘事件进行事件分发。如此,可以实现第一电子设备不对键盘事件进行响应,避免了对键盘事件的响应混乱,提高了响应键盘事件的精准度,进而提高了用户通过键盘操控设备的精准度。
在一些实施例中,第一电话窗口管理器监听到第一按键事件后,可以判断第一按键事件是否为键盘事件,若确定第一按键事件是键盘事件,则将第一按键事件发送给键鼠共享服务。若确定第一按键事件不是键盘事件,则不将第一按键事件发送给键鼠共享服务。如此,可以实现仅对第一电子设备的外接键盘设备的按键事件进行拦截和转发,对于其他按键事件,如第一电子设备的系统按键事件,仍然由第一电子设备自身进行响应。
其中,系统按键事件是指第一电子设备的原生按键的按键事件。比如,原生按键可以为第一电子设备的电源按键、音量按键等。
在一些实施例中,第一输入管理服务监听到第一鼠标事件后,可以判断第一鼠标事件是否为鼠标设备的输入事件,若是,则将第一鼠标事件发送给键鼠共享服务。若不是,则不将第一按键事件发送给键鼠共享服务。如此,可以实现仅对第一电子设备的外接鼠标设备的鼠标事件进行拦截和转发,对于其他鼠标事件,如触摸板触发的鼠标事件,仍然由第一电子设备自身进行响应。
在一些实施例中,输入管理模块将监听到的第一输入事件发送给键鼠共享服务之前,输入读取器读取第一输入事件,然后调用输入分发器的输入通知方法,通过输入通知方法将第一输入事件发送给输入管理模块。
如此,可以实现输入读取器将读取的输入事件发送给输入管理模块,进而实现输入管理模块对输入事件的监听。
在一些实施例中,输入读取器可以调用输入分发器的鼠标通知方法,通过输入通知方法将第一鼠标事件发送给第一输入管理服务。输入读取器可以调用输入分发器的键盘通知方法,通过键盘通知方法将第一键盘事件发送给第一电话窗口管理器。
如此,可以分别实现输入读取器将读取的鼠标事件发送给第一输入管理模块,将读取的键盘事件发送给第一电话窗口管理器,从而实现对鼠标事件和键盘事件的监听。
在一些实施例中,键鼠共享服务启动后,还可以在合适的时机为输入读取器、第一输入管理服务和第一电话窗口管理器进行状态初始化。比如,在检测到第一电子设备与第二电子设备建立连接后,为输入读取器、第一输入管理服务和第一电话窗口管理器进行状态初始化。
其中,为输入读取器、第一输入管理服务和第一电话窗口管理器进行状态初始化的操作包括:确定键鼠共享服务的键鼠共享状态,向输入读取器、第一输入管理服务和第一电话窗口管理器发送初始化状态参数,以使输入读取器、第一输入管理服务和第一电话窗口管理器根据初始化状态参数,对存储的键鼠共享状态进行初始化。键鼠共享状态可以包括第一电子设备是否与第二电子设备建立连接,输入设备是否切换至第二电子设备使用等。其中,初始化状态参数包括当前的键鼠共享状态,以便输入读取器、第一输入管理服务和第一电话窗口管理器将存储的键鼠共享状态初始化为当前的键鼠共享状态。
在一些实施例中,键鼠共享服务控制第一电子设备的屏幕停止显示鼠标光标的操作包括:键鼠共享服务向输入读取器发送第一控制指令,输入读取器根据第一控制指令,关闭鼠标光标的绘制功能,以使第一电子设备的屏幕停止显示鼠标光标。
另外,键鼠共享服务若检测到键鼠共享状态发生变更,还可以根据变更后的键鼠共享状态对输入读取器、第一输入管理服务和第一电话窗口管理器存储的键鼠共享状态进行更新。
通过对输入读取器、第一输入管理服务和第一电话窗口管理器进行状态初始化和状态更新,可以使得输入读取器根据键鼠共享状态控制鼠标光标的绘制功能的开启或关闭,使得第一输入管理服务可以根据键鼠共享状态控制对鼠标事件的拦截,使得第一电话窗口管理器可以根据键鼠共享状态控制对键盘事件的拦截。
例如,上述第一控制指令可以为第二键鼠共享状态信息,第二键鼠共享状态信息用于指示第二电子设备共享第一电子设备的输入设备,即第一电子设备的输入设备切换至第二电子设备使用。再例如,上述拦截指令也可以为第二键鼠共享状态信息。
在一些实施例中,键鼠共享服务可以触发输入管理模块监听输入设备的输入事件,以及将监听的输入事件发送给键鼠共享服务。在键鼠共享服务控制第一电子设备的屏幕停止显示鼠标光标,向输入管理模块发送拦截指令之前,输入管理模块还可以监听到第二输入事件,将第二输入事件发送给键鼠共享服务,键鼠共享服务若根据第二输入事件确定鼠标光标穿越,则确定接收到第二电子设备共享第一电子设备的操作,然后控制第一电子设备的屏幕停止显示鼠标光标,以及向输入管理模块发送拦截指令。其中,鼠标光标穿越是指第一电子设备的鼠标光标向第一电子设备的屏幕外移动,如向屏幕左侧边界外移动,或向屏幕右侧边界外移动。
如此,用户可以通过移动鼠标操控鼠标光标穿越,即操控鼠标光标向第一电子设
备的屏幕外移动,比如向屏幕左侧边界外移动,或向屏幕右侧边界外移动,来将第一电子设备的输入设备切换至第二电子设备上使用,方便用户操作,提高了共享输入设备的灵活性和效率。
第二方面,提供了一种共享输入设备的装置,所述共享输入设备的装置具有实现上述第一方面中共享输入设备的方法行为的功能。所述共享输入设备的装置包括至少一个模块,所述至少一个模块用于实现上述第一方面所提供的共享输入设备的方法。
第三方面,提供了一种共享输入设备的装置,所述共享输入设备的装置的结构中包括处理器和存储器,所述存储器用于存储支持共享输入设备的装置执行上述第一方面所提供的共享输入设备的方法的程序,以及存储用于实现上述第一方面所述的共享输入设备的方法所涉及的数据。所述处理器被配置为用于执行所述存储器中存储的程序。所述共享输入设备的装置还可以包括通信总线,所述通信总线用于在所述处理器与所述存储器之间建立连接。
第四方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面所述的共享输入设备的方法。
第五方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的共享输入设备的方法。
上述第二方面、第三方面、第四方面和第五方面所获得的技术效果与上述第一方面中对应的技术手段获得的技术效果近似,在这里不再赘述。
图1示出了一种通信系统的示意图;
图2示出了一种键鼠穿越的示意图;
图3示出了一种键鼠反向穿越的示意图;
图4示出了一种通过设置界面对键鼠共享进行设置的界面示意图;
图5示出了一种终端的结构示意图;
图6示出了一种终端的软件系统的框图;
图7示出了一种实现平板与PC之间共享输入设备的逻辑示意图;
图8示出了一种共享输入设备的方法流程图;
图9示出了另一种共享输入设备的方法流程图;
图10示出了一种电子设备的结构示意图。
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请的实施方式作进一步地详细描述。
应当理解的是,本申请提及的“多个”是指两个或两个以上。在本申请的描述中,除非另有说明,“/”表示或的意思,比如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,比如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,为了便于清楚描述本申请的技术方案,采用了“第一”、“第二”等字样对功能和作用基本相同
的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。在本申请实施例的描述中,除非另有说明,“多个”的含义是指两个或两个以上。例如,多个处理单元是指两个或两个以上的处理单元;多个系统是指两个或两个以上的系统。
在对本申请实施例提供的共享输入设备的方法进行详细地解释说明之前,先对本申请实施例涉及应用场景予以说明。
多设备协同是一种应用于多个电子设备的分布式技术。利用多设备协同技术,两个或者多个电子设备之间可以进行跨系统、跨设备的协同,实现资源共享、协同操作。
多设备协同可以应用于同类型或者不同类型的电子设备之间。其中,电子设备的类型包括但不限于手机、平板电脑、笔记本电脑、大屏设备(例如:智能电视、智慧屏)、个人计算机(persona1computer,PC)、手持计算机、上网本、个人数字助理(personal digital assistant,PDA)、可穿戴电子设备、车载设备、虚拟现实设备等设备。
多设备协同需要基于设备间的通信连接实现。该通信连接可以是有线通信连接,也可以是无线通信连接。其中,有线通信连接的解决方案例如可以包括USB On-The-Go(OTG)技术;无线通信的解决方案例如可以包括如无线保真(wireless fidelity,Wi-Fi),Wi-Fi直连(Wi-Fi Direct),蓝牙(bluetooth,BT),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等。
随着终端技术的不断发展,多设备协同已经产生了多种不同的协同类型,如键鼠协同。
键鼠协同:键鼠协同是指多个设备之间共享输入设备,如共享鼠标、键盘等。举例来说,电子设备A与电子设备B共享电子设备A的输入设备,也即是,用户既可以使用共享的输入设备在电子设备A中进行输入,也可以使用共享的输入设备在电子设备B中进行输入。
为了更好地理解本申请实施例,首先对本申请实施例适用的通信系统进行介绍。
请参考图1,图1示出了一种通信系统的示意图。如图1所示,通信系统包括平板101、电脑102和手机103。平板101外接有鼠标和键盘。其中,平板101和手机103的操作系统为安卓(Android)系统,电脑102的操作系统为Windows系统。平板101、电脑102和手机103可以共享平板101外接的鼠标和键盘。也即是,用户可以使用平板101外接的鼠标和键盘在平板101上进行输入,也可以使用平板101外接的鼠标和键盘在电脑102或手机103上进行输入。在这种情况下,平板101可以称为源端设备或者发送端,电脑102和手机103可以称为对端设备或者接收端,但本申请实施例并不限于此。
如图所示,平板101通过有线方式与鼠标、键盘等输入设备连接,比如,通过USB接口与输入设备连接。应理解,平板101也可以通过无线方式与鼠标、键盘等输入设备连接,比如通过近距离无线通信技术与输入设备连接,近距离无线通信技术可以为Wi-Fi或者蓝牙等。还应理解,图1仅是以多设备共享的输入设备为鼠标和键盘为例,输入设备还可以为触摸屏设备或传感设备等,本申请实施例对共享的输入设备不做限
定。
在共享键盘和鼠标的情况下,若键盘和鼠标在不同设备之间切换使用,则平板101与电脑102之间可以实现键鼠穿越,平板101与手机103之间可以实现键鼠穿越。比如,平板101的左侧或者右侧可以与一个设备实现键鼠穿越,也就是说,平板101可以支持鼠标从平板101屏幕左侧穿越至一个其他的设备,也可以支持鼠标从平板101屏幕右侧穿越至一个其他的设备。若平板101可以与电脑102、手机103实现键鼠穿越,则电脑102在平板101的右侧,且手机103在平板101的左侧,或者,电脑102在平板101的左侧,且手机103在平板101的右侧。若电脑102和手机103均在平板101的左侧,或者,电脑102和手机103均在平板101的右侧,平板101可以一次与一个设备(电脑102或者手机103)实现键鼠穿越。
平板101的键鼠穿越至电脑102和/或手机103后,用户可以使用平板101的鼠标对电脑102和/或手机103进行点击、拖动或者双击等操作,可以使用平板101的键盘在电脑102和/或手机103上输入信息。
示例性地,请参考图2,图2示出了一种键鼠穿越的示意图。如图2中的a图所示,平板101外接鼠标和键盘,当前鼠标和键盘在平板101上进行输入,鼠标光标1011显示在平板101的屏幕上。另外,平板101和电脑102可以共享鼠标和键盘。若将键盘和鼠标从平板101切换至电脑102上使用,则平板101可以与电脑102实现键鼠穿越,也就是说,平板101显示的鼠标光标1011可以从平板101的屏幕穿越至电脑102的屏幕。比如,用户可以通过移动鼠标实现鼠标光标1011的穿越操作,当平板101检测到鼠标光标1011的穿越操作时,可以显示图2中的b图所示界面,如图2中的b图所示,鼠标光标1011显示在电脑102的屏幕上。其中,鼠标光标1011的穿越操作可以是将鼠标光标向平板101的屏幕外侧移动的操作。比如,请参考图2中的a图,鼠标光标1011的穿越操作为通过移动鼠标控制鼠标光标1011向屏幕右侧边界外移动的操作。应理解,用户也可以通过其他操作实现将键盘和鼠标从平板101切换至电脑102上使用,本申请实施例对此不做限定。
如图2中的a图所示,鼠标光标1011在平板101的屏幕上以圆圈的形式显示,如图2中的b图所示,鼠标光标1011在电脑102的屏幕上可以以指针的形式显示。可以理解的是,本申请实施例仅是以上述鼠标光标显示形式为例,鼠标光标在平板101或电脑102上也可以显示为其他形式,本申请实施例对此不做限定。
另外,在鼠标光标1011从平板101穿越到电脑102之后,用户可以通过平板101的键盘在电脑102中进行输入。比如,如图2中的b图所示,用户可以通过鼠标光标1011点击“文档1”的图标,电脑102响应于用户点击“文档1”的图标的操作,可以显示图2中的c图所示界面。如图2中的c图所示,电脑102显示文档1的编辑页面。用户可以通过平板101的键盘在文档1的编辑页面输入信息“我的文档”,电脑102响应于用户在文档1的编辑页面输入信息的操作,在文档1的编辑页面显示“我的文档”。
另外,若将键盘和鼠标从电脑102重新切换至平板101使用,鼠标光标1011还可以从电脑102穿越回平板101。请参考图3,图3示出了一种键鼠反向穿越的示意图。如图3中的a图所示,鼠标光标1011显示在电脑102的屏幕上。用户可以移动鼠标实
现鼠标光标1011的穿越操作,当电脑102检测到鼠标光标1011的穿越操作时,可以显示图3中的b图所示界面,如图3中的b图所示,鼠标光标1011重新显示在平101的屏幕上。其中,鼠标光标1011的穿越操作可以是将鼠标光标向电脑102的屏幕外侧移动的操作。请参考图3中的a图,鼠标光标1011的穿越操作为通过移动鼠标控制鼠标光标1011向屏幕左侧边界外移动的操作。
其中,平板101与电脑102、手机103共享输入设备的条件可以为平板101、电脑102以及手机103使用同一账号登录;和/或,平板101、电脑102以及手机103通过Wi-Fi或者蓝牙连接。其中,Wi-Fi可以包括局域网或者个人对个人(peer to pee,P2P)。
平板101可以感知所有满足共享输入设备的条件的设备,与平板101实现共享输入设备的数量可以为一个或多个。当平板101感知的设备多于两个时,平板101可以基于用户选择设备的操作,与用户选择的设备实现共享输入设备,或者,平板101可以基于预设规则自主选择共享输入设备的设备,本申请实施例对预设规则不作限定。
平板101与电脑102、手机103连接以实现设备共享,包括两种实现方式。一种可能的实现方式是手动选择。手动选择选项为平板101的用户可以自主选择连接设备的选项,在关闭(或者未开启)自动选择选项的情况下,用户可以在可视化界面手动拖动或者点击可连接的设备以实现平板101与电脑102、手机103连接。另一种可能的实现方式是自动选择。在开启自动选择选项、且电脑102和手机103满足共享输入设备的条件的情况下,平板101可以自动连接电脑102、手机103。其中,自动选择选项在不同设备中可以处于不同的位置。例如,自动选择选项可以在平板101和手机103的设置界面或控制中心中。自动选择选项可以在电脑102的电脑管家中。
示例性地,图4示出了一种通过设置界面对键鼠共享进行设置的界面示意图。若用户想要设置键鼠共享的相关参数,用户可以点击设置图标,响应于用户的点击操作,平板101显示设置界面,如图4中的a图所示,设置界面可以包括蓝牙、移动数据、智慧互联等选项,当然也可以包括其他设置选项。用户点击智慧互联选项,响应于用户点击智慧互联选项的操作,平板101可以显示如图4中的a图的右侧所示键鼠共享设置界面。如图4中的a图所示,键鼠共享设置界面包括键鼠共享的开关控件。若用户想要开启平板101共享输入设备的功能,则可以点击键鼠共享的开关控件。响应于用户点击键鼠共享的开关控件的操作,如图4中b图所示,键鼠共享的开关控件切换至开启状态。
另外,如图4中b图所示,在键鼠共享的开关控件切换至开启状态后,键鼠共享设置界面还可以显示自动连接选项和自动切换方向选项,用户可以点击自动连接选项以开启自动连接的功能,以及点击自动切换方向选项开启自动切换方向的功能。在自动连接的功能开启后,平板101可以自动连接可用设备,比如用户可以将鼠标光标连续两次贴近屏幕边缘,来触发平板101自动连接可用设备。其中,可用设备是指可以与平板101建立共享输入设备的连接的设备,即满足共享输入设备的条件的设备。在自动切换方向的功能开启后,平板101可以跟随设备摆放位置的变化,自动切换屏幕排列位置。比如,在检测到电脑102摆放在平板101的左侧时,将键鼠穿越方向配置为从屏幕左侧穿越至电脑102的屏幕;在检测到电脑102摆放在平板101的右侧时,将键鼠穿越方向配置为从屏幕右侧穿越至电脑102的屏幕。
另外,键鼠设置界面还可以显示可用设备的设备标识,如图4中的b图所示,键鼠设置界面可以显示可用设备:YOYO的电脑、YOYO的手机以及HONOR Pad。用户可以基于可用设备的设备标识,自主从可用设备中选择建立连接的设备。例如,用户可以点击YOYO的电脑,响应于用户的点击操作,平板101建立平板101与YOYO的电脑之间的连接。在平板101与YOYO的电脑连接后,平板101可以显示如图4中的c图所示的键鼠共享设置界面。如图4中的c图所示,键鼠共享设置界面可以显示平板101与YOYO的电脑已连接的指示信息,还可以显示穿越方向选项,比如穿越方向选项包括左侧穿越选项和右侧穿越选项。假设YOYO的电脑摆放在平板101右侧,用户可以点击右侧穿越选项,响应于用户的点击操作,平板101可以配置平板101与YOYO的电脑共享输入设备的键鼠穿越方向为向屏幕右侧穿越,也即是,平板101的鼠标光标可以从屏幕右侧穿越至YOYO的电脑。
应理解,图4仅是以通过设置界面开启键鼠共享功能,以及对键鼠共享功能的相关功能参数进行设置为例进行说明,在其他实施例中,还可以通过其他方式开启键鼠共享功能,以及对键鼠共享功能的相关功能参数进行设置,本申请实施例对此不做限定。
需要说明的是,上述实施例仅是以多设备间共享鼠标和键盘为例,多设备间也可以共享其他输入设备,本申请实施例对此不做限定。另外,上述实施例仅是以源端设备为平板,对端设备电脑和手机为例,应理解,在其他实施例中,源端设备和对端设备也可以为其他设备。
其中,源端设备的操作系统为Windows系统或安卓系统,对端设备的操作系统也可以为Windows系统或安卓系统。
在一些实施例中,针对源端设备的操作系统为Windows系统的场景,提出了实现源端设备与对端设备间共享输入设备的方案。但是由于不同的操作系统存在差异,因此,适用于源端设备的操作系统为Windows系统的共享输入设备的方案,可能并不适应于源端设备的操作系统为安卓系统的场景。
本申请实施例中,为了使得在源端设备的操作系统为安卓系统的情况下,也能实现设备间的输入设备共享,提出了如下共享输入设备的方法:在源端设备的操作系统中配置了键鼠共享服务和输入管理模块,其中,键鼠共享服务用于实现源端设备与对端设备之间共享输入设备的业务,输入管理模块用于管理源端电子设备的输入事件。在源端设备连接有用于输入控制指令的输入设备的情况下,键鼠共享服务启动后,可以触发输入管理模块监听输入设备的输入事件。之后,若接收到用于触发对端设备共享源端设备的输入设备的操作,响应于该操作,键鼠共享服务可以控制源端设备的屏幕停止显示鼠标光标,以及向输入管理模块发送拦截指令,以使输入管理模块根据拦截指令,将后续监听到的输入事件发送给键鼠共享服务。键鼠共享服务接收到输入管理模块发送的输入事件后,将输入事件转发给对端设备,以使其他设备对该输入事件进行响应。
通过在源端设备的操作系统中配置键鼠共享服务和输入管理模块,通过键鼠共享服务和输入管理模块将源端设备的输入事件进行监听和拦截,拦截后再转发给对端设备,以使对端设备对源端设备的输入事件进行响应,实现了源端设备与对端设备共享
输入设备,使得用户可以使用同一个输入设备操控多个设备,避免了在不同输入设备之间来回切换操作,从而简化了用户的操作,提高了输入效率和用户体验。而且,这种方案适用于操作系统为安卓系统的源端设备,扩展了共享输入设备的应用场景。
另外,输入管理模块根据拦截指令,除了可以将后续监听到的输入事件发送给键鼠共享服务,还可以控制源端设备不对监听到的该输入事件进行响应。比如,输入管理模块可以向输入分发器发送停止分发指令,输入分发器根据该停止分发指令可以停止对该输入事件进行事件分发,即不会将该输入事件发送给源端设备中该输入事件对应的响应模块进行响应,从而使得源端设备不会对该输入事件进行响应。
作为一个示例,该输入设备为外接输入设备,如外接鼠标或外接键盘。通过本申请实施例提供的共享输入设备的方法,可以拦截外接输入设备的输入事件,并将拦截到的输入事件转发给对端设备进行响应。
为了便于说明,以下实施例将源端设备称为第一电子设备,对端设备称为第二电子设备。
其中,第一电子设备和第二电子设备可以为终端设备。接下来,以第一电子设备为终端设备为例,对第一电子设备的结构进行介绍。
图5示出了一种终端的结构示意图。参见图5,终端100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中,传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本申请实施例示意的结构并不构成对终端100的具体限定。在本申请另一些实施例中,终端100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,比如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是终端100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使
用的指令或数据。如果处理器110需要再次使用该指令或数据,可从该存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口,如可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C接口。处理器110可以通过不同的I2C接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。比如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C接口通信,实现终端100的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S接口。处理器110可以通过I2S接口与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
UART接口是一种通用串行数据总线,用于异步通信。UART接口可以为双向通信总线。UART接口可以将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。比如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现终端100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现终端100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为终端100充电,也可
以用于终端100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。USB接口130还可以用于连接其他终端,比如AR设备等。USB接口130还可以用于连接输入设备。输入设备可以是鼠标、键盘、触摸屏设备或传感设备等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对终端100的结构限定。在本申请另一些实施例中,终端100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过终端100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为终端100供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
终端100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。终端100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。比如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在终端100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在终端100上的包括无线局域网(wireless local
area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,终端100可以通过无线通信模块160与鼠标、键盘等输入设备连接。比如,通过蓝牙与输入设备连接。
在一些实施例中,终端100还可以通过无线通信模块160与其他设备建立连接,以通过建立的连接与其他设备共享输入设备。
在一些实施例中,终端100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得终端100可以通过无线通信技术与网络以及其他设备通信。无线通信技术可以包括全球移动通讯系统(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,和/或IR技术等。GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
终端100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,终端100可以包括1个或N个显示屏194,N为大于1的整数。
终端100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。比如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优
化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,终端100可以包括1个或N个摄像头193,N为大于1的整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。比如,当终端100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。终端100可以支持一种或多种视频编解码器。这样,终端100可以播放或录制多种编码格式的视频,比如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,比如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现终端100的智能认知等应用,比如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,比如Micro SD卡,实现扩展终端100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。比如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,计算机可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,来执行终端100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储终端100在使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,比如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
终端100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D以及应用处理器等实现音频功能,比如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。终端100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当终端100接
听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。终端100可以设置至少一个麦克风170C。在另一些实施例中,终端100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,终端100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动终端平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
按键190包括开机键,音量键等。按键190可以是机械按键,也可以是触摸式按键。终端100可以接收按键输入,产生与终端100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。比如,作用于不同应用(比如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,也可对应不同的振动反馈效果。不同的应用场景(比如:时间提醒,接收信息,闹钟,游戏等),也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和终端100的接触和分离。终端100可以支持1个或N个SIM卡接口,N为大于1的整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。终端100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,终端100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在终端100中,不能和终端100分离。
接下来对终端100的软件系统予以说明。
终端100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的安卓(Android)系统为例,对终端100的软件系统进行示例性说明。
图6示出了一种终端100的软件系统的框图。参见图6,分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层(Fraemwork),本地服务层(Native)和驱动层。
应用程序层可以包括一系列应用程序包。如图6所示,应用程序包可以包括键鼠共享服务。键鼠共享服务用于实现终端100与其他设备之间共享输入设备的业务。
另外,应用程序包还可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。如图6所示,应用程序框架层可以包括输入管理模块(图6中以输入管理模块包括第一输入管理服务和第一电话窗口管理器为例)、第一输入管理器和输入管理接口。
其中,输入管理模块用于管理终端100连接的输入设备的输入事件。本申请实施例中,输入管理模块还可以用于监听终端100的输入设备的输入事件,以及将监听的输入事件发送给键鼠共享服务。即,输入管理模块可以用于拦截终端100的输入设备的输入事件,将拦截的输入事件转发给键鼠共享服务。第一输入管理服务用于监听终端100的鼠标事件,还可以将监听的鼠标事件发送给键鼠共享服务。鼠标事件是指鼠标设备的输入事件,如鼠标的点击事件、移动事件和滚轮滚动事件等。第一输入管理服务是基于系统原生的输入管理服务进行扩展的输入管理服务,在系统原生的输入管理服务具有的功能的基础上,扩展了监听和拦截鼠标事件的功能。比如,第一输入管理服务可以为HwInputMangerService。第一电话窗口管理器用于监听终端100的键盘事件,还可以将监听的键盘事件发送给键鼠共享服务。键盘事件是指键盘设备的按键事件。第一电话窗口管理器可以是基于系统原生的电话窗口管理器基于扩展的电话窗口管理器,在系统原生的电话窗口管理器具备的功能的基础上,扩展了监听和拦截键盘事件的功能。比如,第一电话窗口管理器如HwPhoneWindowManager。
另外,第一输入管理服务可以配置拦截逻辑,通过配置的拦截逻辑,可以仅对特定类型的鼠标事件进行拦截,即仅将特定类型的鼠标事件发送给键鼠共享服务,对于其他类型的鼠标事件,则不进行拦截,即不发送给键鼠共享服务,而是继续由终端100进行响应。比如,接收到输入读取器上报的鼠标事件后,可以通过拦截逻辑识别鼠标事件是否为外接的鼠标设备触发的鼠标事件,若是,则对其进行拦截,若否,则不对其进行拦截。
另外,第一电话窗口管理器可以配置拦截逻辑,通过配置的拦截逻辑,可以仅对特定类型的按键事件进行拦截,即仅将特定类型的按键事件发送给键鼠共享服务,对于其他类型的按键事件,则不进行拦截,即不发送给键鼠共享服务,而是继续由终端100进行响应。比如,接收到输入读取器上报的按键事件后,可以通过拦截逻辑识别按键事件是否为外接的键盘设备触发的按键事件,若是,则对其进行拦截,若否,则不对其进行拦截。
其中,输入管理接口(InputMnagerEx)为输入管理模块的对外接口,第一输入管理器为输入管理模块的对内接口。外部模块需要通过输入管理接口和第一输入管理来调用输入管理模块。比如,外部模块调用输入管理模块的过程包括:外部模块先调用输入管理接口,通过输入管理接口调用第一输入管理器,再通过第一输入管理器来调用输入管理模块。比如,通过第一输入管理器来调用第一输入管理服务或第一电话窗口管理器。第一输入管理器是基于系统原生的输入管理器扩展的输入管理器,比如,第一输入管理器为HwInputManager。
另外,如图6所示,应用程序框架层还可以包括第二输入管理服务、键鼠事件监
听器、输入过滤器、窗口管理回调和本地输入管理服务。其中,第二输入管理服务为系统原生的输入管理服务(InputMangerService),用于对输入事件进行管理。键鼠事件监听器(MouseAndKeyboardEventListener)用于监听键盘事件和鼠标事件。输入过滤器(InputFilter)用于对输入事件进行过滤,以过滤出满足要求的输入事件。窗口管理回调(WindowManagerCallbacks)用于确定鼠标事件作用的窗口。本地输入管理服务(NativeInputManagerService)用于管理底层的输入事件数据。
作为一个示例,输入管理模块可以通过键鼠共享服务配置的输入事件监听器来监听输入事件,输入事件监听器可以包括键鼠事件监听器等。比如,键鼠共享服务可以调用输入管理接口,通过输入管理接口调用第一输入管理器,通过第一输入管理器为输入管理模块配置输入事件监听器,以使输入管理模块可以通过配置的输入事件监听器监听输入事件。比如,通过第一输入管理器为第一输入管理服务配置键鼠事件监听器,以使第一输入管理服务可以通过配置的键鼠事件监听器监听鼠标事件。再比如,通过第一输入管理器为第一电话窗口管理器配置键鼠事件监听器,以使第一电话窗口管理器可以通过配置的键鼠事件监听器监听键盘事件。
其中,输入事件监听器可以为输入事件的监听回调,相应地,键鼠事件监听器可以为键鼠事件的监听回调。键鼠共享服务为输入管理模块配置输入事件监听器,是指为输入管理模块在输入读取器中注册监听回调,以便输入读取器读取到输入事件后,通过注册的监听回调,将输入事件回调给输入管理模块。比如,为第一输入管理服务在输入读取器中注册鼠标事件的监听回调,以及为第一电话窗口管理器在输入读取器中注册键盘事件的监听回调。
另外,应用程序框架层还可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等,本申请实施例对此不做限定。
本地服务层主要包括一些本地服务和链接库。请参考图6,本地服务层可以包括输入传递者(InputFlinger)和输入库(Libinput)。
其中,输入传递者主要负责对原始输入事件的读取和分发。如图6所示,输入传递者包括第二输入管理器、输入读取器(InputReader)、输入分发器(InputDispatcher)、输入模块(InputDevice)和事件中心(EventHub)。第二输入管理器为系统原生的输入管理器。输入读取器用于读取输入事件,还用于开启和关闭鼠标光标的绘制功能。输入分发器用于对输入事件进行分发。输入模块与驱动层的输入设备节点对应,由事件中心根据新增的输入设备节点创建。事件中心用于读取原始输入事件,还用于创建输入设备。
输入库主要对事件分发流程进行支撑。如图6所示,输入库可以包括输入运输(InputTransport)、输入发布者(InputPublisher)、输入消息(InputMessager)、输入消费者(InputConsumer)、输入通道(InputChannel)和速度跟踪器(VelocityTracker)等。
驱动层包括至少包含输入设备节点,比如包含输入设备节点1和输入设备节点2。另外,驱动层还包括显示驱动和处理器驱动等。
鼠标、键盘、触摸板等输入设备连接终端100后,终端100可以根据输入设备的设备驱动在驱动层创建设备节点。当有输入设备连接终端100,终端100为连接的输
入设备在驱动层创建对应的设备节点后,可以将创建的设备节点的信息添加到设备节点目录。事件中心可以扫描设备节点目录,从设备节点目录读取新增的设备节点,并在本地服务层为新增的设备节点创建输入模块。当设备节点上报输入事件时,事件中心可以读取设备节点上报的原始输入事件,将原始输入事件发送给输入读取器。输入读取器接收到事件中心发送的原始输入事件后,可以对原始输入事件进行封装,生成特定类型的输入事件,然后将生成的输入事件通过输入管理模块配置的输入事件监听器发送给输入管理模块,再由输入管理模块将输入事件发送给键鼠共享服务进行处理。
接下来结合图6,示例性说明终端100软件的工作流程。
请参考图7,图7示出了一种实现平板与PC之间共享输入设备的逻辑示意图。如图7所示,键鼠共享服务启动后,可以为第一输入管理服务和第一电话窗口管理器分别配置键鼠事件监听器。之后,一方面,若输入读取器读取到鼠标事件,可以调用输入分发器的鼠标通知方法,通过鼠标通知方法将鼠标事件发送给第一输入管理服务,第一输入管理服务接收鼠标事件,将接收的鼠标事件发送给键鼠共享服务。另一方面,若输入读取器读取到键盘事件,可以调用输入分发器的按键通知方法,通过按键通知方法将键盘事件发送给第一电话窗口管理器,第一电话窗口管理器接收键盘事件,将接收的键盘事件发送给键鼠共享服务。
另外,在键鼠共享服务接收到第一输入管理服务发送的鼠标事件后,键鼠共享服务还可以根据接收的鼠标事件判断鼠标光标是否穿越。例如,在输入读取器某次上报鼠标事件后,若键鼠共享服务根据第一输入管理器监听的此次鼠标事件判断鼠标光标穿越,键鼠共享服务可以执行如下操作:1,向输入读取器发送控制指令1,以使输入读取器根据控制指令1关闭鼠标光标的绘制功能;2,将第一输入管理服务监听的鼠标事件转发给PC;3,向第一输入管理服务和第一电话窗口管理器发送设置参数,设置参数包括第一键鼠服务状态信息,第一状态信息用于指示鼠标光标穿越。第一输入管理服务根据第一键鼠服务状态信息,可以向输入分发器发送停止分发指令1,以使输入分发器根据停止分发指令1停止对鼠标事件进行分发。第一电话窗口管理器根据第一键鼠服务状态信息,可以向输入分发器发送停止分发指令2,以使输入分发器根据停止分发指令2停止对键盘事件进行分发。之后,键鼠共享服务若接收到第一输入管理器监听的鼠标事件,则将接收的鼠标事件转发给PC进行处理,若接收到第一电话窗口管理器监听的键盘事件,则将接收的键盘事件转发给PC进行处理。PC包括事件接收模块和事件响应模块,PC可以通过事件接收模块接收键鼠共享服务转发的鼠标事件或键盘事件,通过事件响应模块对接收的鼠标事件或键盘事件进行响应。
另外,如图7所示,第一输入管理服务配置有过滤输入事件(FilterInputEvent)机制,且配置有拦截逻辑。过滤输入事件机制用于对输入读取器上报的鼠标事件进行拦截,拦截逻辑用于判断读取的鼠标事件是否满足拦截条件。输入分发器可以调用第一输入管理服务的过滤输入事件机制,通过滤输入事件机制先基于拦截逻辑判断输入读取器上报的鼠标事件是否满足拦截条件,若满足,则对鼠标事件进行拦截,即将鼠标事件发送给键鼠共享服务。同理,第一电话窗口管理服务配置有队前截取按键机制(IinterceptKeyBeforeQueueing),且配置有拦截逻辑。队前截取按键机制用于对输入读取器上报的按键事件进行拦截,拦截逻辑用于判断输入读取器上报的按键事件是否
满足拦截条件。输入分发器可以调用第一窗口管理器的队前截取按键机制,通过队前截取按键机制先基于拦截逻辑判断输入读取器上报的按键事件是否满足拦截条件,若满足,则对按键事件进行拦截,即将按键事件发送给键鼠共享服务。比如,判断按键事件是否为外接键盘的按键事件,若是,则将按键事件发送给键鼠共享服务。
接下来结合图6和图7,对本申请实施例提供的共享输入设备的方案进行详细说明。
图8和图9示出了一种共享输入设备的方法流程图,如图8所示,该方法包括如下步骤:
步骤801:用户执行操作1,操作1为启动平板的键鼠共享服务的操作。
其中,操作1可以为点击平板的相关界面显示的键鼠共享服务的开关控件的操作,键鼠共享服务的开关控件用于开启或关闭平板的键鼠共享服务。例如,请参考图4中的a图,操作1可以为点击键鼠共享设置界面中的键鼠共享服务的开关控件的操作。
步骤802:响应于操作1,键鼠共享服务启动。
键鼠共享服务启动后,可以检测键鼠共享服务的键鼠共享状态。键鼠共享状态可以包括平板是否与其他设备建立连接,输入设备是否切换至其他设备使用等。其中,所建立的连接是指能够与其他设备共享输入设备的连接。
本申请实施例中,输入设备是否切换至其他设备使用可以用平板的鼠标光标是否穿越来指示,比如,若鼠标光标穿越指示输入设备切换至其他设备使用,鼠标光标未穿越指示输入设备未切换至其他设备使用。其中,鼠标光标穿越是指鼠标光标向平板的屏幕外移动。
应理解,键鼠共享状态也可以包括其他状态,输入设备是否切换至其他设备使用也可以通过其他信息指示,本申请实施例对此不做限定。
步骤803:用户执行操作2,操作2为建立平板与PC的连接的操作。
其中,操作2用于触发平板与PC建立连接,所建立的连接为能够共享输入设备的连接。
作为一个示例,操作2可以为从可用设备中选择PC的操作,可用设备为满足与平板共享输入设备的条件的设备,比如与平板登录同一账号的设备。比如,请参考图4中的b图,键鼠共享的设置界面包括可用设备的设备标识,可用设备的设备标识包括PC(YOYO的电脑),操作2可以为点击“YOYO的电脑”的操作。
另外,操作2还可以为其他用于触发平板与PC建立连接的操作,比如,操作2为将鼠标指针连续两次贴近平板边缘的操作等。
本申请实施例中,响应于操作2,键鼠共享服务可以为输入读取器、第一输入管理服务和第一电话窗口管理器进行状态初始化,以及为第一输入管理服务和第一电话窗口管理器配置监听。进行状态初始化和配置监听的过程可以包括如下步骤804-步骤810。
步骤804:响应于操作2,键鼠共享服务向输入读取器发送键鼠共享服务的初始化状态参数,初始化状态参数包括键鼠共享状态1,键鼠共享状态1用于指示平板和电脑已连接。
也即是,键鼠共享服务可以为输入读取器配置键鼠共享服务的初始化键鼠共享状态,初始化的键鼠共享状态为键鼠共享状态1。
其中,键鼠共享服务的键鼠共享状态可以包括平板和电脑是否连接,鼠标光标是否穿越等。键鼠共享服务的初始化状态参数包括初始化键鼠共享状态,初始化键鼠共享状态为键鼠共享状态1。
输入读取器接收到初始化状态参数后,可以存储初始化状态参数。
应理解,也可以在其他时机进行状态初始化和配置监听,相应地,所配置的初始化键鼠共享状态也可以为其他初始化共享状态,本申请实施例对此不做限定。比如,也可以在键鼠共享服务启动后进行状态初始化和配置监听,相应地,初始化键鼠共享状态可以为键鼠共享状态3,键鼠共享状态3用于指示平板和电脑未连接。
步骤805:响应于操作2,键鼠共享服务向第一输入管理器发送初始化状态参数。
比如,键鼠共享服务可以根据初始化状态参数调用第一输入管理器,以向第一输入管理器发送初始化状态参数。
本申请实施例中,键鼠共享服务可以通过第一输入管理器对第一输入管理服务和第一电话窗口管理器进行状态初始化。比如,根据初始化状态参数调用第一输入管理器,通过第一输入管理器向第一输入管理服务和第一电话窗口管理器发送初始化状态参数。
作为一个示例,键鼠共享服务可以先调用输入管理接口,通过输入管理接口来调用第一输入管理器。
步骤806:第一输入管理器接收到键鼠共享状态1后,向第一输入管理服务发送初始化状态参数。
步骤807:第一输入管理器接收到键鼠共享状态1后,向第一电话窗口管理器发送初始化状态参数。
第一输入管理服务和第一电话窗口管理器接收到初始化状态参数后,可以存储初始化状态参数。
步骤808:响应于操作2,键鼠共享服务向第一输入管理器发送配置监听指令。
比如,键鼠共享服务可以根据配置监听指令调用第一输入管理器,以向第一输入管理器发送配置监听指令。
其中,配置监听指令用于指示为第一输入管理服务和第一电话窗口管理器配置键鼠事件监听器。
步骤809:第一输入管理器根据配置监听指令,为第一输入管理服务配置键鼠事件监听器。
步骤810:第一输入管理器根据配置监听指令,为第一电话窗口管理器配置键鼠事件监听器。
之后,第一输入管理服务即可通过键鼠事件监听器监听鼠标事件,第一电话窗口管理器即可通过键鼠事件监听器监听按键事件,按键事件包括键盘事件。
步骤811:用户移动鼠标。
例如,用户可以通过移动鼠标操控鼠标光标穿越,即操控鼠标光标向平板的屏幕外移动。
步骤812:输入读取器读取到鼠标事件1。
在用户移动鼠标后,输入读取器可以读取到鼠标事件1。鼠标事件1即为用户移动鼠标触发的鼠标事件。
步骤813:输入读取器调用输入分发器,向输入分发器发送鼠标事件1。
比如,输入读取器可以调用输入分发器的鼠标通知方法,通过鼠标通知方法对鼠标事件1进行处理。
步骤814:输入分发器向第一输入管理服务发送鼠标事件1。
比如,输入分发器可以通过鼠标通知方法,基于第一输入管理器配置的键鼠事件监听器向第一输入管理服务发送鼠标事件1。
另外,输入分发器还可以对鼠标事件1进行事件分发,以使平板对鼠标事件1进行响应。
步骤815:第一输入管理服务向键鼠共享服务发送鼠标事件1。
第一输入管理服务接收到鼠标事件1后,可以将鼠标事件1发送给键鼠共享服务。
键鼠共享服务接收到鼠标事件1后,可以根据鼠标事件1判断鼠标光标是否穿越。若是,则执行步骤817及后续步骤。若否,则不做处理,即不执行步骤817及后续步骤,并继续接收第一输入管理服务上报的鼠标事件,根据上报的鼠标事件判断鼠标光标是否穿越。
步骤816:键鼠共享服务根据鼠标事件1确定鼠标光标穿越。
键鼠共享服务确定鼠标光标穿越后,可以对输入读取器、第一输入管理服务和第一电话窗口管理器存储的键鼠共享状态进行更新,比如可以通过如下步骤817-步骤822实现状态更新。
通过对第一输入管理服务存储的键鼠共享状态进行更新,可以配置第一输入管理服务拦截鼠标事件的功能,通过对第一电话窗口管理器存储的键鼠共享状态进行更新,可以配置第一电话窗口管理器拦截键盘事件的功能。
键鼠共享服务根据鼠标事件1确定鼠标光标穿越后,对于鼠标事件1,键鼠共享服务还可以将鼠标事件1发送给PC,由PC对鼠标事件1进行响应。响应于鼠标事件1,PC可以将在屏幕的固定位置显示鼠标指针,比如在屏幕中心显示鼠标指针。或者,响应于鼠标事件1,PC还可以根据鼠标事件1的偏移量在屏幕上显示鼠标指针,本申请实施例对此不做限定。
比如,键鼠共享服务可以将鼠标事件1发送给PC的事件接收模块,再由事件接收模块将鼠标事件1发送给事件响应模块,由事件响应模块对鼠标事件1进行响应。
步骤817:键鼠共享服务向输入读取器发送键鼠共享状态2,键鼠共享状态2用于指示鼠标光标穿越。
步骤818:输入读取器根据键鼠共享状态2,关闭鼠标光标的绘制功能。
输入读取器接收到键鼠共享状态2后,还可以根据键鼠共享状态2对存储的键鼠共享状态进行更新,比如将存储的键鼠共享状态从键鼠共享状态1更新为键鼠共享状态2。
本申请实施例中,输入读取器可以根据键鼠共享状态控制鼠标光标的绘制功能的开启和关闭。比如,输入读取器在键鼠共享状态为键鼠共享状态1的情况下,可以保
持鼠标光标的绘制功能处于开启状态,在键鼠共享状态为键鼠共享状态2的情况下,可以保持鼠标光标的绘制功能处于关闭状态。输入读取器若检测到键鼠共享状态切换至键鼠共享状态2,可以关闭鼠标光标的绘制功能,若检测到键鼠共享状态从键鼠共享状态2切换至其他状态,可以开启鼠标光标的绘制功能。
步骤819:键鼠共享服务向第一输入管理服务发送键鼠共享状态2。
键鼠共享服务可以调用第一输入管理器,通过第一输入管理器向第一输入管理服务发送键鼠共享状态2。
步骤820:第一输入管理服务接收到键鼠共享状态后,将存储的键鼠共享状态更新为键鼠共享状态2。
比如,第一输入管理服务将存储的键鼠共享状态1更新为键鼠共享状态2。
本申请实施例中,第一输入管理服务可以根据键鼠共享状态,控制第一输入管理服务开启或关闭拦截鼠标事件的功能。其中,拦截鼠标事件的功能是指第一输入管理服务将监听的鼠标事件发送给键鼠共享服务,或者,将监听的鼠标事件发送给键鼠共享服务,以及控制平板不对监听的鼠标事件进行响应。
步骤821:键鼠共享服务向第一电话窗口管理器发送键鼠共享状态2。
键鼠共享服务可以调用第一输入管理器,通过第一输入管理器向第一电话窗口管理器发送键鼠共享状态2。
步骤822:第一电话窗口管理器将存储的键鼠共享状态更新为键鼠共享状态2。
本申请实施例中,第一电话窗口管理器可以根据键鼠共享状态,控制第一电话窗口管理器开启或关闭拦截键盘事件的功能。其中,拦截键盘事件的功能是指第一电话窗口管理器将监听的键盘事件发送给键鼠共享服务,或者,将监听的键盘事件发送给键鼠共享服务,以及控制平板不对监听的键盘事件进行响应。
第一输入管理服务将键鼠共享状态更新为键鼠共享状态2后,即可根据键鼠共享状态2开启拦截鼠标事件的功能,并在后续拦截鼠标事件。第一电话窗口管理器将键鼠共享状态更新为键鼠共享状态2后,即可根据键鼠共享状态2开启拦截键盘事件的功能,并在后续拦截键盘事件。
如图9所示,第一输入管理服务拦截鼠标事件,第一电话窗口管理器拦截键盘事件的流程可以包括如下步骤:
步骤823:用户移动鼠标。
步骤824:输入读取器读取到鼠标事件2。
输入读取器读取到鼠标事件2后,可以通过第一输入管理服务配置的键鼠事件监听器将鼠标事件2发送给第一输入管理服务。比如,输入读取器可以调用输入分发器,通过输入分发器,基于第一输入管理服务配置的键鼠事件监听器向第一输入管理服务发送鼠标事件2。
比如,输入读取器可以调用输入分发器的鼠标通知方法,通过鼠标通知方法,基于第一输入管理服务配置的键鼠事件监听器向第一输入管理服务发送鼠标事件2。
步骤825:输入读取器向输入分发器发送鼠标事件2。
步骤826:输入分发器通过第一输入管理服务配置的键鼠事件监听器向第一输入管理服务发送鼠标事件2。
比如,输入分发器可以通过鼠标通知方法,基于第一输入管理服务配置的键鼠事件监听器向第一输入管理服务发送鼠标事件2。
第一输入管理服务接收到鼠标事件2后,若检测到鼠标共享状态为键鼠共享状态2,则一方面可以将鼠标事件2发送给键鼠共享服务,另一方面可以向输入分发器发送停止进行事件分发的指令,以使输入分发器停止对鼠标事件2进行事件分发。
步骤827:第一输入管理服务根据键鼠共享状态2向键鼠共享服务发送鼠标事件2。
步骤828:键鼠共享服务向PC的事件接收模块发送鼠标事件2。
步骤829:PC的事件接收模块向PC的事件响应模块发送鼠标事件2。
步骤830:PC的事件响应模块对鼠标事件2进行响应。
步骤831:第一输入管理服务根据键鼠共享状态1向输入分发器发送停止分发指令1。
其中,停止分发指令1用于指示输入分发器停止对鼠标事件进行事件分发。
步骤832:输入分发器根据停止分发指令1,停止对鼠标事件2进行事件分发,以使平板不对鼠标事件2进行响应。
通常情况下,比如在键鼠共享状态处于键鼠共享状态2之外的状态时,输入分发器接收到鼠标事件后,可以将鼠标事件分发至平板中该鼠标事件对应的响应模块,由该响应模块对该鼠标事件进行响应,从而实现平板对该鼠标事件的响应。本申请实施例中,为了控制平板不对鼠标事件2进行响应,可以向输入分发器发送停止分发指令,以使输入分发器不对鼠标事件2进行事件分发。
在步骤832之后,平板可以循环执行上述步骤824-步骤832,以对下一个鼠标事件进行拦截和转发。
步骤833:用户按压键盘按键。
步骤834:输入读取器读取到键盘事件1。
输入读取器读取到键盘事件1后,可以通过第一电话窗口管理器配置的键鼠事件监听器将鼠标事件1发送给第一电话窗口管理器。比如,输入读取器可以调用输入分发器,通过输入分发器,基于第一电话窗口管理器配置的键鼠事件监听器向第一电话窗口管理器发送键盘事件1。
比如,输入读取器可以调用输入分发器的键盘通知方法,通过键盘通知方法,基于第一电话窗口管理器配置的键鼠事件监听器向第一电话窗口管理器发送键盘事件1。
步骤835:输入读取器向输入分发器发送键盘事件1。
比如,输入分发器可以通过鼠标通知方法,基于第一输入管理服务配置的键鼠事件监听器向第一输入管理服务发送键盘事件1。
步骤836:输入分发器通过第一电话窗口管理器配置的键鼠事件监听器向第一电话窗口管理器发送键盘事件1。
在输入分发器向第一电话窗口管理器发送键盘事件1后,第一电话窗口管理器可以通过配置的键盘事件监听器接收键盘事件1。
第一电话窗口管理器接收到键盘事件1后,若检测到鼠标共享状态为键鼠共享状态2,则一方面可以将键盘事件1发送给键鼠共享服务,另一方面可以向输入分发器发送停止进行事件分发的指令,以使输入分发器停止对键盘事件1进行事件分发。
步骤837:第一电话窗口管理器根据键鼠共享状态2向键鼠共享服务发送键盘事件1。
步骤838:键鼠共享服务向PC的事件接收模块发送键盘事件1。
步骤839:PC的事件接收模块向PC的事件响应模块发送键盘事件1。
步骤840:PC的事件响应模块对键盘事件1进行响应。
步骤841:第一电话窗口管理器根据键鼠共享状态2向输入分发器发送停止分发指令2。
其中,停止分发指令2用于指示输入分发器停止对键盘事件进行事件分发。
步骤842:输入分发器根据停止分发指令2,停止对键盘事件1进行事件分发,以使平板不对键盘事件1进行响应。
通常情况下,比如在键鼠共享状态处于键鼠共享状态2之外的状态时,输入分发器接收到键盘事件后,可以将键盘事件分发至平板中该键盘事件对应的响应模块,由该响应模块对该键盘事件进行响应,从而实现平板对该键盘事件的响应。本申请实施例中,为了控制平板不对键盘事件1进行响应,可以向输入分发器发送停止分发指令,以使输入分发器不对键盘事件1进行事件分发。
在步骤842之后,平板可以循环执行上述步骤834-步骤843,以对下一个键盘事件进行拦截和转发。
需要说明的是,第一电话窗口管理器配置了键鼠事件监听器之后,不只可以监听键盘事件,还可以监听其他按键事件。其中,按键事件除了键盘事件外,还可以包括其他按键事件,如系统按键事件。其中,系统按键事件是指平板的原生按键的按键事件,如平板自带的电源键、音量键等的按键事件。第一电话窗口管理器监听到按键事件后,还可以先判断按键事件是否为键盘事件,若是,则执行上述拦截和转发机制,若否,则不执行上述拦截和转发机制。
比如,在输入读取器读取到按键事件后,可以将按键事件发送给第一电话窗口管理器,比如通过输入分发器将按键事件发送给第一电话窗口管理器。第一电话窗口管理器通过配置的键鼠事件监听器后,可以先判断按键事件是否为键盘事件。若是,包括以下两种情况:第一种情况,在键鼠共享状态为键鼠共享状态2的情况下,将键盘事件发送给键鼠共享服务,以及控制平板不对该键盘事件进行响应;第二种情况,在键鼠共享状态为键鼠共享状态2之外的其他状态的情况下,不将键盘事件发送给键鼠共享服务,或者,将键盘事件发送给键鼠共享服务,以及不控制平板不对该键盘事件进行响应。另外,若否,不将键盘事件发送给键鼠共享服务,或者,将键盘事件发送给键鼠共享服务,以及不控制平板不对该键盘事件进行响应。
另外,在步骤842之后,当用户移动鼠标操控鼠标光标反向穿越,则平板不再将输入事件转发给PC,而是由平板自身进行响应。例如,键鼠共享服务不再将从第一输入管理服务发送的鼠标事件或第一电话窗口管理器发送的键盘事件发送给PC。另外,键鼠共享服务还可以根据当前的键鼠共享状态,对输入读取器、第一输入管理服务和第一电话窗口管理器进行状态更新。其中,鼠标光标反向穿越是指鼠标光标向PC的屏幕外移动,比如向PC的屏幕左侧边界外移动,或者向PC的屏幕右侧边界外移动。
比如,在步骤842之后,第一输入管理服务将监听的鼠标事件3发送给键鼠共享
服务,键鼠共享服务若根据鼠标事件3确定鼠标光标反向穿越,则关闭输入事件转发功能,即不再将鼠标事件3后的鼠标事件或键盘事件转发给PC。对于鼠标事件3,键鼠共享服务可以将其转发给PC,也可以不转发给PC,本申请实施例对此不做限定。另外,键鼠共享服务还可以控制输入读取器开启鼠标光标的绘制功能,还可以控制输入分发器开始对接收的输入事件进行事件分发。比如,键鼠共享服务可以根据当前的键鼠共享状态,对输入读取器、第一输入管理服务和第一电话窗口管理器进行状态更新,通过状态更新,来控制输入读取器开启鼠标光标的绘制功能,以及控制输入分发器开始对接收的输入事件进行事件分发。
需要说明的是,本申请实施例中的步骤编号顺序并不对步骤执行顺序进行限定,其中有些步骤可以先后执行,也可以并行实现,本申请实施例对此不做限定。
图10示出了一种电子设备的结构示意图,该电子设备为第二电子设备,比如可以是图1中所示的电脑102或手机103。第二电子设备的操作系统可以为安卓系统或Windows系统。参见图9,该电子设备包括至少一个处理器201、通信总线202、存储器203以及至少一个通信接口204。
处理器201可以是微处理器(包括中央处理器(central processing unit,CPU)等)、特定应用集成电路(application-specific integrated circuit,ASIC),或者可以是一个或多个用于控制本申请方案程序执行的集成电路。
通信总线202可包括一通路,用于在上述组件之间传送信息。
存储器203可以是只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、电可擦可编程只读存储器(electrically erasable programmable read-Only memory,EEPROM)、光盘(包括只读光盘(compact disc read-only memory,CD-ROM)、压缩光盘、激光盘、数字通用光盘、蓝光光盘等)、磁盘存储介质或者其它磁存储设备,或者是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其它介质,但不限于此。存储器203可以是独立存在,并通过通信总线202与处理器201相连接。存储器203也可以和处理器201集成在一起。
通信接口204使用任何收发器一类的装置,用于与其它设备或通信网络通信,如以太网、无线接入网(radio access network,RAN)、无线局域网(wireless local area network,WLAN)等。
在具体实现中,作为一种实施例,处理器201可以包括一个或多个CPU,如图9中所示的CPU0和CPU1。
在具体实现中,作为一种实施例,电子设备可以包括多个处理器,如图9中所示的处理器201和处理器205。这些处理器中的每一个可以是一个单核处理器,也可以是一个多核处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(如计算机程序指令)的处理核。
在具体实现中,作为一种实施例,电子设备还可以包括输出设备206和输入设备207。输出设备206和处理器201通信,可以以多种方式来显示信息。例如,输出设备206可以是液晶显示器(liquid crystal display,LCD)、发光二级管(light emitting diode,
LED)显示设备、阴极射线管(cathode ray tube,CRT)显示设备或投影仪(projector)等。输入设备207和处理器201通信,可以以多种方式接收用户的输入。例如,输入设备207可以是鼠标、键盘、触摸屏设备或传感设备等。
上述的电子设备可以是一个通用电子设备或一个专用电子设备。在具体实现中,电子设备可以是台式机、便携式电脑、网络服务器、掌上电脑、移动手机、平板电脑、无线终端设备、通信设备或嵌入式设备,本申请实施例不限定电子设备的类型。
其中,存储器203用于存储执行本申请方案的程序代码210,处理器201用于执行存储器203中存储的程序代码210。该电子设备可以通过处理器201以及存储器203中的程序代码210,来实现上文实施例提供的共享输入设备的方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络或其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,比如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(比如:同轴电缆、光纤、数据用户线(Digital Subscriber Line,DSL))或无线(比如:红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质,或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(比如:软盘、硬盘、磁带)、光介质(比如:数字通用光盘(Digital Versatile Disc,DVD))或半导体介质(比如:固态硬盘(Solid State Disk,SSD))等。
以上所述为本申请提供的可选实施例,并不用以限制本申请,凡在本申请的揭露的技术范围之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。
Claims (42)
- 一种共享输入设备的方法,其特征在于,应用于第一电子设备,所述第一电子设备连接有用于输入控制指令的输入设备,所述第一电子设备的操作系统包括键鼠共享服务和输入管理模块,所述键鼠共享服务用于实现所述第一电子设备与其他电子设备之间共享输入设备的业务,所述输入管理模块用于管理所述第一电子设备的输入事件;所述方法包括:响应于第一操作,所述键鼠共享服务启动;所述键鼠共享服务触发所述输入管理模块监听所述输入设备的输入事件;响应于第二操作,所述键鼠共享服务控制所述第一电子设备的屏幕停止显示鼠标光标,向所述输入管理模块发送拦截指令,所述第二操作用于触发第二电子设备共享所述第一电子设备的输入设备;所述输入管理模块根据所述拦截指令,将监听到的第一输入事件发送给所述键鼠共享服务;所述键鼠共享服务接收所述第一输入事件,将所述第一输入事件发送给所述第二电子设备,以使所述第二电子设备对所述第一输入事件进行响应。
- 如权利要求1所述的方法,其特征在于,所述键鼠共享服务触发所述输入管理模块监听所述输入设备的输入事件,包括:所述键鼠共享服务为所述输入管理模块配置输入事件监听器;所述输入管理模块通过配置的所述输入事件监听器监听所述输入设备的输入事件。
- 如权利要求2所述的方法,其特征在于,所述输入设备包括鼠标设备,所述输入管理模块包括第一输入管理服务;所述键鼠共享服务为所述输入管理模块配置输入事件监听器,包括:所述键鼠共享服务为所述第一输入管理服务配置键鼠事件监听器;所述输入管理模块通过配置的所述输入事件监听器监听所述输入设备的输入事件,包括:所述输入管理服务通过配置的所述键鼠事件监听器监听鼠标事件,所述鼠标事件是指所述鼠标设备的输入事件。
- 如权利要求2或3所述的方法,其特征在于,所述输入设备包括键盘设备,所述输入管理模块包括第一电话窗口管理器;所述键鼠共享服务为所述输入管理模块配置输入事件监听器,包括:所述键鼠共享服务为所述第一电话窗口管理器配置键鼠事件监听器;所述输入管理模块通过配置的所述输入事件监听器监听所述输入设备的输入事件,包括:所述第一电话窗口管理器通过配置的所述键鼠事件监听器监听按键事件,所述按键事件包括键盘事件,所述键盘事件是指所述键盘设备的按键事件。
- 如权利要求1-4任一所述的方法,其特征在于,所述键鼠共享服务向所述输入管理模块发送拦截指令之后,还包括:所述输入管理模块根据所述拦截指令,控制所述第一电子设备不对所述第一输入 事件进行响应。
- 如权利要求5所述的方法,其特征在于,所述操作系统还包括输入分发器,所述输入分发器用于分发输入事件;所述输入管理模块控制所述第一电子设备不对所述第一输入事件进行响应,包括:所述输入管理模块向所述输入分发器发送停止分发指令;所述输入分发器根据所述停止分发指令,不对所述第一输入事件进行事件分发,以使所述第一电子设备不对所述第一输入事件进行响应。
- 如权利要求6所述的方法,其特征在于,所述输入设备包括鼠标设备,所述第一输入事件为第一鼠标事件,所述输入管理模块包括第一输入管理服务;所述第一输入管理服务向所述输入分发器发送第一停止分发指令;所述输入分发器根据所述第一停止分发指令,不对所述第一鼠标事件进行事件分发,以使所述第一电子设备不对所述第一鼠标事件进行响应。
- 如权利要求6所述的方法,其特征在于,所述输入设备包括键盘设备,所述第一输入事件为第一键盘事件,所述输入管理模块包括第一电话窗口管理器;所述第一电话窗口管理器向所述输入分发器发送第二停止分发指令;所述输入分发器根据所述第二停止分发指令,不对所述第一键盘事件进行事件分发,以使所述第一电子设备不对所述第一键盘事件进行响应。
- 如权利要求1-8任一所述的方法,其特征在于,所述输入设备包括键盘设备,所述输入管理模块包括第一电话窗口管理器,所述输入管理模块将监听到的第一输入事件发送给所述键鼠共享服务之前,还包括:所述第一电话窗口管理器监听到第一按键事件;所述第一电话窗口管理器判断所述第一按键事件是否为键盘事件,所述键盘事件是指所述键盘设备的按键事件;所述输入管理模块将监听到的第一输入事件发送给所述键鼠共享服务,包括:所述输入管理模块若确定所述第一按键事件是所述键盘事件,则将所述第一按键事件发送给所述键鼠共享服务。
- 如权利要求9所述的方法,其特征在于,所述方法还包括:所述输入管理模块若确定所述第一按键事件不是所述键盘事件,则不将所述第一按键事件发送给所述键鼠共享服务。
- 如权利要求1-10任一所述的方法,其特征在于,所述输入设备包括鼠标设备,所述第一输入事件为所述鼠标设备的第一鼠标事件,所述输入管理模块包括第一输入管理服务;所述输入管理模块根据所述拦截指令,将监听到的第一输入事件发送给所述键鼠共享服务,包括:所述第一输入管理服务根据所述拦截指令,将监听到的第一鼠标事件发送给所述键鼠共享服务;所述键鼠共享服务接收所述第一输入事件,将所述第一输入事件发送给所述第二电子设备,以使所述第二电子设备对所述第一输入事件进行响应,包括:所述键鼠共享服务接收所述第一鼠标事件,将所述第一鼠标事件发送给所述第二 电子设备,以使所述第二电子设备对所述第一鼠标事件进行响应。
- 如权利要求1-10任一所述的方法,其特征在于,所述输入设备包括键盘设备,所述第一输入事件为所述键盘设备的第一键盘事件,所述输入管理模块包括第一电话窗口管理器;所述输入管理模块根据所述拦截指令,将监听到的第一输入事件发送给所述键鼠共享服务,包括:所述第一电话窗口管理器根据所述拦截指令,将监听到的第一键盘事件发送给所述键鼠共享服务;所述键鼠共享服务接收所述第一输入事件,将所述第一输入事件发送给所述第二电子设备,以使所述第二电子设备对所述第一输入事件进行响应,包括:所述键鼠共享服务接收所述第一键盘事件,将所述第一键盘事件发送给所述第二电子设备,以使所述第二电子设备对所述第一键盘事件进行响应。
- 如权利要求1-12任一所述的方法,其特征在于,所述方法还包括:所述键鼠共享服务若检测到所述第一电子设备与所述第二电子设备建立连接,则执行触发所述输入管理模块监听所述输入设备的输入事件的步骤。
- 如权利要求13所述的方法,其特征在于,所述操作系统还包括输入读取器,所述输入读取器用于读取输入事件,以及开启或关闭鼠标光标的绘制功能;所述键鼠共享服务检测到所述第一电子设备与所述第二电子设备建立连接之后,还包括:所述键鼠共享服务向所述输入读取器发送第一键鼠共享状态信息,所述第一键鼠共享状态信息用于指示所述第一电子设备与所述第二电子设备建立连接。
- 如权利要求1-14任一所述的方法,其他在于,所述拦截指令为第二键鼠共享状态信息,所述第二键鼠共享状态信息用于指示所述第二电子设备共享所述第一电子设备的输入设备。
- 如权利要求1-15任一所述的方法,其特征在于,所述操作系统还包括输入读取器,所述输入读取器用于读取输入事件,以及开启或关闭鼠标光标的绘制功能;所述键鼠共享服务控制所述第一电子设备的屏幕停止显示鼠标光标,包括:所述键鼠共享服务向所述输入读取器发送第一控制指令;所述输入读取器根据所述第一控制指令,关闭鼠标光标的绘制功能,以使所述第一电子设备的屏幕停止显示鼠标光标。
- 如权利要求16所述的方法,其特征在于,所述第一控制指令为第二键鼠共享状态信息,所述第二键鼠共享状态信息用于指示所述第二电子设备共享所述第一电子设备的输入设备。
- 如权利要求1-17任一所述的方法,其特征在于,所述操作系统还包括输入读取器和输入分发器,所述输入读取器用于读取输入事件,所述输入分发器用于分发输入事件;所述输入管理模块将监听到的第一输入事件发送给所述键鼠共享服务之前,还包括:所述输入读取器读取所述第一输入事件;所述输入读取器调用所述输入分发器的输入事件通知方法,通过所述输入事件通知方法将所述第一输入事件发送给所述输入管理模块。
- 如权利要求1-18任一所述的方法,其特征在于,所述键鼠共享服务触发所述输入管理模块监听所述输入设备的输入事件,包括:所述键鼠共享服务触发所述输入管理模块监听所述输入设备的输入事件,将监听的输入事件发送给所述键鼠共享服务;所述键鼠共享服务控制所述第一电子设备的屏幕停止显示鼠标光标,向所述输入管理模块发送拦截指令之前,还包括:所述输入管理模块监听到第二输入事件;所述输入管理模块将所述第二输入事件发送给所述键鼠共享服务;所述键鼠共享服务接收所述第二输入事件;所述键鼠共享服务若根据所述第二输入事件确定鼠标光标穿越,则所述键鼠共享服务确定接收到所述第二操作,所述鼠标光标穿越是指所述第一电子设备的鼠标光标向所述第一电子设备的屏幕外移动。
- 一种电子设备,其特征在于,所述电子设备包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如权利要求1至19任一项所述的方法。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行如权利要求1-19任意一项所述的方法。
- 一种共享输入设备的方法,其特征在于,应用于第一电子设备,所述第一电子设备为手机或平板电脑,所述第一电子设备连接有用于输入控制指令的输入设备,所述输入设备至少包括鼠标,所述方法包括:响应于第一操作,启动键鼠共享功能;接收所述输入设备的第一输入事件;响应于接收到的所述第一输入事件不是所述鼠标对应的鼠标光标从屏幕侧边移出屏幕的鼠标穿越事件,在所述第一电子设备的屏幕上显示所述鼠标对应的鼠标光标,并将所述第一输入事件分发至所述第一输入事件对应的响应对象;响应于接收到的所述第一输入事件是所述鼠标光标穿越事件,所述第一电子设备的屏幕停止显示所述鼠标对应的鼠标光标,并拦截所述第一输入事件;将拦截的所述第一输入事件发送给与所述第一电子设备进行键鼠共享的第二电子设备,以使所述第二电子设备对所述第一输入事件进行响应。
- 如权利要求22所述的方法,其特征在于,所述响应于第一操作,启动键鼠共享功能之前,还包括:显示第一界面,所述第一界面包括键鼠共享服务的开关控件;所述响应于第一操作,启动键鼠共享功能,包括:响应于对所述键鼠共享服务的开关控件的点击操作,启动键鼠共享功能。
- 如权利要求22或23所述的方法,其特征在于,所述启动键鼠共享功能之后,还包括:显示第二界面,所述第二界面包括可用设备的设备标识,所述可用设备至少包括 所述第二设备;响应于对所述第二设备的设备标识的点击操作,与所述第二电子设备建立连接,以使所述第二电子设备能够与所述第一电子设备进行键鼠共享。
- 如权利要求22-24任一所述的方法,其特征在于,所述第一电子设备的操作系统包括键鼠共享服务和输入管理模块,所述响应于第一操作,启动键鼠共享功能,包括:响应于所述第一操作,启动所述键鼠共享服务;所述键鼠共享服务触发所述输入管理模块对所述输入设备的输入事件进行监听;所述响应于接收到的所述第一输入事件是所述鼠标光标穿越事件,所述第一电子设备的屏幕停止显示所述鼠标对应的鼠标光标,并拦截所述第一输入事件,将拦截的所述第一输入事件发送给与所述第一电子设备进行键鼠共享的第二电子设备,包括:响应于接收到的所述第一输入事件是所述鼠标光标穿越事件,所述键鼠共享服务控制所述第一电子设备的屏幕停止显示鼠标光标,并向所述输入管理模块发送拦截指令;所述输入管理模块根据所述拦截指令,将监听到的所述第一输入事件发送给所述键鼠共享服务;所述键鼠共享服务接收所述第一输入事件,将所述第一输入事件发送给所述第二电子设备。
- 如权利要求25所述的方法,其特征在于,所述键鼠共享服务触发所述输入管理模块对所述输入设备的输入事件进行监听,包括:所述键鼠共享服务为所述输入管理模块配置输入事件监听器;所述输入管理模块通过配置的所述输入事件监听器对所述输入设备的输入事件进行监听。
- 如权利要求26所述的方法,其特征在于,所述输入管理模块包括第一输入管理服务;所述键鼠共享服务为所述输入管理模块配置输入事件监听器,包括:所述键鼠共享服务为所述第一输入管理服务配置键鼠事件监听器;所述输入管理模块通过配置的所述输入事件监听器对所述输入设备的输入事件进行监听,包括:所述输入管理服务通过配置的所述键鼠事件监听器对所述鼠标的鼠标事件进行监听。
- 如权利要求26所述的方法,其特征在于,所述输入设备还包括键盘设备,所述输入管理模块包括第一电话窗口管理器;所述键鼠共享服务为所述输入管理模块配置输入事件监听器,包括:所述键鼠共享服务为所述第一电话窗口管理器配置键鼠事件监听器;所述输入管理模块通过配置的所述输入事件监听器对所述输入设备的输入事件进行监听,包括:所述第一电话窗口管理器通过配置的所述键鼠事件监听器对按键事件进行监听,所述按键事件包括所述键盘设备的键盘事件。
- 如权利要求25-28任一所述的方法,其特征在于,所述键鼠共享服务向所述输入管理模块发送拦截指令之后,还包括:所述输入管理模块根据所述拦截指令,控制所述第一电子设备不对所述第一输入事件进行响应。
- 如权利要求29所述的方法,其特征在于,所述操作系统还包括输入分发器;所述输入管理模块控制所述第一电子设备不对所述第一输入事件进行响应,包括:所述输入管理模块向所述输入分发器发送停止分发指令;所述输入分发器根据所述停止分发指令,不对所述第一输入事件进行事件分发,以使所述第一电子设备不对所述第一输入事件进行响应。
- 如权利要求30所述的方法,其特征在于,所述第一输入事件为第一鼠标事件,所述输入管理模块包括第一输入管理服务;所述第一输入管理服务向所述输入分发器发送第一停止分发指令;所述输入分发器根据所述第一停止分发指令,不对所述第一鼠标事件进行事件分发,以使所述第一电子设备不对所述第一鼠标事件进行响应。
- 如权利要求30所述的方法,其特征在于,所述第一输入事件为第一键盘事件,所述输入管理模块包括第一电话窗口管理器;所述第一电话窗口管理器向所述输入分发器发送第二停止分发指令;所述输入分发器根据所述第二停止分发指令,不对所述第一键盘事件进行事件分发,以使所述第一电子设备不对所述第一键盘事件进行响应。
- 如权利要求25-32任一所述的方法,其特征在于,所述第一输入事件为第一按键事件,所述输入管理模块包括第一电话窗口管理器,所述输入管理模块将监听到的所述第一输入事件发送给所述键鼠共享服务之前,还包括:所述第一电话窗口管理器监听到所述第一按键事件;所述第一电话窗口管理器判断所述第一按键事件是否为键盘事件;所述输入管理模块将监听到的所述第一输入事件发送给所述键鼠共享服务,包括:所述输入管理模块若确定所述第一按键事件是所述键盘事件,则将所述第一按键事件发送给所述键鼠共享服务。
- 如权利要求33所述的方法,其特征在于,所述方法还包括:所述输入管理模块若确定所述第一按键事件不是所述键盘事件,则不将所述第一按键事件发送给所述键鼠共享服务。
- 如权利要求25-34任一所述的方法,其特征在于,所述第一输入事件为第一鼠标事件,所述输入管理模块包括第一输入管理服务;所述输入管理模块根据所述拦截指令,将监听到的所述第一输入事件发送给所述键鼠共享服务,包括:所述第一输入管理服务根据所述拦截指令,将监听到的所述第一鼠标事件发送给所述键鼠共享服务;所述键鼠共享服务接收所述第一输入事件,将所述第一输入事件发送给所述第二电子设备,以使所述第二电子设备对所述第一输入事件进行响应,包括:所述键鼠共享服务接收所述第一鼠标事件,将所述第一鼠标事件发送给所述第二 电子设备,以使所述第二电子设备对所述第一鼠标事件进行响应。
- 如权利要求25-34任一所述的方法,其特征在于,所述第一输入事件为第一键盘事件,所述输入管理模块包括第一电话窗口管理器;所述输入管理模块根据所述拦截指令,将监听到的所述第一输入事件发送给所述键鼠共享服务,包括:所述第一电话窗口管理器根据所述拦截指令,将监听到的所述第一键盘事件发送给所述键鼠共享服务;所述键鼠共享服务接收所述第一输入事件,将所述第一输入事件发送给所述第二电子设备,以使所述第二电子设备对所述第一输入事件进行响应,包括:所述键鼠共享服务接收所述第一键盘事件,将所述第一键盘事件发送给所述第二电子设备,以使所述第二电子设备对所述第一键盘事件进行响应。
- 如权利要求25-36任一所述的方法,其特征在于,所述方法还包括:所述键鼠共享服务若检测到所述第一电子设备与所述第二电子设备建立连接,则执行触发所述输入管理模块对所述输入设备的输入事件进行监听的步骤。
- 如权利要求37所述的方法,其特征在于,所述操作系统还包括输入读取器;所述键鼠共享服务检测到所述第一电子设备与所述第二电子设备建立连接之后,还包括:所述键鼠共享服务向所述输入读取器发送第一键鼠共享状态信息,所述第一键鼠共享状态信息用于指示所述第一电子设备与所述第二电子设备建立连接。
- 如权利要求25-38任一所述的方法,其他在于,所述拦截指令为第二键鼠共享状态信息,所述第二键鼠共享状态信息用于指示所述第二电子设备共享所述第一电子设备的输入设备。
- 如权利要求25-39任一所述的方法,其特征在于,所述操作系统还包括输入读取器;所述键鼠共享服务控制所述第一电子设备的屏幕停止显示鼠标光标,包括:所述键鼠共享服务向所述输入读取器发送第一控制指令;所述输入读取器根据所述第一控制指令,关闭鼠标光标的绘制功能,以使所述第一电子设备的屏幕停止显示鼠标光标。
- 如权利要求40所述的方法,其特征在于,所述第一控制指令为第二键鼠共享状态信息,所述第二键鼠共享状态信息用于指示所述第二电子设备共享所述第一电子设备的输入设备。
- 如权利要求25-41任一所述的方法,其特征在于,所述操作系统还包括输入读取器和输入分发器;所述输入管理模块将监听到的所述第一输入事件发送给所述键鼠共享服务之前,还包括:所述输入读取器读取所述第一输入事件;所述输入读取器调用所述输入分发器的输入事件通知方法,通过所述输入事件通知方法将所述第一输入事件发送给所述输入管理模块。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310801731.5A CN119225542B (zh) | 2023-06-30 | 2023-06-30 | 共享输入设备的方法、电子设备及存储介质 |
| CN202310801731.5 | 2023-06-30 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025001352A1 true WO2025001352A1 (zh) | 2025-01-02 |
Family
ID=93936971
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/083382 Ceased WO2025001352A1 (zh) | 2023-06-30 | 2024-03-22 | 共享输入设备的方法、电子设备及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN119225542B (zh) |
| WO (1) | WO2025001352A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119718151A (zh) * | 2025-02-27 | 2025-03-28 | 中南大学 | 一种基于多主机的输入设备共享方法及系统 |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103425408A (zh) * | 2012-05-23 | 2013-12-04 | 深圳富泰宏精密工业有限公司 | 鼠标键盘共享方法及系统 |
| CN107360543A (zh) * | 2017-06-13 | 2017-11-17 | 青岛海信电器股份有限公司 | 一种基于多个设备间共享外设操作的方法及装置 |
| CN113377272A (zh) * | 2021-06-02 | 2021-09-10 | Tcl通讯(宁波)有限公司 | 一种多设备间共享鼠标方法、装置、终端设备及存储介质 |
| CN114089900A (zh) * | 2020-07-29 | 2022-02-25 | 华为技术有限公司 | 一种跨设备的对象拖拽方法及设备 |
| CN114089901A (zh) * | 2020-07-29 | 2022-02-25 | 华为技术有限公司 | 一种跨设备的对象拖拽方法及设备 |
| CN114579016A (zh) * | 2020-11-30 | 2022-06-03 | 华为技术有限公司 | 一种共享输入设备的方法、电子设备及系统 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20070003765A (ko) * | 2003-10-01 | 2007-01-05 | 쟈루나 에스에이 | 운영체제 |
| CN114816294A (zh) * | 2020-09-02 | 2022-07-29 | 华为技术有限公司 | 一种显示方法及设备 |
| CN113687765A (zh) * | 2021-08-10 | 2021-11-23 | 北京小米移动软件有限公司 | 输入功能控制方法、输入功能控制装置及存储介质 |
-
2023
- 2023-06-30 CN CN202310801731.5A patent/CN119225542B/zh active Active
-
2024
- 2024-03-22 WO PCT/CN2024/083382 patent/WO2025001352A1/zh not_active Ceased
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103425408A (zh) * | 2012-05-23 | 2013-12-04 | 深圳富泰宏精密工业有限公司 | 鼠标键盘共享方法及系统 |
| CN107360543A (zh) * | 2017-06-13 | 2017-11-17 | 青岛海信电器股份有限公司 | 一种基于多个设备间共享外设操作的方法及装置 |
| CN114089900A (zh) * | 2020-07-29 | 2022-02-25 | 华为技术有限公司 | 一种跨设备的对象拖拽方法及设备 |
| CN114089901A (zh) * | 2020-07-29 | 2022-02-25 | 华为技术有限公司 | 一种跨设备的对象拖拽方法及设备 |
| CN114579016A (zh) * | 2020-11-30 | 2022-06-03 | 华为技术有限公司 | 一种共享输入设备的方法、电子设备及系统 |
| CN113377272A (zh) * | 2021-06-02 | 2021-09-10 | Tcl通讯(宁波)有限公司 | 一种多设备间共享鼠标方法、装置、终端设备及存储介质 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119718151A (zh) * | 2025-02-27 | 2025-03-28 | 中南大学 | 一种基于多主机的输入设备共享方法及系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN119225542B (zh) | 2025-11-28 |
| CN119225542A (zh) | 2024-12-31 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP4030276B1 (en) | Content continuation method and electronic device | |
| EP4060475B1 (en) | Multi-screen cooperation method and system, and electronic device | |
| WO2020244492A1 (zh) | 一种投屏显示方法及电子设备 | |
| CN113961157B (zh) | 显示交互系统、显示方法及设备 | |
| EP4242810A1 (en) | Application sharing method, and electronic device and storage medium | |
| US20240231742A9 (en) | Projection display method and electronic device | |
| CN120343529A (zh) | 蓝牙通信方法、可穿戴设备及系统 | |
| WO2021218544A1 (zh) | 一种提供无线上网的系统、方法及电子设备 | |
| US20240362042A1 (en) | Application widget setting method and related device | |
| WO2024178962A1 (zh) | 共享文件的方法、电子设备及计算机可读存储介质 | |
| WO2022268009A1 (zh) | 一种屏幕共享的方法及相关设备 | |
| CN119225542B (zh) | 共享输入设备的方法、电子设备及存储介质 | |
| CN114697438B (zh) | 一种利用智能设备进行通话的方法、装置、设备及存储介质 | |
| JP2023534182A (ja) | ファイルを開く方法およびデバイス | |
| WO2025067441A1 (zh) | 一种数据拖拽方法、电子设备及存储介质 | |
| WO2024260185A1 (zh) | 一种数据传输的方法、终端及系统 | |
| WO2024087807A1 (zh) | 协同控制方法、装置、电子设备及可读存储介质 | |
| WO2023165513A1 (zh) | 通信方法、电子设备及装置 | |
| WO2023051204A1 (zh) | 跨设备连接方法、电子设备及存储介质 | |
| WO2022228214A1 (zh) | 设备发现方法、系统及其电子设备 | |
| EP4697858A1 (en) | Method and apparatus for call switching, and electronic device | |
| CN119536868A (zh) | 应用显示状态的切换方法及装置 | |
| WO2023241558A1 (zh) | 通信方法、通信系统和鼠标 | |
| WO2024067037A1 (zh) | 一种服务调用方法、系统和电子设备 | |
| WO2025097920A1 (zh) | 音频处理方法及电子设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24830004 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |