A method, electronic device and system for sharing an input device

By establishing connections between multiple electronic devices and utilizing cursor movement operations and input event mapping, input device sharing is achieved, solving the problem of input devices not being able to be shared between different devices, improving user experience and reducing processor power consumption.

CN114579016BActive Publication Date: 2026-03-24HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-30
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

The inability to share input devices between different electronic devices leads to redundancy and inconvenience for users when switching devices, thus reducing the user experience.

Method used

By establishing a connection between multiple electronic devices, the first electronic device detects cursor movement operations, sends messages to the second electronic device to display the cursor, and maps input events, thus achieving input device sharing.

Benefits of technology

It enables the sharing of input devices among different electronic devices, improves the continuity and convenience of user input operations, reduces the number of device switching times, and lowers processor power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114579016B_ABST
    Figure CN114579016B_ABST
Patent Text Reader

Abstract

The application discloses a method, an electronic device and a system for sharing an input device, which can support sharing and using the input device among multiple electronic devices. After a first electronic device establishes a first connection with a second electronic device, a mouse pointer of the first electronic device can pass through a boundary of a display interface and appear on a display interface of the second electronic device. When the mouse pointer is displayed on a display screen of the second electronic device, whenever a user uses an input device such as a mouse or a keyboard of the first electronic device to perform an input operation, the second electronic device can receive an input event from the first electronic device and respond to the input event, while shielding the input event on the first electronic device side. By implementing the method, the user can use the input device of the first electronic device to perform an input operation on the second electronic device, the input operation of the user can be conveniently and quickly switched among different devices, the input operation is more coherent, and the input experience of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminals, and more particularly to a method, electronic device, and system for sharing an input device. Background Technology

[0002] In daily life, there are many types of smart terminal devices, including mobile phones, personal computers (PCs), portable Android devices (PADs), and televisions. Because each terminal device is independent, and there may be differences in their ecosystems (for example, a PC's operating system might be different),... The other tablet's operating system is Each electronic device has its own dedicated input device, and input devices from different electronic devices cannot be shared. This results in input device redundancy and the need for users to switch between input devices when using different electronic devices, leading to inconvenience and a reduced user experience. Summary of the Invention

[0003] This application provides a method, related electronic devices, and systems for sharing input devices, which can support users to use the same input device for input operations across different electronic devices.

[0004] The aforementioned and other objectives will be achieved through the features described in the independent claims. Further implementations are illustrated in the dependent claims, the specification, and the drawings.

[0005] In a first aspect, embodiments of this application provide a method for sharing an input device. The method includes: establishing a first connection between a first electronic device and a second electronic device. The first electronic device detects a first movement operation, which is an operation instructing a first cursor to move outside a first display interface of the first electronic device. The first movement operation corresponds to a third offset, which represents the first cursor moving outside the first display interface. Then, the first electronic device can send a first message to the second electronic device through the first connection. The first message can be used to notify the second electronic device to display a second cursor. The second electronic device can display the second cursor at a first position in the second display interface according to the first message. After the second cursor is displayed on the second electronic device, the first electronic device detects a second movement operation, which corresponds to the first offset. The first electronic device sends a second message to the second electronic device through the first connection, the second message carrying the first offset. The second electronic device moves the second cursor from the first position to a second position, the offset of the second position relative to the first position being the first offset. For example, in some embodiments, after a PC and a PAD establish a connection, input devices such as a mouse and keyboard from the PC can be used to input on the PAD. When the mouse pointer on the PC moves to the boundary of the PC's display interface and continues to move outward from the boundary, the PC sends a message to the PAD, notifying the PAD to display the mouse pointer. In response to messages from the PC, the PAD can display a mouse pointer on the screen. Then, when the user enters content using the PC's input device, the PAD can receive and respond to input events from the PC. For example, if the user moves the mouse a certain distance, the mouse pointer on the PAD can move by the corresponding offset; if the user types on the PC's keyboard, the PAD can display the entered characters, and so on.

[0006] Implementing the first aspect of the method allows multiple electronic devices to share input devices, enabling input to be performed on a second electronic device using the input device of the first. For example, a user can use a PC's mouse and keyboard to input on a tablet. This method makes the user's input operation more seamless, eliminating the need to switch between input devices and allowing for convenient and quick switching between different devices, thus improving the user's input experience.

[0007] In conjunction with the first aspect, in some embodiments, the method may further include: a first electronic device detecting a third movement operation, the third movement operation being an operation instructing a second cursor to move outside the second display interface of the second electronic device, the third movement operation corresponding to a second offset, the second offset being used to characterize the second cursor moving outside the second display interface of the second electronic device. The first electronic device displays the first cursor at a third position in the first display interface. For example, when the mouse pointer reaches the boundary of the PAD display interface and continues to move outward, the mouse pointer can be displayed again on the PC display interface.

[0008] In conjunction with the first aspect, in some embodiments, the first electronic device includes a first input device, which may include one or more of the following: mouse, keyboard, handwriting tablet, camera, touchpad, scanner, stylus, remote control, voice input device, etc.

[0009] In conjunction with the first aspect, in some embodiments, the first movement operation, the second movement operation, or the third movement operation is detected by the first input device.

[0010] In conjunction with the first aspect, in some embodiments, the first position is located on the second boundary of the second display interface, and the third position is located on the first boundary of the first display interface.

[0011] In conjunction with the first aspect, in some embodiments, the first movement operation, or the second movement operation, or the third movement operation is an input operation such as the user moving a mouse, or the user operating a touch-sensitive panel, or the user operating a keyboard, or the user operating a handwriting tablet, or the user operating a remote control, or the user operating a voice input device, or the user moving their eyes, or a program instruction indicating cursor movement.

[0012] In conjunction with the first aspect, in some embodiments, the first message carries the coordinates of a first location.

[0013] In conjunction with the first aspect, in some embodiments, if the first position is located on the boundary of the second display interface, the first offset is used to indicate that the second cursor moves in a direction within the second display interface.

[0014] In conjunction with the first aspect, in some embodiments, the first display interface has four boundaries, namely the top, bottom, left, and right boundaries of the display interface in a forward layout; the second display interface also has four boundaries, namely the top, bottom, left, and right boundaries of the display interface in a forward layout. Specifically, if the first boundary is the left boundary of the first display interface, then the second boundary is the right boundary of the second display interface; if the first boundary is the right boundary of the first display interface, then the second boundary is the left boundary of the second display interface; if the first boundary is the top boundary of the first display interface, then the second boundary is the bottom boundary of the second display interface; and if the first boundary is the bottom boundary of the first display interface, then the second boundary is the top boundary of the second display interface.

[0015] In conjunction with the first aspect, in some embodiments, the first electronic device carries a first operating system, and the second electronic device carries a second operating system.

[0016] In conjunction with the first aspect, in some embodiments, the method further includes: when the second cursor is displayed on the second display interface, the first electronic device detects a first input event, wherein the first input event originates from an input operation collected by a first input device of the first electronic device. The first electronic device maps the first input event to a second input event, wherein the first electronic device stores a first mapping table storing the mapping relationship between the first input event and the second input event. The first electronic device sends a third message to the second electronic device, the third message carrying the second input event. The second electronic device receives the second input event.

[0017] In conjunction with the first aspect, in some embodiments, when the first input device is a keyboard, the first input event includes a first key code value generated by the user pressing the keyboard, and the second input event includes a second key code value, wherein the character or control command corresponding to the first key code value in the first operating system is consistent with the character or control command corresponding to the second key code value in the second operating system.

[0018] In conjunction with the first aspect, in some embodiments, the display area of ​​the first display interface is the visible area corresponding to the first resolution, and the display area of ​​the second display interface is the visible area corresponding to the second resolution.

[0019] In conjunction with the first aspect, in some embodiments, the method further includes: after the first electronic device detects the first movement operation, the first electronic device determines the coordinates of the first position of the second cursor displayed on the second display interface based on the coordinates of the first cursor on the first display interface, the first resolution of the first display interface, and the second resolution of the second display interface obtained from the second electronic device.

[0020] In conjunction with the first aspect, in some embodiments, the method further includes: a first electronic device creating a virtual screen with a second resolution. While a second electronic device displays a second cursor at a first position on a second display interface, the first electronic device moves the first cursor to a fourth position on the virtual screen, the fourth position having the same coordinate values ​​as the first position. Upon detecting a second movement operation, the first electronic device moves the first cursor from the fourth position to a fifth position, the fifth position having the same coordinate values ​​as the second position. For example, a PC creates a virtual screen with the same resolution as the PAD display. After the mouse pointer moves out of the PC display's boundary, it moves to the virtual screen, and simultaneously, a mouse pointer is displayed on the PAD display interface. The position of the mouse pointer on the virtual screen corresponds one-to-one with the coordinate position of the mouse pointer displayed on the PAD, with the same coordinate values. This allows the mouse pointer coordinates on the virtual screen to be directly sent to the PAD without complex coordinate transformations, saving processor power consumption.

[0021] In conjunction with the first aspect, in some embodiments, when the second cursor is displayed on the second display interface, the first cursor is not displayed on the first display interface of the first electronic device. For example, when the mouse pointer is displayed on the PAD display interface, input events on the PC side can be blocked simultaneously, that is, the PC does not respond to input events from the input device.

[0022] In conjunction with the first aspect, in some embodiments, the method further includes: when the display interface layout of the second electronic device changes from a second display interface to a third display interface, the second electronic device changes the position of the second cursor from a second position to a sixth position, wherein the second display interface and the third display interface contain the same interface elements, but the resolution of the second display interface is different from that of the third display interface. For example, when a PAD changes from landscape mode to portrait mode, if the layout of the PAD display interface changes, the position of the mouse pointer may change accordingly, pointing to the same pixel or the same interface element. Or, when a foldable phone switches between an unfolded state and a folded state, the position of the mouse pointer may also change with the change of the display interface.

[0023] In conjunction with the first aspect, in some embodiments, the second position and the sixth position point to the same interface element.

[0024] Secondly, embodiments of this application provide a method for sharing an input device, applied to a first electronic device. The method includes: establishing a first connection between the first electronic device and a second electronic device; the first electronic device detecting a first movement operation, which is an operation indicating that a first cursor moves outside a first display interface of the first electronic device, the first movement operation corresponding to a third offset, the third offset representing that the first cursor has moved outside the first display interface; the first electronic device sending a first message to the second electronic device through the first connection, the first message notifying the second electronic device to display a second cursor; the first electronic device detecting a second movement operation, the second movement operation corresponding to the first offset; the first electronic device sending a second message to the second electronic device through the first connection, the second message carrying the first offset, the second message notifying the second electronic device to move the second cursor from a first position to a second position, the offset of the second position relative to the first position being the first offset. For example, in some embodiments, after a PC and a PAD establish a connection, input devices such as a mouse and keyboard from the PC can be used to input on the PAD. When the mouse pointer on the PC moves to the boundary of the PC's display interface and continues to move outwards from the boundary, the PC sends a message to the PAD, notifying the PAD to display the mouse pointer. In response to the message from the PC, the PAD can display the mouse pointer on the display interface. Then, when the user inputs content using the PC's input device, the PAD can receive and respond to input events from the PC. For example, if the user moves the mouse a certain distance, the mouse pointer in the PAD can move by the corresponding offset; if the user types on the PC's keyboard, the PAD can display the entered characters, and so on.

[0025] Implementing the second aspect of the method allows multiple electronic devices to share input devices, enabling input to be performed on a second electronic device using the input device of the first. For example, a user can use a PC's mouse and keyboard to input on a tablet. This method makes the user's input operation more seamless, eliminating the need to switch between input devices and allowing for convenient and quick switching between different devices, thus improving the user's input experience.

[0026] In conjunction with the second aspect, in some embodiments, the method further includes the first electronic device detecting a third movement operation, the third movement operation being an operation instructing the second cursor to move out of the second display interface of the second electronic device, the third movement operation corresponding to a second offset, the second offset being used to characterize the second cursor moving out of the second display interface of the second electronic device. The first electronic device displays the first cursor at a third position in the first display interface.

[0027] In conjunction with the second aspect, in some embodiments, the first electronic device includes a first input device, which may include one or more of the following: mouse, keyboard, handwriting tablet, camera, touchpad, scanner, stylus, remote control, voice input device, etc.

[0028] In conjunction with the second aspect, in some embodiments, the first movement operation, the second movement operation, or the third movement operation is detected by the first input device.

[0029] In conjunction with the second aspect, in some embodiments, the first position is located on the second boundary of the second display interface, and the third position is located on the first boundary of the first display interface.

[0030] In conjunction with the second aspect, in some embodiments, the first movement operation, or the second movement operation, or the third movement operation is an input operation such as the user moving a mouse, or the user operating a touch-sensitive panel, or the user operating a keyboard, or the user operating a handwriting tablet, or the user operating a remote control, or the user operating a voice input device, or the user moving their eyes, or a program command indicating cursor movement.

[0031] In conjunction with the second aspect, in some embodiments, the first message carries the coordinates of a first location.

[0032] In conjunction with the second aspect, in some embodiments, if the first position is located on the boundary of the second display interface, the first offset is used to indicate that the second cursor moves in a direction within the second display interface.

[0033] In conjunction with the second aspect, in some embodiments, the first display interface has four boundaries, namely the top, bottom, left, and right boundaries of the display interface in a forward layout. Similarly, the second display interface has four boundaries, also namely the top, bottom, left, and right boundaries of the display interface in a forward layout. If the first boundary is the left boundary of the first display interface, then the second boundary is the right boundary of the second display interface; if the first boundary is the right boundary of the first display interface, then the second boundary is the left boundary of the second display interface; if the first boundary is the top boundary of the first display interface, then the second boundary is the bottom boundary of the second display interface; and if the first boundary is the bottom boundary of the first display interface, then the second boundary is the top boundary of the second display interface.

[0034] In conjunction with the second aspect, in some embodiments, the first electronic device carries a first operating system, and the second electronic device carries a second operating system.

[0035] In conjunction with the second aspect, in some embodiments, the method further includes, when the second cursor is displayed on the second display interface, the first electronic device detects a first input event, wherein the first input event originates from an input operation collected by a first input device of the first electronic device. The first electronic device then maps the first input event to a second input event, wherein the first electronic device stores a first mapping table containing the mapping relationship between the first input event and the second input event. The first electronic device then sends a third message to the second electronic device, the third message carrying the second input event.

[0036] In conjunction with the second aspect, in some embodiments, the display area of ​​the first display interface is the visible area corresponding to the first resolution, and the display area of ​​the second display interface is the visible area corresponding to the second resolution. The method further includes, after the first electronic device detects the first movement operation, the first electronic device determines the coordinates of the first position of the second cursor on the second display interface based on the coordinates of the first cursor on the first display interface, the first resolution of the first display interface, and the second resolution of the second display interface obtained from the second electronic device.

[0037] In conjunction with the second aspect, in some embodiments, when the first input device is a keyboard, the first input event includes a first key code value generated by the user pressing the keyboard, and the second input event includes a second key code value. The character or control command corresponding to the first key code value in the first operating system is consistent with the character or control command corresponding to the second key code value in the second operating system.

[0038] In conjunction with the second aspect, in some embodiments, the method further includes: a first electronic device creating a virtual screen with a second resolution. While the second electronic device displays a second cursor at a first position in the second display interface, the first electronic device moves the first cursor to a fourth position on the virtual screen, the fourth position having the same coordinate values ​​as the first position. Upon detecting a second movement operation, the first electronic device moves the first cursor from the fourth position to a fifth position, the fifth position having the same coordinate values ​​as the second position.

[0039] In conjunction with the second aspect, in some embodiments, when the second cursor is displayed on the second display interface, the first cursor is not displayed on the first display interface of the first electronic device. For example, when the mouse pointer is displayed on the PAD display interface, input events on the PC side can be blocked simultaneously, that is, the PC does not respond to input events from the input device.

[0040] Thirdly, embodiments of this application provide a method for sharing an input device, applied to a second electronic device. This method may include: establishing a first connection between the second electronic device and a first electronic device. The second electronic device receives a first message from the first electronic device through the first connection. The first message is used by the first electronic device to notify the second electronic device to display a second cursor. The first message is generated by the first electronic device after detecting a first movement operation, which indicates that the first cursor moves out of the first display interface of the first electronic device. The first movement operation corresponds to a third offset, which represents the first cursor moving out of the first display interface of the first electronic device. The second electronic device displays the second cursor at a first position in the second display interface according to the first message. The second electronic device receives a second message from the first electronic device through the first connection. The second message carries a first offset. The second message is generated by the first electronic device after detecting a second movement operation, which corresponds to the first offset. The second electronic device moves the second cursor from the first position to a second position, where the offset of the second position relative to the first position is the first offset. For example, in some embodiments, after a PAD establishes a connection with a PC, the PAD can use input devices such as a mouse and keyboard from the PC to input on the PAD. When the mouse pointer on the PC moves to the edge of the PC's display and continues to move beyond that edge, the PC sends a message to the PAD, instructing the PAD to display the mouse pointer. In response to the PC's message, the PAD can display the mouse pointer on the display. Then, when the user inputs content using the PC's input device, the PAD can receive and respond to input events from the PC. For example, if the user moves the mouse a certain distance, the mouse pointer on the PAD can move by the corresponding offset; if the user types on the PC's keyboard, the PAD can display the entered characters, and so on.

[0041] The third approach allows multiple electronic devices to share input devices. If a second electronic device lacks a suitable input device, it can use the input device of the first electronic device to input data. For example, a user can use a PC's mouse and keyboard to input data on a tablet. This method makes input operations more seamless, eliminating the need to switch between input devices and allowing for convenient and quick switching between different devices, thus improving the user's input experience.

[0042] In conjunction with the third aspect, in some embodiments, the method may further include: the second electronic device receiving a second offset sent by the first electronic device, the second offset being an offset corresponding to a third movement operation, the third movement operation being an operation indicating that the second cursor moves out of the second display interface of the second electronic device, the second offset being used to characterize the second cursor moving out of the second display interface of the second electronic device. Then, the second electronic device cancels the display of the second cursor.

[0043] In conjunction with the third aspect, in some embodiments, when the second electronic device cancels the display of the second cursor, the first cursor is displayed at a third position in the first display interface of the first electronic device.

[0044] In conjunction with the third aspect, in some embodiments, the first position is located on the second boundary of the second display interface, and the third position is located on the first boundary of the first display interface.

[0045] In conjunction with the third aspect, in some embodiments, the first electronic device includes a first input device, which may include one or more of the following: mouse, keyboard, handwriting tablet, camera, touchpad, scanner, stylus, remote control, voice input device, etc.

[0046] In conjunction with the third aspect, in some embodiments, the first movement operation, the second movement operation, or the third movement operation is detected by the first input device.

[0047] In conjunction with the third aspect, in some embodiments, the first movement operation, or the second movement operation, or the third movement operation is an input operation such as the user moving a mouse, or the user operating a touch-sensitive panel, or the user operating a keyboard, or the user operating a handwriting tablet, or the user operating a remote control, or the user operating a voice input device, or the user moving their eyes, or a program instruction indicating cursor movement.

[0048] In conjunction with the third aspect, in some embodiments, the first message carries the coordinates of a first location.

[0049] In conjunction with the third aspect, in some embodiments, if the first position is located on the boundary of the second display interface, the first offset is used to indicate that the second cursor moves in a direction within the second display interface.

[0050] In conjunction with the third aspect, in some embodiments, the first display interface has four boundaries, namely the top, bottom, left, and right boundaries of the display interface in a forward layout. The second display interface also has four boundaries, namely the top, bottom, left, and right boundaries of the display interface in a forward layout. If the first boundary is the left boundary of the first display interface, then the second boundary is the right boundary of the second display interface; if the first boundary is the right boundary of the first display interface, then the second boundary is the left boundary of the second display interface; if the first boundary is the top boundary of the first display interface, then the second boundary is the bottom boundary of the second display interface; and if the first boundary is the bottom boundary of the first display interface, then the second boundary is the top boundary of the second display interface.

[0051] In conjunction with the third aspect, in some embodiments, the method may further include, when the second cursor is displayed on the second display interface, the second electronic device receives a third message from the first electronic device via a first connection, the third message carrying a second input event, the second input event being an input event mapped to the first input event, wherein the first electronic device stores a first mapping table, the first mapping table storing the mapping relationship between the first input event and the second input event, and the first input event originating from an input operation collected by the first input device of the first electronic device.

[0052] In conjunction with the third aspect, in some embodiments, when the first input device is a keyboard, the first input event includes a first key code value generated by the user pressing the keyboard, and the second input event includes a second key code value. The character or control command corresponding to the first key code value in the first operating system is consistent with the character or control command corresponding to the second key code value in the second operating system.

[0053] In conjunction with the third aspect, in some embodiments, the first electronic device carries a first operating system, and the second electronic device carries a second operating system.

[0054] In conjunction with the third aspect, in some embodiments, the display area of ​​the first display interface is the visible area corresponding to the first resolution, the display area of ​​the second display interface is the visible area corresponding to the second resolution, and the coordinates of the first position of the second cursor displayed on the second display interface are determined by the first electronic device based on the coordinates of the first cursor on the first display interface, the first resolution of the first display interface, and the second resolution of the second display interface obtained from the second electronic device.

[0055] In conjunction with the third aspect, in some embodiments, the coordinates of the second cursor at a first position in the second display interface are the same as the coordinates of the first cursor at a fourth position in the virtual screen. The virtual screen is created by the first electronic device, and its resolution is a second resolution. The fourth position is the position on the virtual screen where the first cursor appears after moving out of the first display interface. The coordinates of the second cursor at a second position in the second display interface are the same as the coordinates of the first cursor at a fifth position in the virtual screen, and the offset of the fifth position relative to the fourth position is a first offset.

[0056] In conjunction with the third aspect, in some embodiments, the method may further include: when the display interface layout of the second electronic device changes from a second display interface to a third display interface, the second electronic device changes the position of the second cursor from a second position to a sixth position, wherein the second display interface and the third display interface contain the same interface elements, but the resolution of the second display interface is different from that of the third display interface. For example, when a PAD changes from landscape mode to portrait mode, if the layout of the PAD display interface changes, the position of the mouse pointer may change accordingly, pointing to the same pixel or the same interface element. Or, when a foldable phone switches between an unfolded state and a folded state, the position of the mouse pointer may also change with the change of the display interface.

[0057] In conjunction with the third aspect, in some embodiments, the second position and the sixth position point to the same interface element.

[0058] Fourthly, embodiments of the present invention provide an electronic device that may include a communication device, a memory, one or more processors, and one or more programs, wherein the one or more processors are configured to execute one or more computer programs stored in the memory, such that the electronic device can perform any of the functions of the first electronic device as described in the second aspect.

[0059] Fifthly, embodiments of this application provide an electronic device that may include a communication device, a memory, one or more processors, and one or more programs, wherein the one or more processors are configured to execute one or more computer programs stored in the memory, such that the electronic device can perform any of the functions of the second electronic device described in the third aspect.

[0060] Sixthly, embodiments of this application provide a communication system that may include the first electronic device and the second electronic device described in the foregoing aspects. It is understood that, based on the same inventive concept, the steps performed by the first electronic device and the second electronic device in the system of the sixth aspect may refer to the steps performed by the first electronic device and the second electronic device in the method of the first aspect when implementing corresponding functions. The functions and other descriptions of the first electronic device and the second electronic device may refer to the relevant descriptions in the fourth and fifth aspects, and will not be repeated here.

[0061] In a seventh aspect, embodiments of the present invention provide a computer storage medium storing a computer program, the computer program including executable instructions, which, when executed by a processor, cause the processor to perform operations corresponding to the methods provided in the first, second, or third aspects.

[0062] Eighthly, embodiments of this application provide a chip system that can be applied to an electronic device. The chip includes one or more processors, which are used to invoke computer instructions to cause the electronic device to implement any possible implementation as described in the first aspect, or any possible implementation as described in the second aspect, or any possible implementation as described in the third aspect.

[0063] In a ninth aspect, embodiments of this application provide a computer program product containing instructions, characterized in that, when the computer program product is run on an electronic device, it causes the electronic device to perform any possible implementation as described in the first aspect, or any possible implementation as described in the second aspect, or any possible implementation as described in the third aspect.

[0064] The method for sharing an input device provided in this application allows multiple electronic devices to share the input device. For example, a user can use a PC's mouse and keyboard to input data on a tablet. This method makes the user's input operation more seamless, eliminating the need to switch between input devices and enabling convenient and quick switching between different devices, thus improving the user's input experience. Furthermore, this method optimizes the implementation steps, reduces complex coordinate transformations, and lowers processor power consumption. Attached Figure Description

[0065] Figure 1 A schematic diagram of a communication system provided in an embodiment of this application;

[0066] Figure 2 A schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application;

[0067] Figure 3 This is a schematic diagram of the software architecture of the communication system provided in the embodiments of this application;

[0068] Figures 4A-4B A schematic diagram illustrating an internal implementation method provided in an embodiment of this application;

[0069] Figures 5A-5C A set of user interface diagrams provided for embodiments of this application;

[0070] Figures 6A-6C A set of scene interface diagrams provided for embodiments of this application;

[0071] Figure 7 A schematic diagram of the user interface provided for an embodiment of this application;

[0072] Figure 8 A schematic diagram of the user interface provided for an embodiment of this application;

[0073] Figures 9A-9C A set of scenario diagrams provided for embodiments of this application;

[0074] Figures 10A-10C Another set of scenario diagrams provided for embodiments of this application;

[0075] Figure 11 A schematic diagram of the user interface provided for an embodiment of this application;

[0076] Figure 12 A schematic diagram of the user interface provided for an embodiment of this application;

[0077] Figure 13 A flowchart illustrating a method for using a shared input device as provided in an embodiment of this application. Detailed Implementation

[0078] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Therefore, features defined with "first" and "second" can explicitly or implicitly include one or more of that feature. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more.

[0079] Smart terminal devices come in a wide variety, including mobile phones, PCs, tablets, and televisions. Because each terminal device is independent and may have different ecosystems—for example, a PC might have a different operating system—they can vary significantly. The other tablet's operating system is Each electronic device has its own dedicated input device, and these devices are typically not interchangeable across different devices. For example, PCs generally require a mouse, keyboard, or tablet for input, while tablets and mobile phones usually use touchscreens. However, in some situations, such as when using a keyboard and mouse to type, it's more convenient and faster than using a touchscreen keyboard, and users may need to use a mouse and keyboard when writing documents on a tablet. If a user uses both a PC and a tablet simultaneously, providing the tablet with a separate keyboard and mouse setup creates input device redundancy and forces the user to switch between input devices when using different electronic devices, resulting in inconvenience and a reduced user experience.

[0080] Taking the sharing of PC input devices such as mouse and keyboard between a PC and a tablet as an example, in one feasible screen mirroring solution, a screen mirroring interface for the tablet is created on the PC display screen. Users can use input devices such as mouse and keyboard to perform input operations on this interface, which are then sent to the tablet via the mirroring connection. The tablet responds to these input operations. In this implementation, the tablet's screen mirroring interface obstructs and occupies space on the PC display screen, resulting in wasted PC display space. Furthermore, the mouse position on the tablet's screen mirroring interface requires relatively complex conversion to correspond to the actual position on the tablet's display screen, leading to relatively complex calculations. Additionally, maintaining the screen mirroring function consumes a significant amount of power from the processor.

[0081] This application provides a method for sharing an input device, which can be applied to a communication system including multiple electronic devices. Taking the sharing of PC input devices such as a mouse and keyboard between a PC and a PAD as an example, according to the method provided in this application, after the PC establishes a connection with the PAD for sharing the input device, when the PC's mouse pointer reaches the boundary of the PC's display interface and detects an offset that the mouse will continue to move outward from the boundary, the PC can calculate the first position where the mouse pointer will appear on the PAD's display interface and send it to the PAD, notifying the PAD to display the mouse pointer on its display interface. Then, the PAD can draw the mouse pointer at the first position according to the message sent by the PC. This first position can be located on the boundary of the PAD's display interface. In some embodiments, after establishing a connection with the PAD for sharing the input device, the PC can create a virtual screen with the same resolution as the PAD. When the mouse pointer reaches the boundary of the PC's display interface and continues to move outward from the interface, the mouse pointer can move across the PC's display interface to the virtual screen. At the same time, the PAD can draw the mouse pointer on its display interface according to the message sent by the PC. Since the resolution of the virtual screen is the same as that of the PAD display, the position of the mouse pointer on the virtual screen corresponds one-to-one with the coordinate position displayed on the PAD. The coordinates of the mouse pointer on the virtual screen can be directly sent to the PAD without the need for complex coordinate transformation.

[0082] When the mouse pointer is displayed on the PAD, whenever the PC receives input events from the mouse, keyboard, etc., it can map these events to the corresponding input events acting on the PAD and send them to the PAD. Upon receiving an input event from the PC's input device, the PAD responds accordingly. Simultaneously, input events on the PC side are masked; that is, the PC does not respond to input events from the input device.

[0083] The method for sharing an input device provided in this application allows multiple electronic devices to share the input device. For example, a user can use a PC's mouse and keyboard to input on a PAD. This method makes the user's input operation more seamless, eliminating the need to switch between input devices and enabling convenient and quick switching between different devices, thus improving the user's input experience. Furthermore, compared to the aforementioned screen projection solutions, it reduces complex coordinate transformations and lowers processor power consumption.

[0084] The following describes some related terms and concepts involved in the embodiments of this application.

[0085] A pixel (PX) is the basic unit of image display. Each pixel can have its own color value and can be displayed using the three primary colors, such as red, green, and blue sub-pixels (RGB color gamut), or cyan, magenta, yellow, and black (CMYK color gamut). An image is a collection of individual pixels. Generally, the more pixels per unit area, the higher the resolution, and the closer the displayed image will be to the real object. On electronic devices, the number of pixels can be divided into horizontal pixel count and vertical pixel count. Horizontal pixel count represents the number of pixels contained in the horizontal direction, and vertical pixel count represents the number of pixels contained in the vertical direction.

[0086] Resolution refers to the number of pixels horizontally and vertically, measured in pixels (px), where 1 px = 1 pixel. Resolution determines how much information is displayed, measured in horizontal and vertical pixel counts, i.e., resolution = horizontal pixels * vertical pixels, such as 1960 * 1080. For images of the same physical size, a lower resolution (e.g., 640 * 480) displays fewer pixels, resulting in larger individual pixels and a coarser image; a higher resolution (e.g., 1600 * 1200) displays more pixels, resulting in smaller individual pixels and a more refined image.

[0087] A user interface (UI) is the medium through which an application or operating system interacts and exchanges information with a user. It converts information from its internal form to a form that the user can accept. A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be an icon, window, control, or other interface element displayed on the screen of an electronic device. Controls can include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.

[0088] An input device is a device that inputs data and information into an electronic device, serving as a bridge for communication between the user and the electronic device or between the electronic device and other electronic devices. Input devices are one of the main devices for information exchange between the user and electronic devices, including but not limited to keyboards, mice, cameras, scanners, writing tablets, styluses, remote controls, touch panels, voice input devices, etc. Input devices can generate input data from detected user operations and input it into the electronic device. The generated input data can be numerical or non-numerical, such as graphics, images, and sounds. This application does not impose any limitations on the type of input device or the input data generated by the input device.

[0089] Figure 1 A communication system 10 according to an embodiment of this application is illustrated. The communication system 10 may include an electronic device 100 and an electronic device 200, and a first connection 105 is established between the electronic device 100 and the electronic device 200. The electronic device 100 may be a smartphone, tablet computer, laptop computer, desktop computer, or other types of electronic device; this application does not impose any limitations on this. In some embodiments, such as... Figure 1 As shown, electronic device 100 can be a PC, and electronic device 200 can be a tablet computer.

[0090] exist Figure 1 In the communication system 10 shown, the electronic device 100 (such as a PC) may include a display 101 and input devices such as a mouse 102 and a keyboard 103. The input devices, such as the mouse 102 and keyboard 103, can be connected to the electronic device 100 via wired connection, such as a Universal Serial Bus (USB) connection, or via wireless connection, such as a Bluetooth (BT) connection or a Wi-Fi connection. This application does not impose any special restrictions on the connection method of the input devices. After the input devices, such as the mouse 102 and keyboard 103, are connected to the electronic device 100, the user can input content into the electronic device 100 using the mouse 102 and keyboard 103.

[0091] The electronic device 200 may include a screen 106, which can be used to receive touch operations from the user and display the corresponding user interface.

[0092] A first connection 105 is established between electronic device 100 and electronic device 200. The first connection 105 can be a wired connection, such as a USB connection, or a wireless connection, such as a Bluetooth connection or a Wi-Fi connection. This embodiment does not limit the type of the first connection. Electronic devices 100 and 200 may have a Bluetooth (BT) module and / or a wireless local area network (WLAN) module. The Bluetooth module can provide one or more Bluetooth communication solutions, including classic Bluetooth (Bluetooth 2.1) or Bluetooth Low Energy (BLE). The WLAN module can provide one or more WLAN communication solutions, including wireless fidelity peer-to-peer (Wi-Fi P2P), wireless fidelity local area networks (Wi-Fi LAN), or wireless fidelity software access point (Wi-Fi softAP). In some embodiments, the first connection 105 can be Wi-Fi P2P. Wi-Fi P2P refers to allowing devices in a wireless network to connect to each other in a peer-to-peer manner without needing a wireless router. This system is also known as Wireless Fidelity Direct (Wi-Fi Direct). Devices establishing a Wi-Fi P2P connection can exchange data directly via Wi-Fi (must be on the same frequency band) without being connected to a network or hotspot, enabling point-to-point communication such as transferring files, pictures, and videos. Compared to Bluetooth, Wi-Fi P2P has advantages such as faster search and transmission speeds, and longer transmission distances.

[0093] Electronic devices 100 and 200 can transmit data via the first connection 105. For example, in some embodiments, electronic device 100 can send the coordinate data and input events of mouse 102 and keyboard 103 to electronic device 200 via the first connection 105. After receiving the message sent by electronic device 100, electronic device 200 can display the mouse pointer 110 on screen 106 or respond accordingly to the input events of mouse 102 and keyboard 103. Therefore, users can perform input operations on electronic device 200 by using the mouse 102 and keyboard 103 of electronic device 100. Electronic devices 100 and 200 share a set of input devices, and electronic device 200 does not need to be equipped with additional input devices.

[0094] Electronic device 100 and electronic device 200 can be equipped with Alternatively, other types of operating systems may be used. The operating systems of electronic device 100 and electronic device 200 may be the same or different, and this application does not impose any restrictions on this.

[0095] In some embodiments, such as Figure 1 As shown, electronic device 100 displays interface 104, which is the desktop of electronic device 100. Interface 104 can display controls 109 and 111. Control 111 indicates that electronic device 100 has established a Bluetooth connection with other electronic devices (here referring to electronic device 200). Control 109 indicates that electronic device 100 shares input devices, such as mouse 102 and keyboard 103, with connected devices (here referring to electronic device 200). Screen 106 of electronic device 200 can display interface 107, which is also the desktop of electronic device 200. Interface 107 can display controls 108 and 112. Control 112 indicates that electronic device 200 has established a Bluetooth connection with other electronic devices (here referring to electronic device 100). Control 108 indicates that electronic device 200 has established a connection for sharing input devices, which here means that electronic device 200 can use the input devices of connected devices (here referring to electronic device 100), such as mouse 102 and keyboard 103. When the user moves the mouse cursor (also known as the mouse pointer) to the edge of the interface 104 of the electronic device 100, the mouse pointer 110 can move to the edge of the interface 107 of the electronic device 200. Then the mouse pointer 110 is displayed on the screen 106 of the electronic device 200 and can change position as the mouse 102 moves.

[0096] Figure 2 A schematic diagram of the structure of the electronic device 100 is shown. Figure 2 It can also be a structural schematic diagram of electronic device 200.

[0097] Electronic device 100 can be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) device, virtual reality (VR) device, artificial intelligence (AI) device, wearable device, in-vehicle device, smart home device and / or smart city device. These devices can all have built-in or external input devices, such as keyboard or mouse. The specific type of electronic device is not particularly limited in the embodiments of this application.

[0098] Electronic device 100 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone jack 270D, a sensor module 280, buttons 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc. The sensor module 280 may include a pressure sensor 280A, a gyroscope sensor 280B, a barometric pressure sensor 280C, a magnetic sensor 280D, an accelerometer sensor 280E, a distance sensor 280F, a proximity sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, an ambient light sensor 280L, a bone conduction sensor 280M, etc.

[0099] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0100] Processor 210 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.

[0101] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0102] The processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. This memory can store instructions or data that the processor 210 has just used or that are used repeatedly. If the processor 210 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.

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

[0104] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 210 may include multiple I2C buses. The processor 210 can couple to the touch sensor 280K, charger, flash, camera 293, etc., through different I2C bus interfaces. For example, the processor 210 can couple to the touch sensor 280K through the I2C interface, enabling the processor 210 and the touch sensor 280K to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0105] The I2S interface can be used for audio communication. In some embodiments, the processor 210 may include multiple I2S buses. The processor 210 can be coupled to the audio module 270 via the I2S bus to enable communication between the processor 210 and the audio module 270. In some embodiments, the audio module 270 can transmit audio signals to the wireless communication module 260 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.

[0106] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 270 and the wireless communication module 260 can be coupled via the PCM bus interface. In some embodiments, the audio module 270 can also transmit audio signals to the wireless communication module 260 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0107] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 210 and the wireless communication module 260. For example, the processor 210 communicates with the Bluetooth module in the wireless communication module 260 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 270 can transmit audio signals to the wireless communication module 260 via the UART interface to enable music playback through Bluetooth headphones.

[0108] The MIPI interface can be used to connect the processor 210 to peripheral devices such as the display screen 294 and the camera 293. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 210 and the camera 293 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 210 and the display screen 294 communicate via the DSI interface to enable the electronic device 100 to display images.

[0109] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 210 to a camera 293, a display screen 294, a wireless communication module 260, an audio module 270, a sensor module 280, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0110] USB interface 230 is a USB standard compliant interface, specifically a Mini USB interface, Micro USB interface, USB Type-C interface, etc. USB interface 230 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. Furthermore, it can be used to connect a mouse and keyboard for inputting commands and strings. This interface can also be used to connect other electronic devices, such as AR devices.

[0111] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0112] The charging management module 240 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 240 receives charging input from the wired charger via a USB interface 230. In some wireless charging embodiments, the charging management module 240 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 42, the charging management module 240 can also supply power to the electronic device via the power management module 241.

[0113] The power management module 241 connects the battery 242, the charging management module 240, and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240, providing power to the processor 210, internal memory 221, display screen 294, camera 293, and wireless communication module 260, etc. The power management module 241 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 241 may also be located within the processor 210. In other embodiments, the power management module 241 and the charging management module 240 may be located in the same device.

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

[0115] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.

[0116] The mobile communication module 250 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 250 may include at least one filter, switch, power amplifier, low-noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves via the antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to the modem processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 250 may be housed in the processor 210. In some embodiments, at least some functional modules of the mobile communication module 250 and at least some modules of the processor 210 may be housed in the same device.

[0117] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 270A, receiver 270B, etc.) or displays images or videos through the display screen 294. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 210 and may be housed in the same device as the mobile communication module 250 or other functional modules.

[0118] The wireless communication module 260 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 210. The wireless communication module 260 can also receive signals to be transmitted from processor 210, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0119] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 250, and antenna 2 is coupled to wireless communication module 260, enabling electronic device 100 to communicate with networks and other devices via 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 technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0120] Electronic device 100 implements display functions through a GPU, display screen 294, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 210 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0121] Display screen 294 is used to display images, videos, etc. Display screen 294 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 294, where N is a positive integer greater than 1.

[0122] Electronic device 100 can perform shooting functions through ISP, camera 293, video codec, GPU, display screen 294 and application processor.

[0123] The ISP (Image Signal Processor) is used to process data fed back from the camera 293. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 293.

[0124] Camera 293 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 293, where N is a positive integer greater than 1.

[0125] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.

[0126] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0127] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0128] Internal memory 221 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM).

[0129] Random access memory can include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, fifth generation DDR SDRAM is generally called DDR5 SDRAM), etc.

[0130] Non-volatile memory can include disk storage devices and flash memory.

[0131] Flash memory can be classified according to its operating principle, including NOR FLASH, NAND FLASH, 3D NAND FLASH, etc.; according to the level of the storage cell, including single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc.; and according to the storage specification, including universal flash storage (UFS) and embedded multimedia card (eMMC), etc.

[0132] The random access memory can be directly read and written by the processor 210. It can be used to store executable programs (such as machine instructions) of the operating system or other running programs, as well as user and application data.

[0133] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct reading and writing by the processor 210.

[0134] The external memory interface 220 can be used to connect to external non-volatile memory, thereby expanding the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 210 through the external memory interface 220 to perform data storage functions. For example, music, video, and other files can be stored in the external non-volatile memory.

[0135] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone jack 270D, and application processor.

[0136] The audio module 270 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 270 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 270 may be located in the processor 210, or some functional modules of the audio module 270 may be located in the processor 210.

[0137] The speaker 270A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or make hands-free calls through the speaker 270A.

[0138] The receiver 270B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 270B can be brought close to the ear to listen to the voice.

[0139] Microphone 270C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 270C, inputting the sound signal into microphone 270C. Electronic device 100 may have at least one microphone 270C. In some embodiments, electronic device 100 may have two microphones 270C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may also have three, four, or more microphones 270C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.

[0140] The 270D headphone jack is used to connect wired headphones. The 270D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0141] Pressure sensor 280A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 280A can be disposed on display screen 294. There are many types of pressure sensors 280A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 280A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 294, electronic device 100 detects the intensity of the touch operation based on pressure sensor 280A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 280A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.

[0142] The gyroscope sensor 280B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 280B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 280B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 280B detects the angle of the shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 280B can also be used in navigation and motion-sensing game scenarios.

[0143] The barometric pressure sensor 280C is used to measure air pressure. In some embodiments, the electronic device 100 calculates altitude using the air pressure value measured by the barometric pressure sensor 280C to assist in positioning and navigation.

[0144] The magnetic sensor 280D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 280D to detect the opening and closing of the flip cover. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover using the magnetic sensor 280D. Then, based on the detected opening and closing state of the cover or the flip cover, features such as automatic flip unlocking can be set.

[0145] The 280E accelerometer can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices and applied to applications such as screen orientation switching and pedometers.

[0146] A distance sensor 280F is used to measure distance. The electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, the electronic device 100 can utilize the distance sensor 280F to measure distance for rapid focusing.

[0147] The proximity sensor 280G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 may use the proximity sensor 280G to detect when a user holds the electronic device 100 close to their ear for a call, so as to automatically turn off the screen to save power. The proximity sensor 280G can also be used in holster mode and pocket mode for automatic unlocking and locking of the screen.

[0148] The ambient light sensor 280L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 294 based on the sensed ambient light. The ambient light sensor 280L can also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 280L can also work in conjunction with the proximity sensor 280G to detect whether the electronic device 100 is in a pocket, preventing accidental touches.

[0149] The fingerprint sensor 280H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.

[0150] Temperature sensor 280J is used to detect temperature. In some embodiments, electronic device 100 uses the temperature detected by temperature sensor 280J to execute a temperature handling strategy. For example, when the temperature reported by temperature sensor 280J exceeds a threshold, electronic device 100 reduces the performance of a processor located near temperature sensor 280J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is below another threshold, electronic device 100 heats battery 242 to prevent abnormal shutdown of electronic device 100 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, electronic device 100 boosts the output voltage of battery 242 to prevent abnormal shutdown due to low temperature.

[0151] Touch sensor 280K, also known as a "touch device," can be located on display screen 294. The touch sensor 280K and display screen 294 together form a touchscreen, also known as a "touchscreen." Touch sensor 280K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 294. In other embodiments, touch sensor 280K may also be located on the surface of electronic device 100, in a different position than display screen 294.

[0152] The bone conduction sensor 280M can acquire vibration signals. In some embodiments, the bone conduction sensor 280M can acquire vibration signals from the vibrating bone segments of the human vocal cords. The bone conduction sensor 280M can also contact the human pulse to receive blood pressure signals. In some embodiments, the bone conduction sensor 280M can also be incorporated into headphones to form bone conduction headphones. The audio module 270 can parse the voice signals from the vibrating bone segments of the vocal cords acquired by the bone conduction sensor 280M to realize voice functionality. The application processor can parse heart rate information from the blood pressure signals acquired by the bone conduction sensor 280M to realize heart rate detection functionality.

[0153] Buttons 290 include a power button, volume buttons, etc. Buttons 290 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.

[0154] Motor 291 can generate vibration alerts. Motor 291 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can be corresponding to touch operations applied to different applications (such as taking photos, playing audio, etc.). Motor 291 can also correspond to different vibration feedback effects for touch operations applied to different areas of the display screen 294. 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 be customized.

[0155] Indicator 292 can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0156] The SIM card interface 295 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 295 to make contact with and separate from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 295 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 295 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 295 is also compatible with different types of SIM cards. The SIM card interface 295 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0157] The following describes a system software architecture provided by an embodiment of this application. Taking the communication system 10 composed of electronic devices 100 and 200 of the present invention as an example, the system software structure provided by the embodiment of this application is illustrated by way of example.

[0158] Figure 3 This is a system software architecture block diagram of the communication system 10 provided in an embodiment of this application.

[0159] like Figure 3As shown, the software architecture of the communication system 10 includes electronic device 100 and electronic device 200. Electronic device 100 and electronic device 200 can establish a first connection and communicate through the first connection. The first connection can be a Bluetooth connection, a Wi-Fi connection, etc. This embodiment does not limit the connection method of the first connection.

[0160] In some embodiments, the software architecture of the communication system 10 can be divided into an application and kernel layer and an equipment layer. The application layer may include a series of application packages. Here, the system software architecture is described using an electronic device 100 as a PC and an electronic device 200 as a tablet computer as an example. The input device for the PC can be a mouse 102, a keyboard 103, etc., and the tablet computer can have a touchscreen.

[0161] The device layer of electronic device 100 may include input / output devices such as display 101, mouse 102, and keyboard 103.

[0162] Display 101 is an output device used to display images, videos, etc. Display 101 includes a display panel. Electronic device 100 may include one or more displays 101, where N is a positive integer greater than 1.

[0163] Mouse 102 is an input device, serving as an indicator for positioning on the horizontal and vertical axes in an electronic device's display system. Using a mouse makes operating electronic devices easier and faster. Mouse types can include ball mice, optical mice, wireless mice, etc. In this application, the mouse can be extended to any device capable of generating a cursor and allowing clicking.

[0164] Keyboard 103 is an input device that allows users to input characters, numbers, punctuation marks, control commands, etc., into electronic devices.

[0165] The application and kernel layer of electronic device 100 may include a display driver 311, a mouse driver 312, a keyboard driver 313, etc. Drivers can communicate with hardware devices via a bus, control the hardware to enter various working states, and obtain the values ​​of relevant device registers to obtain the device's state. For example, drivers can acquire user operation events, such as mouse input, keyboard input, and rotation of the electronic device, and convert these events into data.

[0166] The display driver 311 can be a program used to drive the display.

[0167] Mouse driver 312 can perform the following three tasks: first, display the mouse cursor on the screen and maintain its movement; second, provide the application with the mouse status, including the position of the mouse cursor on the screen and whether the mouse buttons are pressed or released; and third, provide the application with some auxiliary functions for mouse operation.

[0168] The keyboard driver 313 is an interrupt routine that generates a scan code based on the pressed key, then obtains the American Standard Code for Information Interchange (ASCII) from the scan code, and then puts it into a buffer queue for output or other calls.

[0169] The application and kernel layer of the electronic device 100 may also include a virtual screen management module 314, an input event generation module 315, an input event sending module 316, etc.

[0170] Virtual screen management module 314 can be used to create virtual screens. In some embodiments, such as in... In the OS X, a virtual screen can be created by creating an IDCX_MONITOR object. This virtual screen can have the same resolution as the display of electronic device 200, and it is invisible to the user. Electronic device 100 creates the virtual screen so that the mouse pointer can pass through its display, and the coordinates of the mouse pointer on the virtual screen can be directly sent to electronic device 200 without complex coordinate transformations. Without a virtual screen or an external display, the mouse pointer would be confined to the edge of electronic device 100's display, making it impossible to jump between different displays (including the virtual screen). When the mouse pointer moves onto the virtual screen, because the resolution of the virtual screen is the same as the display of electronic device 200, the coordinates of the mouse pointer on the virtual screen can be directly sent to electronic device 200 without complex coordinate transformations, simplifying the process and saving CPU resources.

[0171] The input event generation module 315 can be used to convert the acquired input events from the input devices into corresponding input events that can be applied to the electronic device 200. For example, when the mouse pointer is detected to reach the edge of the display screen of the electronic device 100, the electronic device 100 can calculate the starting position of the mouse pointer on the display screen of the electronic device 200 and send it to the electronic device 200 through the input event sending module 316. The electronic device 200 receives the message and displays the mouse pointer at the corresponding position, forming a visual effect of the mouse pointer moving from the electronic device 100 to the electronic device 200. For example, after the mouse pointer moves to the display screen of the electronic device 200, the input events of the input devices (such as mouse, keyboard, and handwriting tablet) of the electronic device 100 will be captured. Then, according to the mapping relationship in the first mapping table, corresponding input events that can be applied to the electronic device 200 are generated and sent to the electronic device 200. These input events include, but are not limited to, mouse movement events, mouse click events, mouse wheel scrolling events, keyboard input events, remote control joystick movement events, and voice input events. For example, the electronic device 100 can convert the mouse pointer to the edge of the display screen of the electronic device 200 according to the first mapping table. The system's input events are mapped as The system's input events, The system's input events can act on electronic device 200. For example, in The left mouse button click event on the system can be mapped to Click events in the system, The right-click event on the system can be mapped to Long press event in the system. The key value of the first key in the system can be mapped to the corresponding key. In the system, key values, such as the character "a", are used in... The key codes in the system may be related to The key codes in the system are not the same.

[0172] The input event sending module 316 can be used by electronic device 100 to send input events, etc., to electronic device 200 through a first connection.

[0173] The device layer of electronic device 200 may include a touch sensor 321 and a display screen 322.

[0174] Touch sensor 321, also known as a "touch panel," can be mounted on display screen 322. The touch sensor 321 and display screen 322 together form a touchscreen, also known as a "touch screen." Touch sensor 321 detects touch operations applied to or near it. Touch sensor 321 can transmit the detected touch operation to the application processor to determine the type of touch event.

[0175] The display screen 322 is an output device that can be used to display images and colors. The display screen 322 can provide visual output related to touch operation.

[0176] The application and kernel layer of electronic device 200 may include a touch sensor driver 323, a display driver 324, an input event receiving module 325, and an input event response module 326. Among them, the touch sensor driver 323 and the display driver 324 are programs that drive the hardware device touch sensor and display screen.

[0177] The input event receiving module 325 can be used to listen to the communication interface and obtain messages sent by the electronic device 100 through the first connection, including but not limited to instructions to display the mouse pointer, the absolute coordinates of the mouse pointer, the offset coordinates of the mouse pointer, the press events of the mouse button, the scroll events of the mouse wheel, the press events of the keyboard button, the key values ​​corresponding to the keyboard button, etc.

[0178] The input event response module 326 can be used to process input events after the input event receiving module 325 receives a message from the electronic device 100. For example, when the input event receiving module 325 receives a message from the electronic device 100 displaying a mouse pointer with coordinates (padX, padY), the input event response module 326 can respond to the message, draw the mouse pointer at coordinates (padX, padY), and display it on the display screen 322. As another example, after the input event receiving module 325 receives input events from the electronic device 100 such as mouse movement, mouse click, mouse wheel scrolling, keyboard input, or remote control joystick movement, the input event response module 326 can process the input events.

[0179] For details on the specific implementation, please refer to the subsequent explanations, which will not be elaborated here.

[0180] The above description of the software architecture of the communication system 10 is merely an example. It is understood that the software architecture illustrated in the embodiments of the present invention does not constitute a specific limitation on this application. In other embodiments of this application, the communication system 10 may include more or fewer modules than illustrated, or combine some modules, or split some modules, or have different architectural arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0181] The following describes an internal implementation method provided by an embodiment of this application.

[0182] In this embodiment, a device equipped with PCs with operating systems and equipped with This example illustrates the sharing of input devices such as mice and keyboards between tablets running the same operating system. This example does not constitute any limitation on this application. The method for sharing input devices provided in this application can also be implemented between multiple electronic devices of other different types, such as sharing the input devices of a laptop computer between a mobile phone, laptop computer, and tablet computer. This application also does not impose any limitations on the operating systems and types of input devices running on different electronic devices; for example, input devices can also be handwriting tablets, voice input devices, cameras, etc.

[0183] In this application, up, down, left, and right are relative concepts of direction. For example, when an electronic device is in a vertical position, downward is defined as the direction of gravity. Or, when the user's eyes are facing a forward-facing display interface, left is the user's left-hand side, right is the user's right-hand side, up is the direction the user's eyes are pointing towards their head, and down is the direction the user's eyes are pointing towards their torso. A forward-facing display interface refers to a display interface in which the text, symbols, icons, etc., are arranged in the direction most suitable for the user's reading. Since direction is a relative concept, the above description is only an example and does not constitute a limitation.

[0184] In this embodiment, a first connection is established between the PC and the PAD. The PC has a display screen for showing the user interface and input devices such as a mouse and keyboard. The PC can create a virtual screen invisible to the user, which has the same size and resolution as the PAD's display screen. When the mouse pointer reaches the edge of the PC's display screen, it can move across the PC's display screen to the virtual screen. Simultaneously, the PAD can draw the mouse pointer based on the corresponding position of the PC's virtual screen and the PAD's display screen. When the mouse pointer is displayed on the PAD, when the PC receives input events such as mouse or keyboard input, it can map them to the corresponding input events on the PAD and send them to the PAD. After receiving the input event, the PAD responds accordingly. Therefore, the user can use the PC's input devices to input on the PAD.

[0185] The specific implementation of this embodiment can be divided into three parts: (i) creation of the virtual screen; (ii) movement of the mouse pointer; and (iii) response to input events.

[0186] (I) Creating a Virtual Screen

[0187] Specifically, the PC can be accessed via The operating system's built-in application programming interface (API) functions create one or more virtual screens. The created virtual screens have the same resolution as the PAD's display and are invisible to the user. Of course, if there are multiple electronic devices that need to share an input device, multiple virtual screens can be created for each electronic device, with each virtual screen having the same screen resolution as its corresponding electronic device. Here, we use the example of a PC creating a virtual screen with the same screen resolution as the PAD. In some embodiments, such as in... In the operating system, a virtual screen can be created by creating an IDCX_MONITOR object. Specifically, creating a virtual screen may include the following steps:

[0188] (1) Define the specifications of the virtual screen.

[0189] First, initialize the device and configure relevant parameters. You can use functions like IDD_CX_CLIENT_CONFIG_INIT for initialization, set callback functions, and configure display modes such as resolution and refresh rate. For example, here, you can set the resolution to be the same as the resolution of the PAD display obtained by the PC.

[0190] (2) Create a virtual screen.

[0191] After initialization, you can use the IddCxMonitorCreate function to create an IDCX_MONITOR object, which is a virtual screen.

[0192] (3) Insert a virtual screen.

[0193] After successfully creating the IDCX_MONITOR object, the IddCxMonitorArrival function is called to notify the system that the virtual screen has been inserted. When the system returns a success message, it indicates that the virtual screen has been successfully created and is ready for use. The virtual display can be detected in the system's display settings.

[0194] To delete or unregister this virtual monitor from the system later, you can call the `IddCxMonitorDeparture` function. Each time a virtual monitor is "inserted," an `IDDCX_MONITOR` object is successfully created in the system; deleting the virtual monitor destroys that `IDDCX_MONITOR` object.

[0195] At this point, the PC has created a virtual screen with the same resolution as the PAD display. Furthermore, the relative positions of the PC display and the virtual screen can be set. For example, the virtual screen can be positioned to the right of the PC display, meaning the right edge of the PC display meets the left edge of the virtual screen. In this case, the mouse pointer can exit from the right edge of the PC display and enter from the corresponding position on the left edge of the virtual screen. If the virtual screen is positioned to the bottom of the PC display, meaning the bottom edge of the PC display meets the top edge of the virtual screen, the mouse pointer can exit from the bottom edge of the PC display and enter from the corresponding position on the top edge of the virtual screen. The same logic applies to other edges. If multiple virtual screens are created, generally, to avoid conflicts, they can be connected to different edges of the PC display. For example, if virtual screen 1 is positioned to the right of the PC display, then virtual screen 2 can be positioned to the bottom of the PC display.

[0196] (II) Mouse pointer movement

[0197] Visually, the mouse pointer can "move" from the PC screen to the PAD screen. This example illustrates how the mouse pointer can move from the right edge of the PC screen to the left edge of the PAD. The PC and PAD are set to landscape orientation, meaning their left and right edges are the shorter sides of the devices. (Reference) Figure 4A Specifically, it may include the following steps:

[0198] (1) Detect the mouse pointer reaching the edge of the PC screen.

[0199] Specifically, a PC can use The system's `GetPhysicalCursorPos` function retrieves the absolute coordinates (pcX, pcY) of the mouse pointer's location. The maximum value of these absolute coordinates (pcX, pcY) can be the PC screen's display resolution. For example, if the PC screen's current display resolution (screenWidth, screenHeight) is 1920×1080 pixels, then the absolute coordinates of the top-left corner of the screen can be the origin (0,0), the bottom-right corner (1920, 1080), the bottom-left corner (0, 1080), and the top-right corner (1920, 0). The absolute coordinates of any position on the PC screen fall within the range of (0,0) to (1920, 1080). The PC screen's display resolution can be obtained using the `GetSystemMetrics` function.

[0200] When the mouse moves a certain distance, the PC can use the RawInput function to obtain the offset of the mouse pointer corresponding to that distance. The offset is the difference between the starting position and the ending position of the movement. The offset can be a vector, including direction and distance, and can be represented by offset coordinates (relX, relY).

[0201] Here, taking the detection of the mouse cursor reaching the right edge of the PC screen as an example, if (pcX+relX)>screenWindth, the result is returned that the mouse cursor has reached the right edge of the PC desktop. If (pcY+relY)>screenHeight, the result is returned that the mouse cursor has reached the bottom edge of the PC desktop. The cases of the mouse cursor reaching the top and left edges of the PC screen can be deduced similarly, and will not be elaborated here.

[0202] (2) Calculate the starting position of the mouse pointer on the PAD display screen.

[0203] When the PC detects that the mouse pointer has reached the edge of the PC screen, the PC calculates the starting coordinates of the mouse pointer on the PAD display. The PC can calculate the starting position (padX, padY) of the mouse pointer on the PAD display based on the absolute coordinates (pcX, pcY) of the mouse pointer that has reached the edge of the PC screen, the display resolution of the PC screen (screenWidth, screenHeight), and the display resolution of the PAD display (remoteWidth, remoteHeight).

[0204] Here, taking the top left corner of the PAD display as the absolute coordinate origin as an example, in some embodiments, when the mouse pointer moves to the right edge of the PC display (pcX... max When pcY), (pcX) max The x-coordinate is the maximum value, i.e., screenWidth. Therefore, the starting position of the mouse pointer on the PAD screen (padX, padY) is calculated as follows:

[0205]

[0206] According to the above calculation formula, the horizontal coordinate of the starting position of the mouse pointer on the PAD display is 0, and its vertical coordinate is the position corresponding to the PC's vertical coordinate, calculated based on the ratio of the PC's and PAD's display resolutions. In other words, the starting position of the mouse pointer is on the left edge of the PAD display. For example, if the mouse pointer leaves from the middle of the right edge of the PC display, it can appear at the middle of the left edge of the PAD display. This makes the user feel that the entire movement of the mouse pointer is continuous, resulting in a better user experience.

[0207] Similarly, when the mouse pointer moves to the left edge of the PC screen (pcX), min When pcY), (pcX) min The x-coordinate is 0, so the starting position (padX, padY) of the mouse pointer on the PAD screen is calculated as follows:

[0208]

[0209] That is, the mouse pointer appears at a certain position on the right edge of the PAD screen.

[0210] Similarly, when the mouse pointer moves to the top edge of the PC screen (pcX, pcY)... min When (pcY) min The y-coordinate is at its minimum value, i.e., 0. Therefore, the starting position of the mouse pointer on the PAD screen (padX, padY) is calculated as follows:

[0211]

[0212] That is, the mouse pointer appears at a certain position on the bottom edge of the PAD screen.

[0213] Similarly, when the mouse pointer moves to the bottom edge of the PC screen (pcX, pcY)... max When (pcX) max The vertical coordinate () represents the maximum value, i.e., screenHeight. Therefore, the starting position of the mouse pointer on the PAD screen (padX, padY) is calculated as follows:

[0214]

[0215] That is, the mouse pointer appears at a certain position on the top edge of the PAD screen.

[0216] The method described above for calculating the starting position of the mouse pointer on the PAD display is merely an example and does not constitute any limitation on this application.

[0217] In other embodiments, when the mouse pointer is detected to have moved out of any edge of the PC display screen, the mouse pointer can appear at a fixed coordinate on the PAD display screen, such as the origin, i.e., (padX, padY) is (0,0). This application does not impose any restrictions on the position of the mouse pointer on the PAD display screen.

[0218] (3) The mouse pointer is displayed on the PAD screen.

[0219] After the PC calculates the starting position (padX, padY) where the mouse pointer will appear on the PAD's screen, the PC can send a message to the PAD carrying the coordinates (padX, padY), instructing the PAD to display the mouse pointer at coordinates (padX, padY). Simultaneously, the PC's mouse pointer moves to the coordinates (vmX, vmY) on the PC's virtual screen. The coordinates (vmX, vmY) correspond one-to-one with (padX, padY), and their coordinate values ​​are identical.

[0220] For example, the PC screen has a resolution of 2560×1600 pixels, the PAD screen has a resolution of 1280×800 pixels, and the virtual screen created by the PC has the same resolution as the PAD, also 1280×800 pixels. When the mouse pointer reaches the right edge of the PC at coordinates (pcX, pcY) (2560, 1000), the PC calculates the starting position of the mouse pointer on the PAD screen as (padX, padY) (0, 500). Similarly, the mouse pointer moves to the virtual screen at coordinates (vmX, vmY) (0, 500). Then, the PC's mouse pointer moves from the right edge of the PC (2560, 1000) to the left edge of the virtual screen (0, 500), and simultaneously the PC sends a message to the PAD carrying the coordinates (0, 500), instructing the PAD to display the mouse pointer at coordinates (0, 500). In response to a notification from the PC, the PAD displays the mouse pointer at coordinates (0, 500). This makes it appear as if the mouse pointer has moved from the PC's screen to the PAD's screen. The same principle applies to other instances where the mouse pointer "moves" from the PC to the PAD; the above examples do not constitute any limitation on this embodiment.

[0221] The PC creates virtual screens to allow the mouse pointer to move across the PC display, jumping between different screens (including virtual screens), and the mouse pointer coordinates within the virtual screen can be directly sent to the PAD without complex coordinate transformations. Without a virtual screen or an external display, the mouse pointer is confined to the edges of the PC display. When the mouse pointer moves onto a virtual screen, because the virtual screen's resolution is the same as the PAD's display, the mouse pointer coordinates on the virtual screen can be directly sent to the PAD without complex coordinate transformations, simplifying the process and saving CPU resources.

[0222] (III) Response to Input Events

[0223] After the mouse pointer moves onto the PAD display, input events from PC input devices (such as mouse, keyboard, and graphics tablet) are captured and sent to the PAD, which can then respond to these events. Conversely, input events on the PC side are masked, meaning the PC does not respond to input events from the input devices. (Reference) Figure 4B Specifically, it may include the following steps:

[0224] (1) Acquiring input events.

[0225] When input devices, such as mice, keyboards, voice input devices, handwriting tablets, and cameras, detect user input, the PC can capture that input action, such as mouse movement, mouse clicks, or keyboard key presses, and generate corresponding input events. For example, equipped with... The system's PC can use the `RawInput` function to obtain the mouse's `MOUSE_MOVE` event and generate the corresponding mouse pointer offset coordinates (relX, relY). That is, the PC can obtain the distance and direction of mouse movement and convert them into the mouse pointer's offset direction and distance. If `MOUSE_MOVE` is specified as `MOUSE_MOVE_RELATIVE`, the offset coordinates (relX, relY) are relative to the previous mouse position; if `MOUSE_MOVE` is specified as `MOUSE_MOVE_ABSOLUTE`, the offset coordinates (relX, relY) are relative to a fixed position. Regardless of the method, the offset coordinates (relX, relY) indicate relative movement data. On the screen coordinate axis, when the mouse moves upward, relY is negative; when it moves downward, relY is positive; when it moves left, relX is negative; and when it moves right, relX is positive.

[0226] Additionally, the PC can also capture mouse button press events and mouse wheel scrolling events. For example, in In the system, the values ​​RI_MOUSE_LEFT_BUTTON_DOWN indicate that the left mouse button is pressed, and RI_MOUSE_LEFT_BUTTON_UP indicates that the left mouse button is released; RI_MOUSE_MIDDLE_BUTTON_DOWN indicates that the middle mouse button is pressed, and RI_MOUSE_MIDDLE_BUTTON_UP indicates that the middle mouse button is released; RI_MOUSE_RIGHT_BUTTON_DOWN indicates that the right mouse button is pressed, and RI_MOUSE_RIGHT_BUTTON_UP indicates that the right mouse button is released, etc. RI_MOUSE_WHEEL indicates input from the mouse wheel, with a positive increment indicating forward scrolling and a negative increment indicating backward scrolling. RI_MOUSE_HWHEEL indicates input from the horizontal mouse wheel, with a positive increment indicating rightward scrolling and a negative increment indicating leftward scrolling.

[0227] A PC can use hook functions to capture keyboard input events. For example, when the first key is pressed, the PC can obtain the key's pressed state (KEYDOWN) and its key code (keycode). If the first key is released, it returns to the released state (KEYUP). Each key on the keyboard corresponds to a key code, which can follow the ASCII code table. Pressing a character key inputs the corresponding character, and pressing a control key invokes the corresponding control function.

[0228] The above embodiments are merely examples and do not constitute a limitation on the embodiments of this application. Input events can also be voice input, handwriting input, touch input, and combinations thereof, etc.

[0229] (2) Mapping of input events.

[0230] In some embodiments, the PC may store a first mapping table (Map) indicating the mapping relationship between input events of the PC and input events of the PAD. Input events include, but are not limited to, mouse movement events, mouse click events, mouse wheel scrolling events, keyboard input events, remote control joystick movement events, and voice input events. For example, the PC can use the first mapping table to... The system's input events are mapped as The system's input events, System input events can be applied to the PAD. For example, in The left mouse button click event on the system can be mapped to Click events in the system, The right-click event on the system can be mapped to Long press event in the system. The key code value of the first key in the system can be mapped to the corresponding key. In the system, key codes, for example, the same character "a", are used in... The key codes in the system may be related to The key codes in the system are not the same.

[0231] Since the PC virtual screen and the PAD display have the same resolution, the coordinates of the mouse pointer on the PC virtual screen can be the same as those on the PAD. The absolute coordinates and offset coordinates of the mouse pointer in the PC virtual screen can be directly sent to the PAD without complex coordinate conversion, which is simple, convenient, and saves CPU resources.

[0232] (3) Sending and responding to input data.

[0233] In some embodiments, The system has its own input subsystem for unified management of input events. The uinput implementation based on this subsystem can easily simulate input events in user space. For example, virtual devices (such as virtual mice and keyboards) can be created using uinput, their properties configured, and then the sequence of input events (inputevents) obtained from the PC can be written to the / dev / uinput device file to post these input events. The PAD can then obtain input events from the PC's mouse, keyboard, or other input devices even when no physical input devices are available.

[0234] The PC can package the input events obtained from the first mapping table into data packets conforming to the first connection's transmission protocol format, and then send them to the PAD via the first connection (such as Wi-Fi Direct). Upon receiving the input event, the PAD injects it into uinput and then responds to it. The input event data can include the time (time), type (type), code (code), and value (value).

[0235] For example, if the input event type is EVENT_KEY (keyboard), the code is the device keyboard code, and the code value from 0 to 127 represents the key code on the keyboard. A value of 1 indicates that the key is pressed, and a value of 0 indicates that the key is released. If the input event type is EVENT_MOUSE (mouse), the code is the device mouse code, and the code value from 0x110 to 0x116 represents the mouse button code. Specifically, 0x110 (BTN_LEFT) is the left mouse button code, 0x111 (BTN_RIGHT) is the right mouse button code, and 0x112 (BTN_MIDDLE) is the middle mouse button code. A value of 1 indicates that the key is pressed, and a value of 0 indicates that the key is released. If the input event type is EVENT_REL (relative coordinates), the code value indicates the type of trajectory. For example, REL_X (code 0x00) indicates the mouse pointer offset along the X-axis, REL_Y (code 0x01) indicates the mouse offset along the Y-axis, and REL_WHEEL (code 0x08) indicates the direction of the mouse wheel movement. Positive and negative values ​​represent values ​​in two different directions. The meanings of other input event codes can be found in the include / linux / input.h file.

[0236] After the above steps, once the initial connection between the PC and the PAD is established, when the mouse pointer moves across the edge of the PC screen, the corresponding mouse pointer can be displayed on the PAD screen. Furthermore, while the mouse pointer is displayed on the PAD, input events from the PC's input device can be converted and sent to the PAD, which then responds to these input events, such as mouse movement, mouse clicks, or keyboard input.

[0237] The implementation methods described in the above embodiments are merely illustrative and do not constitute any limitation on this application. The specific internal implementation methods may vary depending on the type of electronic device, the operating system it runs, the program used, and the interfaces called. This application embodiment does not impose any limitations, as long as the functions described in this application embodiment can be achieved.

[0238] Figure 5A , Figure 5B , Figure 5C The illustrations show some user interface diagrams provided in embodiments of this application. In some embodiments, such as Figure 5AAs shown, based on the shared input device functionality provided in other embodiments of this application, the electronic device 100 can add an input device sharing settings interface, such as interface 501. Interface 501 may include a title bar 502, which can display the title text "Input Device Sharing Device" and an icon. Interface 501 also includes multiple option lists, such as a list of connectable devices 501, a list of shared input devices 504, and a list of connected device locations 505.

[0239] The connectable device list 503 displays devices that can currently be connected to use the shared input device function. This list sequentially lists the devices and displays their connection status, such as: connected, paired but not connected, or not paired. Figure 5A In the interface, electronic device 200 is connected and can share the input device with this device. Electronic device 300 is paired but not connected; it needs to be connected before it can share the input device. Electronic device 400 is not paired; it needs to be paired by electronic device 100 and successfully paired before it can connect. The connectable device list 503 also includes a refresh control; selecting this control refreshes the current list of connectable devices. The connectable device list 503 also includes a show / hide list control 506; clicking this control shows or hides all or some of the connectable devices. The connectable device list 503 may only display some frequently used or closest electronic devices. If the desired electronic device is not listed, clicking the "More" control will display all connectable devices in another user interface on electronic device 100. The connection between electronic device 100 and electronic device 200 can be initiated manually by the user or set to automatically establish a connection the next time the function is accessed after a successful connection. The user operation that initiates the connection can be clicking the "Connect" control in the settings interface, or the user bringing the electronic device 200 close to the electronic device 100, such as a "tap" operation to trigger the connection, or a first gesture or other user operation. This application embodiment does not limit this.

[0240] The shared input device list 504 can display existing input devices, such as mice, keyboards, handwriting tablets, cameras, etc. Users can choose the input devices they want to share. The switch control 507 is a control for turning input devices on / off. Figure 5AThe mouse and keyboard switch control 507 is displayed as "on," meaning the mouse and keyboard of electronic device 100 can be shared with electronic device 200. Similarly, the shared input device list 504 also includes a show / hide list; clicking the show / hide list control can show or hide all or some input devices. Likewise, the shared input device list 504 may only display some commonly used input devices. If the desired input device is not listed, clicking the "More" control will display other input devices on electronic device 100.

[0241] The Device Location 505 control allows users to easily set the relative positions of multiple electronic devices. Clicking control 508 displays, for example... Figure 5B , Figure 5C The detailed settings interface is shown.

[0242] Figure 5B This is a diagram illustrating the location of the connected device. For example... Figure 5B As shown, the device location interface 510 may have a schematic box 511 indicating the device location relationship, and a prompt 512 "Drag the box to adjust the relative position of the settings". Figure 5B The device position relationship diagram 511 shows that the right edge of the electronic device 100 (this device) connects to the left edge of the tablet computer. The mouse pointer can exit from the right edge of the electronic device 100 (this device) and then enter from the left edge of the tablet computer. The interface 510 can also display a horizontal / vertical selection box 513. After selecting a device in the diagram 511, the user can select the orientation of the device's long or short side in the horizontal / vertical selection box 513. For example, horizontal orientation indicates the long side of the device is vertically positioned, and the short side is horizontally positioned; vertical orientation indicates the long side is horizontally positioned, and the short side is vertically positioned. Figure 5B In the image, the tablet computer is selected by the user, and the area is displayed in gray, indicating that it is selected. The horizontal / vertical selection box 513 is set to vertical, meaning the tablet computer's longer side is positioned horizontally or vertically. The horizontal / vertical orientation affects which edge connects the electronic devices—whether it's the longer or shorter side—and also affects the position of the mouse pointer at the device's edge. For example, if the tablet computer is in portrait orientation, the right edge of this device connects to the tablet computer's longer side; if the tablet computer is in landscape orientation, the right edge of this device connects to the tablet computer's longer side. Different edge connection relationships result in different mouse pointer positions when moving between devices. After adjusting the device positions, you can click "Apply Control" 514 to save and apply the settings. If you don't want to change the settings, you can click "Cancel Control" 515.

[0243] Users can drag and drop the illustrated devices within the diagram 511 to change the edge connection relationships between the devices. For example, in... Figure 5BIn the image, the user can drag the tablet computer illustration from the right side of the device to the bottom side to display something like this. Figure 5C The device location interface 520, as shown in schematic box 521, indicates that the tablet computer is located at the bottom of the device, meaning the mouse pointer can pass through the bottom edge of the device and enter from the top edge of the tablet computer. In the landscape / portrait selection box 522, the tablet computer is set to landscape mode, meaning the long side of the tablet computer is positioned vertically.

[0244] Figure 5A , Figure 5B , Figure 5C The user interfaces shown are merely examples and do not constitute any limitation on the embodiments of this application. The settings interface for the shared input device may include more or fewer controls or functions than the example interface, such as setting font size, setting resolution, etc. Furthermore, the settings interface for the shared input device can not only be located on electronic device 100, but also on the other end electronic device, such as electronic device 200, where the same or similar settings interface can be provided. The settings for the shared input device can be performed on both terminals, achieving the same effect.

[0245] Figure 6A and Figure 6B This illustrates the process of the mouse pointer moving from the edge of the display screen of electronic device 100 to the edge of the display screen of electronic device 200, i.e., the aforementioned process of the mouse pointer moving back and forth.

[0246] like Figure 6A and Figure 6B As shown, electronic device 100 and electronic device 200 have established a first connection 610 supporting shared input device functionality. After the first connection 610 is established, electronic device 200 can create a virtual screen 500 with the same resolution as electronic device 200. Figure 6A In the example, the left edge of the virtual screen 500 can be set to meet the right edge of the electronic device 100, so that the mouse pointer 601 can pass through the right edge of the interface 104 of the electronic device 100 and pass through the left edge of the interface of the virtual screen 500. Simultaneously, the mouse pointer 603 is displayed on the left edge of the interface 107 of the electronic device 200, as shown. Figure 6B As shown.

[0247] like Figure 6AAs shown, the electronic device 100 displays interface 104 on screen 101. Interface 104 is the desktop of the electronic device 100, and mouse pointer 601 is displayed on interface 104. When the user moves mouse 102 to the right, as shown in the figure, the mouse moves from the dotted line position to the solid line position, and mouse pointer 601 can move along the direction of the arrow in the figure to the position (pcX, pcY) of mouse pointer 602 on the right edge of interface 104. Then, the electronic device 100 can calculate the position (padX, padY) where the mouse pointer will appear on the left edge of interface 107 of the electronic device 200, and the position (vmX, vmY) where mouse pointer 602 will be displayed on the left edge of virtual screen 500, based on (pcX, pcY). Since the resolution of virtual screen 500 is set to be the same as that of electronic device 200 to simplify coordinate transformation, the coordinate values ​​of the mouse pointer position (vmX, vmY) in virtual screen 500 are the same as the coordinate values ​​of the mouse pointer position (padX, padY) in electronic device 200.

[0248] like Figure 6B As shown, when the mouse pointer 602 of the electronic device 100 is located at the right edge of the interface 104, if the user continues to move the mouse 102 to the right, as shown in the figure, the mouse moves from the dotted line position to the solid line position, and the mouse pointer 602 can move to the left edge position (vmX, vmY) of the virtual screen 500 along the direction of the arrow in the figure. At the same time, the electronic device 100 can send a message carrying the position (padX, padY) to the electronic device 200 through the first connection 610, notifying the electronic device 200 to display the mouse pointer at the position (padX, padY). Upon receiving the message, the electronic device 200 displays the mouse pointer 603 at the right edge position (padX, padY) of the interface 107. The position (vmX, vmY) of the mouse pointer 602 in the virtual screen 500 corresponds to the position (padX, padY) of the mouse pointer 603 in the electronic device 200. Visually, it can present a continuous effect where the mouse pointer moves from the right edge of the desktop interface 104 of the electronic device 100 to the left edge of the desktop interface 107 of the electronic device 200.

[0249] like Figure 6CAs shown, after the mouse pointer 603 is displayed at the left edge of the electronic device 200, if the user continues to move the mouse 102 to the right, as shown in the diagram, the mouse moves from the dotted line position to the solid line position. The distance the mouse 102 moves corresponds to offset coordinates (relX, relY). Based on these offset coordinates (relX, relY), on the virtual screen 500, the mouse pointer 602 can move to the position of the mouse pointer 604 in the direction of the arrow shown in the diagram. Simultaneously, the electronic device 100 can send a message carrying the offset coordinates (relX, relY) to the electronic device 200 via the first connection 610, notifying the electronic device 200 that the mouse pointer 603 has shifted to the right by a distance (relX, relY). Upon receiving this message, the mouse pointer 603 in the interface 107 of the electronic device 200 shifts to the right to the position of the mouse pointer 605. The position (vmX, vmY) of the mouse pointer 604 in the virtual screen 500 corresponds to the position (padX, padY) of the mouse pointer 605 in the electronic device 200. From the user's perspective, this can present the visual effect of the mouse pointer on the desktop interface 107 of the electronic device 200 moving as the mouse 102 moves. (Not limited to...) Figure 6A , Figure 6B , Figure 6C The illustration shows a mouse pointer exiting from the right edge of electronic device 100 and entering from the left edge of electronic device 200. The mouse pointer can also exit from other edges of electronic device 100, such as the top, bottom, or left edge, and then enter from any other edge of electronic device 200. (See the interface reference.) Figures 6A to 6C This will not be elaborated upon here.

[0250] Figure 7 This is a schematic diagram illustrating how electronic device 200 responds to a mouse click event 102. After... Figures 6A to 6C As shown, after the mouse pointer "travels" to the interface 107 of the electronic device 200, as... Figure 7 As shown, the user can control the input devices of electronic device 100, such as mouse 102 and keyboard 103, to generate input events. Electronic device 200 can respond after receiving the input events from electronic device 100. For example... Figure 7In the context of the device 200 interface 107, the user moves the mouse pointer 701 to the "Music" application icon and clicks it 702. Upon receiving the click 702, the device 100 maps the click event 702 to a click event that can be applied to the device 200 using a first mapping table, and sends this click event to the device 200 via the first connection 610. In response to the click event on the "Music" application icon, the device 200 opens the music application and displays the application interface 703. The user can then use the mouse 102 to play music, adjust the volume, change songs, and perform other operations on the application interface 703.

[0251] Figure 8 This is a schematic diagram of electronic device 200 responding to input events from keyboard 103. Electronic device 200 has established a first connection 610 with electronic device 100, sharing the input device. Electronic device 200 can receive and respond to input from keyboard 103.

[0252] like Figure 8 As shown, the electronic device 200 displays an interface 800. When the mouse pointer 801 clicks on the input box 802, content can be entered into the input box 802. For example, if a user presses the first key on the keyboard 103, after the electronic device 100 receives the operation of the first key being pressed, it can send a message of the input content and the corresponding key value of the first key to the electronic device 200 through the first connection 610. After receiving the message from the electronic device 100, the electronic device 200 can display the corresponding characters in the input box 802. Figure 8 As shown, by pressing the key corresponding to the string "nihao" on keyboard 103, the electronic device 200 displays the string "nihao" in the input box 802 in response to the key operation. Of course, in addition to characters, the electronic device 200 can also respond to keyboard control key commands, such as "enter," but this embodiment does not limit this.

[0253] Figure 7 , Figure 8 The examples only illustrate mouse click events and keyboard input events. Of course, input events include, but are not limited to, mouse movement events, mouse click events, mouse wheel scrolling events, keyboard input events, remote control joystick movement events, voice input events, etc. Any operation of the input device of electronic device 100 can be applied to electronic device 200, and the above embodiments do not limit this.

[0254] Figures 9A-9CThis is a schematic diagram of an interface in a scenario where multiple electronic devices share an input device. The example uses three devices: electronic device 100 (this device), a tablet computer, and a mobile phone. The same logic applies to other scenarios where multiple electronic devices share an input device, so further details are omitted.

[0255] In some embodiments, after the electronic device 100 establishes connections with both a tablet and a mobile phone for sharing input devices, the electronic device 100 can create virtual screens with the same resolution as the tablet and mobile phone, respectively. Then, in the input device sharing settings, settings such as... can be displayed. Figure 9A The interface 901 shows the location of connected devices. In the device connection diagram 902, the user can adjust the connection between the electronic device 100 and a tablet or mobile phone. For example… Figure 9A The device positioning diagram in box 902 illustrates that the tablet computer is positioned to the right of the electronic device 100 (this device), and the mobile phone is positioned below this device. Specifically, the right edge of this device connects to the left edge of the tablet computer, and the bottom edge of this device connects to the top edge of the mobile phone. It also indicates that the mouse pointer can exit from the right edge of the electronic device 100 (this device) and then enter from the left edge of the tablet computer, and that the mouse pointer can exit from the bottom edge of the electronic device 100 (this device) and then enter from the top edge of the mobile phone.

[0256] like Figure 9B As shown, electronic device 100 establishes a connection 915 with electronic device 200 (tablet computer) for sharing input devices, and simultaneously establishes a connection 914 with electronic device 300 (mobile phone) for sharing input devices. Input devices of electronic device 100, such as a mouse and keyboard, can be shared with electronic devices 200 and 300. For example, electronic devices 200 and 300 can use the mouse of electronic device 100 for clicking operations or the keyboard for inputting characters. Figure 9B As shown, after the electronic device 100 is connected to a mouse device, a mouse pointer 916 can be displayed on its screen interface 911. After undergoing... Figure 9AAfter the connected device positions are set as shown, in response to mouse movement, the mouse pointer 916 can exit from the bottom edge of the display interface 911 and then enter from the top edge of the display interface 912 of the electronic device 300, displaying the mouse pointer 917 on interface 912; the mouse pointer 916 can also exit from the right edge of the display interface 911 and then enter from the left edge of the display interface 913 of the electronic device 200, displaying the mouse pointer 918 on interface 913. The mouse pointer 917 can move with the mouse, and when the mouse pointer 917 is in the interface 912 of the electronic device 300, the electronic device 300 can respond to input operations such as mouse clicks and keyboard character input. Similarly, the mouse pointer 918 can move with the mouse, and when the mouse pointer 918 is in the interface 913 of the electronic device 200, the electronic device 200 can respond to input operations such as mouse clicks and keyboard character input.

[0257] Figure 9C It shows Figure 9B The process of moving the mouse pointer from the display screen of electronic device 300 to the display screen of electronic device 200 in the scenario shown. Figure 9C In the scenario shown, because there is no direct communication connection between electronic device 200 and electronic device 300, the mouse pointer cannot move directly from electronic device 300 to electronic device 200; it must instead pass through electronic device 100. For example, as... Figure 9C As indicated by the middle arrow, as the user moves the mouse upwards, the mouse pointer 921 on electronic device 300 can exit from the top edge of interface 912 and then enter from the bottom edge of interface 911 on electronic device 100, displaying mouse pointer 922 on interface 911 of electronic device 100. Then, the user can continue to move the mouse to the right, and the mouse pointer 922 on electronic device 100 can continue to exit from the right edge of interface 911 and then enter from the left edge of interface 913 on electronic device 200, displaying mouse pointer 923 on interface 913 of electronic device 200.

[0258] Of course, users can drag the illustrated devices in the device connection diagram 1002 to change the edge connection relationships between devices. For example, in Figure 10AIn this interface, users can adjust the connection between electronic device 100 and mobile phones / tablets. As shown in the schematic box 1002 in the connection device location interface 1001, the tablet is positioned to the right of electronic device 100 (this device), and the mobile phone is positioned to the left of this device. Specifically, the right edge of this device connects to the left edge of the tablet, and the left edge of this device connects to the right edge of the mobile phone. This indicates that the mouse pointer can exit from the right edge of electronic device 100 (this device) and then enter from the left edge of the tablet, and vice versa.

[0259] Similarly, such as Figure 10B As shown, electronic device 100 establishes a connection 1015 with electronic device 200 (tablet computer) for sharing input devices, and simultaneously establishes a connection 1014 with electronic device 300 (mobile phone) for sharing input devices. Input devices of electronic device 100, such as a mouse and keyboard, can be shared with electronic devices 200 and 300. For example, electronic devices 200 and 300 can use the mouse of electronic device 100 for clicking operations or the keyboard for inputting characters. Figure 10B As shown, after the electronic device 100 is connected to a mouse device, a mouse pointer 1016 can be displayed on its screen interface 1011. After undergoing... Figure 10A After the connected device positions are set as shown, in response to mouse movement, mouse pointer 1016 can exit from the left edge of display interface 1011 and then enter from the right edge of display interface 1012 of electronic device 300, displaying mouse pointer 1017 on interface 1012; mouse pointer 1016 can also exit from the right edge of display interface 1011 and then enter from the left edge of display interface 1013 of electronic device 200, displaying mouse pointer 1018 on interface 1013. Mouse pointer 1017 can move with the mouse, and when mouse pointer 1017 is located in interface 1012 of electronic device 300, electronic device 300 can respond to input operations such as mouse clicks and keyboard character input. Similarly, mouse pointer 1018 can move with the mouse, and when mouse pointer 1018 is located in interface 1013 of electronic device 200, electronic device 200 can respond to input operations such as mouse clicks and keyboard character input.

[0260] Figure 10C It shows Figure 10B The process of moving the mouse pointer from the display screen of electronic device 300 to the display screen of electronic device 200 in the scenario shown. Figure 10CIn the scenario shown, because there is no direct communication connection between electronic device 200 and electronic device 300, the mouse pointer cannot move directly from electronic device 300 to electronic device 200; it must instead pass through electronic device 100. For example, as... Figure 10C As indicated by the middle arrow, as the user moves the mouse to the right, the mouse pointer 1021 on electronic device 300 can exit from the right edge of interface 1012 and then enter from the left edge of interface 1011 on electronic device 100, whereby mouse pointer 1022 is displayed. Then, if the user continues to move the mouse to the right, mouse pointer 1022 on electronic device 100 can continue to exit from the right edge of interface 1011 and then enter from the left edge of interface 1013 on electronic device 200, whereby mouse pointer 923 is displayed.

[0261] The arrangement of multiple devices is not limited to the examples above. Users can increase or decrease the number of devices and / or adjust the connection relationship between multiple devices according to their own needs. The schematic interface and internal implementation can be referred to the foregoing embodiments, and this application does not limit this.

[0262] Figure 11 This illustration shows the change in mouse pointer position when the electronic device 200 (tablet computer) changes from landscape to portrait mode in some embodiments. Referring to the foregoing embodiments, Figure 11 The tablet computer shown has established a shared input device connection with electronic device 100, allowing the user to input data on the tablet using input devices from electronic device 100 (such as a mouse, keyboard, or handwriting tablet). Landscape and portrait modes are relative concepts based on the orientation of the electronic device. Figure 11 As shown, the tablet computer's landscape mode means that the long side of the tablet screen 1102 is vertically aligned, and the short side is horizontally aligned. In the vertical mode, downward is defined as the direction of gravity. The tablet computer's portrait mode means that the short side of the tablet screen 1102 is vertically aligned, and the long side is horizontally aligned. If the orientation of the electronic device 200's display interface is not locked, when the electronic device 200 changes from landscape to portrait mode, the layout of the display interface can change under the detection of gravity sensors. For example, if the direction of gravity is downward, the layout of the interface in landscape mode will differ from that in portrait mode. The electronic device 200 can automatically adjust the layout of text, symbols, icons, etc., on the display interface to facilitate user reading. As the layout of the display interface changes, the position of the mouse pointer may also change.

[0263] like Figure 11As shown, when the tablet is in landscape mode, the mouse pointer 1101 is displayed on the display interface 1103. Rotating the tablet 90 degrees from landscape mode changes it to portrait mode. As the screen changes from landscape to portrait, the layout of the display interface 1104 may also change; the icons, controls, and text in interface 1104 will be arranged to adapt to the portrait orientation. The position of the mouse pointer 1105 in the display interface 1104 may also change accordingly. In some embodiments, such as... Figure 11 As shown, in landscape mode, mouse pointer 1101 points to the application icon "Information". After the tablet rotates to portrait mode, the tablet can redraw and display mouse pointer 1105 at the corresponding position of the application icon "Information" after the layout change. In this case, the target of the mouse pointer remains unchanged before and after switching between landscape and portrait modes, making operation more convenient and providing a better experience for the user.

[0264] In other embodiments, the absolute position of the mouse pointer may remain unchanged between landscape and portrait modes. For example, if a tablet computer has a resolution of 1280×800 pixels, with the top-left corner as the origin (0, 0), the mouse pointer position in landscape mode is point A (600, 500). If the tablet computer is rotated 90 degrees to the right, it becomes portrait mode, and the mouse pointer position in portrait mode becomes point B (300, 600). Visually, the mouse pointer position in landscape and portrait modes is the same point, pointing to the same pixel.

[0265] In other embodiments, the ratio of the horizontal / vertical coordinates of the mouse pointer can remain unchanged. For example, if the tablet computer has a resolution of 1280×800 pixels, with the top left corner as the origin (0, 0), the mouse pointer position in landscape mode is point C (320, 600). Point C's horizontal coordinate is one-quarter of the horizontal length, and its vertical coordinate is three-quarters of the vertical length. If the tablet computer is rotated 90 degrees to the right, changing to portrait mode, and the ratio of the horizontal and vertical edges of the mouse pointer position remains the same as in landscape mode, the mouse pointer position in portrait mode can become point D (200, 960).

[0266] When the position, status, or layout of an electronic device changes, the position of the mouse pointer may change accordingly. The above examples do not constitute a limitation on the embodiments of this application, and there are many ways in which the position of the mouse pointer may change.

[0267] In some embodiments, such as Figure 12 As shown, the electronic device 400 is a foldable screen phone. When the foldable screen phone changes state, such as when the display screen changes from an unfolded state to a folded state, the position of the mouse pointer can change accordingly. Referring to the aforementioned embodiment, Figure 12The foldable phone shown has established a shared input device connection with electronic device 100, allowing users to input data on the foldable phone using input devices from electronic device 100 (such as a mouse, keyboard, or handwriting tablet). The unfolded state of the foldable phone refers to the first display screen (large screen) 1201 being visible, while the folded state refers to the second display screen (small screen) 1202 being visible. The size of the first display screen is larger than the size of the second display screen. Figure 12 As shown, in the unfolded state, the first display screen 1201 displays interface 1203. The first display screen 1201 can be folded along the bending part until the two edges of the display screen are folded and overlapped, and it is displayed in the folded state. In the folded state, the second display screen 1202 displays interface 1204.

[0268] like Figure 12 As shown, when the foldable phone is in its unfolded state, the mouse pointer 1205 is displayed on interface 1203. When the screen is completely folded, the foldable phone enters its folded state. As the phone transitions from an unfolded to a folded state, the layout of the display interface may change; the icons, controls, and text in interface 1204 will be arranged to adapt to the folded state. The position of the mouse pointer 1206 in display interface 1204 may also change accordingly. For example... Figure 11 As shown, when the foldable phone is in the unfolded state, the mouse pointer 1205 points to the application icon "Information". After it changes to the folded state, the mouse pointer 1206 can be redrawn and displayed at the corresponding position of the "Information" application icon after the layout change. In this case, the target pointed to by the mouse pointer remains unchanged before and after the unfolded / folded state switch, which is more convenient for users and provides a better experience. The above example does not constitute a limitation on the embodiments of this application, and the change of the mouse pointer position can be done in many ways.

[0269] In conjunction with the foregoing embodiments, the following describes a method for sharing an input device provided by an embodiment of this application.

[0270] Figure 13 This is a flowchart of a method for sharing an input device according to an embodiment of this application. This method can be applied to a first electronic device and a second electronic device. The method may include steps such as cursor navigation, cursor movement, and input event response, and the specific implementation steps are as follows:

[0271] S101, the first electronic device establishes a first connection with the second electronic device.

[0272] In some embodiments, the first electronic device may be the aforementioned electronic device 100 (such as a PC), and the second electronic device may be the aforementioned electronic device 200 (such as a PAD or mobile phone). The first electronic device and the second electronic device establish a first connection to form a communication system 10. A description of the communication system 10 can be found in the foregoing embodiments. The first electronic device and the second electronic device may be equipped with… Alternatively, other types of operating systems may be used. The operating systems of the first electronic device and the second electronic device may be the same or different, and this application does not impose any restrictions on this.

[0273] In some embodiments, the first connection can be a wireless connection, such as a Bluetooth connection or a Wi-Fi connection, or a wired connection, such as a USB connection. This embodiment does not limit the type of the first connection. This embodiment also does not limit the process of establishing the first connection. In one implementation, the first electronic device and the second electronic device can establish the first connection by touching each other using NFC short-range communication technology.

[0274] The first electronic device may be equipped with input devices such as a mouse, keyboard, and handwriting tablet. After the first electronic device and the second electronic device establish a first connection, the second electronic device can also use the input devices of the first electronic device to input content. The first connection can be a wired connection, such as a USB connection, or a wireless connection, such as a Bluetooth connection or a Wi-Fi connection. This application embodiment does not limit the type of the first connection.

[0275] In one possible implementation, after the first electronic device establishes a first connection with the second electronic device, the first electronic device can create a virtual screen invisible to the user. This virtual screen has the same resolution as the second display interface of the second electronic device. The first electronic device creates this virtual screen to facilitate the movement of a mouse pointer or other cursor used for indicating position across the edges of the first electronic device's display interface, jumping between different displays (including the virtual screen). If no virtual screen is created or no new external display is connected, the mouse pointer or other cursor used for indicating position will be confined to the boundary of the first electronic device's display interface. Furthermore, after the mouse pointer or other cursor moves onto the virtual screen, since the resolution of the virtual screen is the same as the resolution of the second electronic device's display, the coordinates of the mouse pointer on the virtual screen can be directly sent to the second electronic device without complex coordinate transformations, which is simple, convenient, and saves CPU resources. For detailed explanations, please refer to the foregoing embodiments, which will not be repeated here.

[0276] 1. Cursor navigation (S102-S106)

[0277] S102, the first electronic device detects that the first cursor has moved to the third position of the first boundary of the first display interface.

[0278] The first cursor is used to indicate a target position on the display interface; for example, the first cursor can be a mouse pointer. The user can control the movement of the first cursor by operating the first input device of the first electronic device. For example, when the first input device is a mouse, when the user moves the mouse, the first electronic device can instruct the mouse pointer on the display interface to move a certain distance in the corresponding direction based on the detected direction and distance of mouse movement. The correspondence between the mouse movement distance and the mouse pointer movement distance on the display interface can be adjusted in the mouse pointer sensitivity settings. If the first input device is a touchpad or other touch-sensitive panel, the user can control the movement of the first cursor by sliding their finger on the touchpad. The first input device can also be a keyboard, and the user can control the movement of the first cursor by operating the "up, down, left, right" directional keys. The first input device can also be a remote control, and the user can control the movement of the first cursor by operating the remote control. The first input device can also be a camera, controlling the movement of the first cursor by detecting pupil movement. This application does not impose any limitations on the first input device.

[0279] In this embodiment, the display interface can be a two-dimensional planar interface, and the third position of the first boundary can be represented as a two-dimensional coordinate. The first display interface is the display interface for the content displayed by the first electronic device. The first display interface does not necessarily fill the display screen of the first electronic device. In some cases, the aspect ratio of the first display interface may not be consistent with the aspect ratio of the display screen. In this case, a black area will be generated outside the first display interface on the display screen, and no content will be displayed in the black area.

[0280] The display interface of a first electronic device can have multiple boundaries. For example, PCs, tablets, and mobile phones typically have four boundaries. For ease of understanding and description, this example uses a display interface with a user facing a front-facing layout, which can be referred to as the top boundary, bottom boundary, left boundary, and right boundary. In some embodiments, such as... Figure 5B , Figure 5CAs shown, the boundary connection between the display screen of the first electronic device and the boundary connection between the second electronic device / virtual screen can be set. For example, the second electronic device / virtual screen can be set to the right of the display screen of the first electronic device, that is, the right boundary of the display screen of the first electronic device is connected to the left boundary of the second electronic device / virtual screen. In this case, the first cursor can exit from the right boundary of the display screen of the first electronic device and enter from the corresponding position on the left boundary of the display screen of the second electronic device / virtual screen; of course, the first cursor can also exit from the left boundary of the display screen of the second electronic device / virtual screen and enter from the right boundary of the display screen of the first electronic device. If the second electronic device / virtual screen is set to the bottom of the display screen of the first electronic device, that is, the bottom boundary of the display screen of the first electronic device is connected to the top boundary of the display screen of the second electronic device / virtual screen, then the first cursor can exit from the bottom boundary of the display screen of the first electronic device and enter from the corresponding position on the top boundary of the display screen of the second electronic device / virtual screen; of course, the first cursor can also exit from the top boundary of the display screen of the second electronic device / virtual screen and enter from the bottom boundary of the display screen of the first electronic device. The connection of other boundaries is similar. If the first electronic device is connected to multiple other devices, generally, to avoid conflicts, the multiple devices can be connected to different edges of the first electronic device's display screen. For example, if the second electronic device is located to the right of the first electronic device, then the third electronic device can be located below the first electronic device. For detailed explanations, please refer to the foregoing embodiments, which will not be repeated here.

[0281] In this embodiment of the method, the first boundary of the display interface of the first electronic device can be set to be connected to the second boundary of the display interface of the second electronic device. "Connected" does not mean that the displays of the two electronic devices are touching, but rather that when the first cursor reaches the first boundary of the display interface of the first electronic device and continues to move along the direction of the first boundary, it can be displayed on the second boundary of the display interface of the second electronic device. Visually, the first cursor "passes out" from the first boundary of the first electronic device and then "passes in" from the second boundary of the second electronic device; the first cursor "shuttles" from the display interface of the first electronic device to the display interface of the second electronic device. Similarly, the first cursor can also "pass back" from the display interface of the second electronic device to the display interface of the first electronic device; that is, when the first cursor reaches the second boundary of the display interface of the second electronic device and continues to move along the direction of the second boundary, it can be displayed on the first boundary of the display interface of the first electronic device.

[0282] S103, the first electronic device detects a first movement operation, which is an operation that indicates that the first cursor moves out of the first display interface of the first electronic device. The first movement operation corresponds to a third offset, which is used to characterize that the first cursor moves out of the boundary of the first display interface.

[0283] For example, the first movement operation can be a user moving the mouse. The first movement generated by the user moving the mouse can be converted into a third offset indicating the movement of the mouse pointer. The third offset is a vector, including the offset direction and offset distance. The third offset is used to represent the movement of the first cursor in a first direction, which is the direction towards the outside of the boundary of the first display interface. If the first boundary is the right boundary of the first display interface, when the first cursor is located on the first boundary, and the direction of the third offset contains a rightward component, the first electronic device can execute step S104.

[0284] S104, the first electronic device can calculate the first position on the second display interface of the second electronic device from the third position.

[0285] In some embodiments, the first position and the third position can be two-dimensional coordinates. The first electronic device can calculate the first position where the first cursor will appear on the second display interface of the second electronic device based on the first resolution of the first display interface, the second resolution of the second display interface, and the third position where the first cursor is located. The third position can be a coordinate position on the first boundary of the display interface of the first electronic device, and the first position can be a coordinate position on the second boundary of the display interface of the second electronic device. For specific calculation methods on how to calculate the first position based on the third position, please refer to the foregoing. Figure 4A The described embodiments will not be repeated here. Similarly, the second display interface refers to the interface area where the content is displayed on the second electronic device, and the second display interface may not cover the entire display screen of the second electronic device.

[0286] S105, the first electronic device sends a first message to the second electronic device, and the first message may carry information such as the first location.

[0287] The first electronic device can send a first message carrying first location information to the second electronic device to notify the second electronic device to display a second cursor at the first location. In some embodiments, the first message may not carry information specifying the location, but only information to display the second cursor. After receiving the message to display the second cursor, the second electronic device can determine the position of the second cursor in the second display interface on its own.

[0288] S106, the second electronic device displays a second cursor at a first position on the second display interface according to the first message.

[0289] After receiving the first message, the second electronic device can draw and display a second cursor at the first position. The first position can be a coordinate position on the second boundary of the display interface of the second electronic device, or it can be a fixed position; this embodiment does not impose any restrictions.

[0290] Correspondingly, the cursor can also "cross back" from the second display interface of the second electronic device to the first display interface of the first electronic device. For example, when the second cursor is at the second boundary of the second display interface, if the first electronic device detects a third movement operation—an operation initiated by a user—that instructs the second cursor to move outside the second display interface, and this third movement operation corresponds to a second offset, which instructs the second cursor to move in a second direction beyond the boundary of the second display interface, then the first electronic device can display the first cursor at a third position on the first display interface.

[0291] In some embodiments, when the second cursor is displayed on the second display interface, the first cursor will not be displayed on the first display interface of the first electronic device to avoid confusing the user.

[0292] 2. Cursor movement (S107-S109)

[0293] S107, the first electronic device detects the first offset.

[0294] In some embodiments, the first electronic device can detect a second movement operation by the user. This second movement generates a second movement, which corresponds to a first offset. The first offset is a vector coordinate, including the direction and distance of movement. For example, the second movement operation could be the user moving a mouse a certain distance, moving a finger a certain distance on a touchpad, or moving a remote control joystick, etc. This second movement operation can instruct the second cursor to move by the first offset. The embodiments do not limit the type of input device and input event. Input events that cause cursor movement could also include the first electronic device's camera detecting the user's gesture or pupil movement, etc.

[0295] If the first position is a position on the boundary of the second display interface, then the first offset generated by the second movement is used to indicate that the second cursor moves in a direction within the second display interface.

[0296] S108, the first electronic device sends a second message to the second electronic device, the second message carrying information such as the first offset.

[0297] The first electronic device sends a second message carrying first offset information to the second electronic device to notify the second electronic device that the second cursor has generated a displacement of the first offset.

[0298] S109, the second electronic device moves the second cursor from the first position to the second position, and the offset of the second position relative to the first position is the first offset.

[0299] Because the first electronic device creates a virtual screen with the same resolution as the second electronic device, when the second electronic device displays the second cursor at the first position in the second display interface, the first cursor moves to the fourth position on the virtual screen, where the coordinates of the fourth position are the same as the first position. Upon detecting a second movement operation, the second electronic device moves the second cursor from the first position to the second position, and simultaneously, the first electronic device moves the first cursor from the fourth position to the fifth position, where the coordinates of the fifth position are the same as the second position.

[0300] 3. Input event response (S110-S112)

[0301] Since the first operating system on the first electronic device may differ from the second operating system on the second electronic device, when the second cursor is displayed on the second electronic device's screen, and the first electronic device receives an input event from an input device such as a mouse, keyboard, or stylus, it can convert the input event into a corresponding input event on the second electronic device and send it to the second electronic device. Upon receiving the input event, the second electronic device can respond accordingly, thus enabling the user to input data using the input devices from the first electronic device on the second electronic device.

[0302] S110, the first electronic device detects the first input event and can map the first input event to a second input event according to the first mapping table.

[0303] The first input event originates from an input operation collected by a first input device of the first electronic device. The first input device may include: a mouse, keyboard, handwriting tablet, camera, touchpad, scanner, stylus, remote control, voice input device, etc. For example, the first input event may be a single click of the left mouse button, a single click of the right mouse button, a single click of the middle mouse button, a double click of the left mouse button, a double click of the right mouse button, a long press of the left mouse button, a long press of the right mouse button, scrolling the mouse wheel, or pressing the first key on the keyboard. Alternatively, it may be a voice input, a stylus input, a touch click, or a combination thereof. This application does not impose any limitations on these events.

[0304] In some embodiments, the first electronic device may store a first mapping table, which may indicate the mapping relationship between a first input event acting on the first electronic device and a second input event acting on the second electronic device. The first electronic device may, according to the first mapping table, convert the acquired first input event from the input device into a corresponding second input event that can be acted on the second electronic device, and send it to the second electronic device.

[0305] For example, a first electronic device, such as a PC, can use a first mapping table to apply the action to The system's input events are mapped to act on The system's input events, second electronic devices such as PADs equipped with The system. For example, in The left mouse button click event on the system can be mapped to Click events in the system, The right-click event on the system can be mapped to Long press event in the system. The key code value of the first key in the system can be mapped to the corresponding key. In the system, key codes, for example, the same character "a", are used in... The key code value in the system may be related to The key codes in the system are not the same.

[0306] S111, the first electronic device sends a third message to the second electronic device, the third message carrying the second input event.

[0307] In some embodiments, the first electronic device may package the second input event into a data packet conforming to a transmission protocol format, and then send it to the second electronic device via a first connection (such as Wi-Fi Direct). The data of the input event may include the time of occurrence of the input event, the type of the input event, the code of the input event type, the value of the input event, etc.

[0308] For example, equipped with The system's PAD has its own input subsystem for unified management of input events. The uinput implementation based on this subsystem can easily simulate input events in userspace. The PAD can create virtual devices (such as a virtual mouse or keyboard) using uinput and configure their properties. Then, it writes the sequence of input events (inputevents) obtained from a first electronic device, such as a PC, to the / dev / uinput device file. This allows input to be performed on the PAD using a PC's mouse or keyboard. For detailed explanations, please refer to the aforementioned embodiments; they will not be repeated here.

[0309] S112, the second electronic device receives and responds to the second input event.

[0310] After receiving the second input event, the second electronic device can respond accordingly. For example, it can play music in response to a click command, drag an icon in response to a long press command, or display the character corresponding to the first key on the keyboard of the first electronic device.

[0311] Understandable, for reference Figure 11 , Figure 12In some embodiments, as shown, when the display interface layout of the second electronic device changes from a second display interface to a third display interface, the second cursor can change from a second position to a sixth position. The second and third display interfaces contain the same interface elements, but their resolutions differ. For example, when a tablet computer changes from landscape to portrait mode, the layout of the display interface changes, but the mouse pointer can point to the same icon before and after the interface change. Similarly, when a foldable screen changes from a folded state to an unfolded state, the size and layout of the display interface change, and the mouse pointer can be set to point to the same icon before and after the interface change.

[0312] In some embodiments, when the second cursor is displayed on the second display interface of the second electronic device, if the second electronic device is locked / powered off / black screen / restarted, the first cursor can be re-displayed at a certain position on the first display interface of the first electronic device, so as to facilitate the user to locate and operate the cursor.

[0313] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".

[0314] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. 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. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.

[0315] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0316] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for sharing an input device, characterized in that, The method includes: A first electronic device establishes a first connection with a second electronic device; the display area of ​​the first display interface of the first electronic device has a first resolution, and the display area of ​​the second display interface of the second electronic device has a second resolution; The first electronic device detects a first movement operation through its input device. The first movement operation is an operation that instructs the first cursor to move out of the first display interface of the first electronic device. The first electronic device sends a first message to the second electronic device through the first connection, and in response to the first movement operation, moves the first cursor to a virtual screen created by the first electronic device. The first message is used to notify the second electronic device to display a second cursor. The resolution of the virtual screen is the same as the second resolution. The first electronic device detects a second movement operation through its input device. The second movement operation is used to control the first cursor to move by a first offset on the virtual screen. The first electronic device sends a second message to the second electronic device through the first connection. The second message carries the first offset. The second message is used to notify the second electronic device to move the second cursor from the first position to the second position. The offset of the second position relative to the first position is the first offset. The position of the first cursor on the virtual screen after moving the first offset is the same as the second position of the second cursor. When the second electronic device displays the second cursor, after the first electronic device detects an input event through the input device, it maps the input event to an input event on the second electronic device and sends the mapped input event to the second electronic device. The second electronic device responds to the mapped input event, while the first electronic device does not respond to the input event detected by the input device.

2. The method according to claim 1, characterized in that, Also includes: The first electronic device detects a third movement operation, which is an operation that instructs the second cursor to move out of the second display interface of the second electronic device; The first electronic device displays the first cursor at a third position in the first display interface.

3. The method according to claim 2, characterized in that, The first position is located on the second boundary of the second display interface, and the third position is located on the first boundary of the first display interface.

4. The method according to claim 3, characterized in that, The first display interface has four boundaries, namely the top, bottom, left, and right boundaries of a display interface in a forward layout; the second display interface also has four boundaries, namely the top, bottom, left, and right boundaries of a display interface in a forward layout. The first boundary is the left boundary of the first display interface, and the second boundary is the right boundary of the second display interface; or The first boundary is the right boundary of the first display interface, and the second boundary is the left boundary of the second display interface; or The first boundary is the upper boundary of the first display interface, and the second boundary is the lower boundary of the second display interface; or The first boundary is the lower boundary of the first display interface, and the second boundary is the upper boundary of the second display interface.

5. The method according to claim 1, characterized in that, Also includes: When the second cursor is displayed on the second display interface, the first electronic device detects a first input event, wherein the first input event comes from an input operation collected by a first input device of the first electronic device, and the first input device includes one or more of the following: mouse, keyboard, handwriting tablet, camera, touchpad, scanner, stylus, remote control, and voice input device. The first electronic device maps the first input event to a second input event, wherein the first electronic device stores a first mapping table, which stores the mapping relationship between the first input event and the second input event; The first electronic device sends a third message to the second electronic device, the third message carrying the second input event.

6. The method according to any one of claims 1-5, characterized in that, The method further includes: After the first electronic device detects the first movement operation, the first electronic device determines the coordinates of the first position of the second cursor on the second display interface based on the coordinates of the first cursor on the first display interface, the first resolution of the first display interface, and the second resolution of the second display interface obtained from the second electronic device.

7. The method according to claim 6, characterized in that, The step of moving the first cursor to the virtual screen created by the first electronic device in response to the first movement operation includes: In response to the first movement operation, the first electronic device moves the first cursor to a fourth position on the virtual screen, the fourth position having the same coordinate values ​​as the first position; In response to the second movement operation, the first electronic device moves the first cursor from the fourth position to the fifth position, the fifth position having the same coordinate values ​​as the second position.

8. An electronic device, characterized in that, The electronic device includes: a communication device, a display screen, a memory, and a processor coupled to the memory, multiple application programs, and one or more programs; the memory stores computer-executable instructions, and when the processor executes the instructions, it causes the electronic device to perform the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and terminal for operating object between terminals

    CN101354639A

  • Mouse and keyboard sharing method and system

    CN103425408A

  • Method and device for switching mouse pointer among plurality of displays

    CN106293160A

  • Control right switching method and device, and KVM switching system

    CN109388257A