Method, device and input device for identifying an operating system based on an input device

By setting up a virtual keyboard program in the input device to generate specific key values ​​and determining the operating system based on the terminal's response, the problem of input devices being unable to automatically identify the operating system is solved, achieving efficient system identification and device adaptation.

CN122308626APending Publication Date: 2026-06-30SHENZHEN BASEUS TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN BASEUS TECH CO LTD
Filing Date
2024-12-30
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

In the existing technology, input devices cannot automatically identify the terminal operating system type, which causes the function to malfunction, especially when manual identification is incorrect, affecting the normal use of the device.

Method used

By pre-setting a virtual keyboard program in the input device, a first target key value is generated. This key value is supported by the first operating system but not by the second operating system. The value is then sent to the terminal, and the operating system type is determined based on the response information.

Benefits of technology

It enables accurate and automatic identification of the terminal operating system by the input device, improves identification efficiency, and ensures normal use of the device under different operating systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122308626A_ABST
    Figure CN122308626A_ABST
Patent Text Reader

Abstract

This disclosure provides a method, apparatus, and input device for identifying an operating system based on an input device. The method includes: generating a first target key value based on a pre-set virtual keyboard program, wherein the virtual keyboard program is used to indicate a corresponding virtual keyboard, the first target key value is the key value generated after a first target key on the virtual keyboard is pressed, and the first target key is a key supported by a first operating system but not by a second operating system; sending the first target key value to a terminal; and determining that the operating system on the terminal is the first operating system when a response information is received from the terminal for the first target key value, otherwise determining that the operating system on the terminal is the second operating system. This disclosure can accurately identify the type of operating system on the terminal, and the identification process is simpler and more efficient, thereby ensuring the normal use of the input device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of input device technology, and in particular to a method, apparatus, and input device for identifying an operating system based on an input device. Background Technology

[0002] Currently, with the development of computer technology, there is an increasing variety of input devices, such as mice, keyboards, and game controllers. More and more input devices can connect to terminals through interfaces to input data and information, enabling diverse input functions. However, there are also various operating systems on terminals, and different operating systems have varying levels of support for input devices. Therefore, accurately identifying the type of operating system on the terminal can ensure the normal use of input devices.

[0003] In related technologies, it is often necessary to manually determine the type of operating system on the terminal and then select an input device that matches that operating system type. However, the manual determination process is not only inefficient, but also cannot accurately identify the type of operating system in some special cases. In such cases, connecting the input device to the terminal will cause the input device to malfunction, thus affecting the normal use of the input device. Summary of the Invention

[0004] The main objective of this disclosure is to provide a method, apparatus, and input device for identifying the operating system based on the input device, which can accurately identify the type of operating system on the terminal and ensure the normal use of the input device.

[0005] To achieve the above objectives, a first aspect of this disclosure provides a method for identifying an operating system based on an input device, applied to an input device, the method comprising:

[0006] A first target key value is generated based on a pre-set virtual keyboard program, wherein the virtual keyboard program is used to indicate the corresponding virtual keyboard, the first target key value is the key value generated after a first target key in the virtual keyboard is pressed, and the first target key is a key supported by a first operating system but not supported by a second operating system;

[0007] Send the first target key value to the terminal;

[0008] When a response is received from the terminal in response to the first target key value, the operating system in the terminal is determined to be the first operating system; otherwise, the operating system in the terminal is determined to be the second operating system.

[0009] In some embodiments, generating the first target key value based on a pre-set virtual keyboard program includes:

[0010] From the virtual keyboard indicated by the pre-set virtual keyboard program, the key value generated after the scroll lock key is pressed is used as the first candidate target key value;

[0011] From the virtual keyboard indicated by the virtual keyboard program, the key value generated after the numeric keypad toggle switch is pressed is used as the second candidate target key value;

[0012] The first target key value is obtained based on at least one of the first candidate target key value and the second candidate target key value;

[0013] The scroll lock key and the numeric keypad on / off key are both keys supported by the first operating system but not by the second operating system.

[0014] In some embodiments, the step of determining that the operating system in the terminal is the first operating system when a response information returned by the terminal for the first target key value is received, and otherwise determining that the operating system in the terminal is the second operating system, includes:

[0015] If, within a preset time interval after the first target key value is sent, a response message is received from the terminal in response to the first target key value, the operating system in the terminal is determined to be the first operating system.

[0016] Otherwise, the operating system in the terminal is determined to be the second operating system.

[0017] In some embodiments, the method for identifying the operating system based on the input device further includes:

[0018] When the operating system in the terminal is the first operating system, after receiving a press instruction for any key in the virtual keyboard, a first key value conforming to the first operating system is generated based on the selected key, and the first key value is sent to the terminal.

[0019] When the operating system in the terminal is the second operating system, after receiving a press command for any key in the virtual keyboard, a second key value conforming to the second operating system is generated based on the selected key, and the second key value is sent to the terminal.

[0020] In some embodiments, the method for identifying the operating system based on the input device further includes:

[0021] When the operating system in the terminal is the first operating system, after receiving the instruction to press the target shortcut key, a first shortcut key value that conforms to the first operating system is generated based on the target shortcut key, and the first shortcut key value is sent to the terminal.

[0022] When the operating system in the terminal is the second operating system, after receiving the press instruction of the target shortcut key, a second shortcut key value that conforms to the second operating system is generated based on the target shortcut key, and the second shortcut key value is sent to the terminal;

[0023] The first shortcut key value is different from the second shortcut key value.

[0024] In some embodiments, generating the first target key value based on a pre-set virtual keyboard program includes:

[0025] A key descriptor is generated based on a pre-set virtual keyboard program, and the key descriptor is sent to the terminal for enumeration.

[0026] Once the enumeration operation is complete, a first target key value is generated based on the virtual keyboard program.

[0027] In some embodiments, determining that the operating system in the terminal is the second operating system includes:

[0028] A second target key value is generated based on a pre-set virtual keyboard program. The second target key value is the key value generated after a second target key in the virtual keyboard is pressed. The second target key is a key supported by both the first operating system and the second operating system.

[0029] Send the second target key value to the terminal;

[0030] When a response is received from the terminal in response to the second target key value, the operating system in the terminal is determined to be the second operating system.

[0031] To achieve the above objectives, a second aspect of this disclosure provides a method for identifying the operating system based on an input device, applied to a terminal. The method for identifying the operating system based on an input device includes:

[0032] The input device receives a first target key value, wherein the first target key value is generated by the input device based on a pre-set virtual keyboard program, the virtual keyboard program is used to indicate a corresponding virtual keyboard, the first target key value is a key value generated after a first target key in the virtual keyboard is pressed, and the first target key is a key supported by a first operating system but not supported by a second operating system.

[0033] When the terminal is operating the first operating system, a response message is generated based on the first target key value and sent to the input device so that the input device determines that the operating system in the terminal is the first operating system; otherwise, the input device determines that the operating system in the terminal is the second operating system.

[0034] To achieve the above objectives, a third aspect of this disclosure provides an apparatus for identifying an operating system based on an input device, applied to an input device, the apparatus comprising:

[0035] A key value generation module is used to generate a first target key value based on a pre-set virtual keyboard program, wherein the virtual keyboard program is used to indicate a corresponding virtual keyboard, the first target key value is the key value generated after a first target key in the virtual keyboard is pressed, and the first target key is a key supported by a first operating system but not supported by a second operating system;

[0036] A key-value sending module is used to send the first target key-value to the terminal;

[0037] The operating system verification module is used to determine that the operating system in the terminal is the first operating system when it receives the reply information returned by the terminal for the first target key value; otherwise, it determines that the operating system in the terminal is the second operating system.

[0038] To achieve the above objectives, a fourth aspect of this disclosure provides an apparatus for identifying an operating system based on an input device, applied to a terminal, the apparatus comprising:

[0039] A key value receiving module is used to receive a first target key value sent by an input device. The first target key value is generated based on a pre-set virtual keyboard program after the input device is connected to the terminal. The virtual keyboard program is used to indicate the corresponding virtual keyboard. The first target key value is a key value generated after a first target key in the virtual keyboard is pressed. The first target key is a key supported by a first operating system but not supported by a second operating system.

[0040] The key response module is configured to generate response information based on the first target key value and send the response information to the input device when the terminal is operating the first operating system, so that the input device determines that the operating system in the terminal is the first operating system; otherwise, the input device determines that the operating system in the terminal is the second operating system.

[0041] To achieve the above objectives, a fifth aspect of the present disclosure provides an input device, the input device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method described in the first aspect of the embodiments.

[0042] To achieve the above objectives, a sixth aspect of the present disclosure provides a terminal, the terminal including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method described in the second aspect of the present disclosure.

[0043] To achieve the above objectives, a seventh aspect of the present disclosure provides a storage medium, which is a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described in the first or second aspect embodiments described above.

[0044] The beneficial effects of the embodiments disclosed herein include:

[0045] The input device can generate a first target key value based on a pre-set virtual keyboard program. This virtual keyboard program instructs the corresponding virtual keyboard. The first target key value is the key value generated after pressing a first target key on the virtual keyboard. This first target key is a key supported by the first operating system but not by the second operating system. Therefore, when the input device sends the first target key value to the terminal, if the terminal is operating under the first operating system, it can respond to the first target key value from the input device because it supports the first target key. This response includes generating a reply message based on the first target key value and sending the reply message back to the input device. After this, the input device can determine that the operating system in the terminal is the first operating system. Otherwise, if the terminal is operating under the second operating system, it will not respond to the first target key value from the input device because it does not support the first target key, and therefore will not send a reply message. If the input device does not receive a reply message for the first target key value, it can determine that the operating system in the terminal is the second operating system. In the relevant comparison technology, the scheme of manually determining the type of operating system on the terminal is disclosed in this embodiment. By selecting a first target key that is supported by the first operating system but not by the second operating system, and sending the corresponding first target key value to the terminal, the type of operating system of the terminal can be determined according to the terminal's response. This can accurately identify the type of operating system on the terminal, and the identification process is simpler and more efficient, thereby ensuring the normal use of the input device. Attached Figure Description

[0046] Figure 1 This is a schematic diagram of the implementation environment provided in the embodiments of this disclosure;

[0047] Figure 2This is a flowchart illustrating a method for identifying the operating system based on an input device, as provided in an embodiment of this disclosure.

[0048] Figure 3 yes Figure 2 The flowchart further includes step S101;

[0049] Figure 4 yes Figure 2 The flowchart further includes step S103;

[0050] Figure 5 This is another schematic flowchart illustrating a method for identifying the operating system based on an input device, as provided in this disclosure embodiment.

[0051] Figure 6 This is yet another flowchart illustrating a method for identifying the operating system based on an input device, provided in this disclosure embodiment.

[0052] Figure 7 yes Figure 2 Another process diagram further includes step S101;

[0053] Figure 8 yes Figure 2 Another flowchart further includes step S103;

[0054] Figure 9 This is a flowchart illustrating a method for identifying the operating system based on an input device in a terminal, as provided in an embodiment of this disclosure.

[0055] Figure 10 This is a schematic diagram illustrating the process of an input device automatically recognizing a terminal operating system, provided in an embodiment of this disclosure.

[0056] Figure 11 This is a schematic diagram of the interaction messages between a computer host and an input device provided in an embodiment of this disclosure;

[0057] Figure 12 This is another schematic diagram of the interaction messages between the computer host and the input device provided in this embodiment of the disclosure;

[0058] Figure 13 This is a schematic diagram of the functional modules of the device for identifying the operating system based on the input device provided in the embodiments of this disclosure;

[0059] Figure 14 This is a schematic diagram of another functional module of the device for identifying the operating system based on the input device provided in this embodiment of the present disclosure;

[0060] Figure 15This is a schematic diagram of the hardware structure of the input device provided in an embodiment of this disclosure. Detailed Implementation

[0061] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this disclosure.

[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used herein is for the purpose of describing embodiments of this disclosure only and is not intended to be limiting of this disclosure.

[0063] First, let's analyze some of the terms used in this disclosure:

[0064] Microsoft Windows operating system, also known as Windows operating system, is an operating system developed by Microsoft based on a graphical user interface.

[0065] macOS is an operating system developed by Apple Inc. that runs on Macintosh computers.

[0066] Universal Serial Bus (USB) is a serial bus standard and a technical specification for input / output interfaces, which is widely used in information and communication products such as personal computers and mobile devices.

[0067] Universal Serial Bus (USB) input devices, also known as USB Human Interface Devices (HIDs), are devices that connect to a computer or other terminal devices via a USB interface to enable human-computer interaction. Examples include keyboards, mice, game controllers, graphics tablets, and hubs, which are used to input user actions into the computer. Other devices include monitors and printers, which are used to output the processed results to the user.

[0068] Report descriptors are used to describe data reports from HID devices. These reports contain device status information, such as mouse position and button status. Report descriptors enable the terminal to understand data from the HID device.

[0069] like Figure 1 As shown, Figure 1This is a schematic diagram of an implementation environment provided in this embodiment, including: an input device 101 and a terminal 102, wherein the input device 101 can be connected to the terminal 102 through an interface (such as a USB interface or other interfaces).

[0070] For example, when input device 101 can generate a first target key value based on a pre-set virtual keyboard program, wherein the virtual keyboard program is used to indicate the corresponding virtual keyboard, the first target key value is the key value generated after the first target key in the virtual keyboard is pressed, and the first target key is a key supported by the first operating system but not supported by the second operating system; input device 101 also sends the first target key value to terminal 102; when input device 101 receives the reply information returned by terminal 102 for the first target key value, it determines that the operating system in terminal 102 is the first operating system; otherwise, it determines that the operating system in terminal 102 is the second operating system.

[0071] Input device 101 may be a keyboard, mouse, game controller, handwriting tablet, hub, etc., but is not limited to these.

[0072] Terminal 102 can be a mobile phone, computer, smart voice interaction device, smart home appliance, vehicle terminal, aircraft, etc., but is not limited to these.

[0073] It should be noted that, Figure 1 The schematic diagram of the implementation environment shown is merely an example. The scenarios described in this disclosure are intended to more clearly illustrate the technical solutions of this disclosure and do not constitute a limitation on the technical solutions provided in this disclosure. As those skilled in the art will know, with the evolution of actual scenarios and the emergence of new business scenarios, the technical solutions provided in this disclosure are also applicable to similar technical problems.

[0074] like Figure 2 As shown, Figure 2 This is a flowchart illustrating a method for identifying the operating system based on an input device, provided in an embodiment of this disclosure. This method can be applied to the input device described in the above embodiments, and includes at least the following:

[0075] Step S101: Generate the first target key value based on the pre-set virtual keyboard program;

[0076] The virtual keyboard program is used to indicate the corresponding virtual keyboard. The first target key value is the key value generated after the first target key in the virtual keyboard is pressed. The first target key is a key that is supported by the first operating system but not by the second operating system.

[0077] Step S102: Send the first target key value to the terminal;

[0078] Step S103: When a reply message is received from the terminal for the first target key value, the operating system in the terminal is determined to be the first operating system; otherwise, the operating system in the terminal is determined to be the second operating system.

[0079] Regarding step S101 above, this embodiment of the disclosure pre-sets a virtual keyboard program in the input device. The virtual keyboard program is a software-level setting used to simulate a corresponding virtual keyboard. Its function and structure are similar to the software-level mapping of a physical keyboard used daily. Through this virtual keyboard program, the input device can know the operation logic corresponding to each key and the corresponding key value generation rules, etc. For example, just as each physical keyboard key generates a specific binary-coded key value when pressed in a computer system, each virtual key in the virtual keyboard program also has a corresponding preset key value.

[0080] The first operating system and the second operating system are two different types of operating systems. For example, the first operating system can be a Windows operating system, and the second operating system can be a macOS operating system. This disclosure uses Windows as the first operating system and macOS as the second operating system as an example for illustration. However, provided that the requirements of this disclosure are met, one of the first and second operating systems can also be a Linux operating system.

[0081] The first target button is a virtual button selected in this embodiment of the disclosure. It has a specific attribute: the button is supported by the first operating system but not by the second operating system. For example, in a comparison scenario between the Windows operating system (assumed to be the first operating system) and the macOS operating system (assumed to be the second operating system), some function buttons unique to the Windows operating system are not supported in the macOS operating system. Such a button can be selected as the first target button.

[0082] When the first target key is pressed in the virtual keyboard simulated by the virtual keyboard program, a corresponding first target key value is generated according to the pre-set key value generation rules. The first target key value is the key value generated after the first target key in the virtual keyboard is pressed; it can also be called a key report or key command. The first target key value is a key basis for subsequent determination of the terminal operating system type.

[0083] It should be noted that there are multiple possible times for generating the first target key value in this embodiment. For example, the first target key value can be generated after the input device is connected to the terminal. When the input device is connected to the terminal via wired or wireless means, the first target key value can be generated based on a pre-set virtual keyboard program to determine the operating system type of the terminal. Alternatively, when the input device is already connected to the terminal via wired or wireless means, the first target key value can be generated based on a pre-set virtual keyboard program after the input device responds to a certain trigger command. This trigger command can be generated after connecting to the terminal and enumerating with the terminal, or it can be input by the user, sent by the user to the input device or terminal, or it can be generated after the input device has been stationary for a period of time and then moved. This embodiment does not impose specific limitations on this.

[0084] Regarding step S102 above, after the input device generates the first target key value based on the virtual keyboard program, it will send this first target key value to the terminal through its interface connected to the terminal (such as a USB interface) according to a predetermined communication protocol. It should be noted that the communication process between the input device and the terminal follows the corresponding transmission standard to ensure that the first target key value can be accurately transmitted to the terminal; however, this embodiment does not impose specific limitations on this.

[0085] Regarding step S103 above, if the operating system in the terminal is the first operating system, since it supports the previously selected first target key, upon receiving the first target key value sent by the input device, the terminal can parse and process this key value according to its own processing mechanism, and generate corresponding response information based on the first target key value. Then, it sends this response information back to the input device through the interface connected to the input device. For example, the terminal can perform verification operations on the received first target key value, generate response information containing a confirmation flag or related processing results, and send it back to inform the input device that it has received and can process this key value.

[0086] Conversely, if the operating system in the terminal is a secondary operating system, because it does not support the primary target key, the terminal cannot process the primary target key value sent by the input device in the usual way, and therefore will not generate the corresponding response information and send it back to the input device.

[0087] It should be noted that the input device in this embodiment waits for a response from the terminal. Once a response is received, the input device can determine that the operating system in the terminal is the first operating system. If no response is received from the terminal for the first target key value within a certain waiting time (this waiting time can be a pre-set reasonable duration to avoid infinite waiting), the input device can determine that the operating system in the terminal is the second operating system. In this way, the automatic and accurate determination of the terminal's operating system type is achieved, laying the groundwork for the subsequent normal compatibility and use of the input device with the terminal.

[0088] In summary, through steps S101 to S103, the input device can generate a first target key value based on a pre-set virtual keyboard program. The virtual keyboard program is used to indicate the corresponding virtual keyboard. The first target key value is the key value generated after the first target key in the virtual keyboard is pressed. The first target key is a key supported by the first operating system but not by the second operating system. Therefore, when the input device sends the first target key value to the terminal, if the terminal is operating under the first operating system, the terminal can respond to the first target key value from the input device because it supports the first target key. This includes generating a response message based on the first target key value and sending the response message to the input device. After this, the input device can determine that the operating system in the terminal is the first operating system. Otherwise, if the terminal is operating under the second operating system, it will not respond to the first target key value from the input device because it does not support the first target key. Therefore, it will not send a response message to the input device. After not receiving the response message for the first target key value, the input device can determine that the operating system in the terminal is the second operating system. In the relevant comparison technology, the scheme of manually determining the type of operating system on the terminal is disclosed in this embodiment. By selecting a first target key that is supported by the first operating system but not by the second operating system, and sending the corresponding first target key value to the terminal, the type of operating system of the terminal can be determined according to the terminal's response. This can accurately identify the type of operating system on the terminal, and the identification process is simpler and more efficient, thereby ensuring the normal use of the input device.

[0089] like Figure 3 As shown, in some embodiments, step S101 above may further include the following steps:

[0090] Step S201: From the virtual keyboard indicated by the pre-set virtual keyboard program, the key value generated after the scroll lock key is pressed is taken as the first candidate target key value.

[0091] Step S202: From the virtual keyboard indicated by the virtual keyboard program, the key value generated after the numeric keypad on / off key is pressed is taken as the second candidate target key value.

[0092] Step S203: Obtain the first target key value based on at least one of the first candidate target key value and the second candidate target key value;

[0093] In the above steps, the target keys can be the Scroll Lock key and the Num Lock key, both of which are supported by the first operating system but not by the second. The Scroll Lock key is a function key on a computer keyboard. In some computer applications, it is mainly used to control text scrolling. Pressing this key changes certain keyboard functions; for example, in some text editing software, pressing the Scroll Lock key causes scrolling with the arrow keys to scroll by the entire page or screen instead of line by line. The Num Lock key is also an important key on the keyboard, mainly used to control the state of the numeric keypad. When this key is pressed, the numeric keypad can switch between numeric input mode and function key mode. In numeric input mode, the keys on the numeric keypad can input corresponding numbers; in function key mode, these keys have other functions.

[0094] In this embodiment, the first operating system is Windows, and the second operating system is macOS. In Windows, pressing the scroll lock key in text editing software like Word allows scrolling by arrow keys at the page or screen level, facilitating quick browsing of long documents. The numeric keypad toggle allows for easy switching between numeric input and function key modes, enabling users to quickly switch to numeric input mode for efficient input, especially in applications requiring large amounts of numeric data, such as spreadsheet editing. Conversely, macOS does not support the scroll lock key and numeric keypad toggle. Therefore, pressing these keys in a macOS terminal will result in no response.

[0095] This embodiment of the disclosure can select the key value generated after pressing the scroll lock key from a virtual keyboard indicated by a pre-set virtual keyboard program as the first candidate target key value. This step clarifies the operation of obtaining a specific key value, that is, simulating pressing the scroll lock key through the virtual keyboard program, then obtaining the key value generated by this operation, and defining it as the first candidate target key value. Similarly, this embodiment of the disclosure can also select the key value generated after pressing the numeric keypad toggle key from a virtual keyboard indicated by the virtual keyboard program as the second candidate target key value, that is, also simulating pressing the numeric keypad toggle key through the virtual keyboard program to obtain the corresponding key value as the second candidate target key value.

[0096] Finally, based on at least one of the first candidate target key value and the second candidate target key value, the first target key value can be obtained. It should be noted that the first target key value in this embodiment of the present disclosure can be either the first candidate target key value or the second candidate target key value, or a combination of both or the result of some processing. In this way, the accuracy and reliability of the identification can be increased, and misjudgment that may occur with a single key value can be avoided.

[0097] Therefore, since the scroll lock key and numeric keypad toggle are keys supported by Windows but not macOS, this clear difference between operating systems makes determining the operating system type using the first target key value generated by these two keys highly accurate. When the input device sends these first target key values ​​to the terminal, the terminal's response clearly reflects whether it supports these keys, thus accurately determining the operating system type and reducing the possibility of misjudgment.

[0098] Furthermore, the first operating system can also be a macOS operating system, and the second operating system can also be a Windows operating system. In this case, the target key can be a Command key, an Opt ion key, etc. This embodiment does not impose specific limitations on this.

[0099] like Figure 4 As shown, in some embodiments, step S103 above may further include the following steps:

[0100] Step S301: When a reply message is received from the terminal for the first target key value within a preset time interval after the first target key value is sent, the operating system in the terminal is determined to be the first operating system.

[0101] Step S302, otherwise, determine that the operating system in the terminal is the second operating system.

[0102] In the above steps, the preset time interval is a fixed period of time set after the input device sends the first target key value to the terminal, during which it waits for the terminal to return a response. For example, the preset time interval can be 100 milliseconds (ms). Setting a preset time interval can avoid misjudgments caused by accidental factors such as network latency and brief system lag, and prevent the input device from waiting for the terminal's response indefinitely, so that the entire operating system type identification process can be completed within a relatively fixed and predictable time.

[0103] Specifically, after the input device sends the first target key value to the terminal, a specific time range, or preset time interval, is set. This time interval is necessary because, under normal circumstances, if the terminal is running a first operating system (an operating system that supports the first target key), it will process the first target key value sent by the input device within a reasonable time and return the corresponding response information. If the input device successfully receives the response information from the terminal for the first target key value within this preset time interval, it means that the terminal has the capability to support the first target key corresponding to that first target key value, and therefore, the operating system in the terminal can be determined to be a first operating system.

[0104] Conversely, if the input device does not receive a response from the terminal after a preset time interval following the sending of the first target key value, it indicates that the terminal most likely does not support the first target key corresponding to that first target key value. This is because if the terminal supported it, it should have responded within the specified time according to the normal interaction process. Since there is no response, it can be inferred that the terminal is running a second operating system (an operating system that does not support the first target key), thus confirming that the operating system in the terminal is a second operating system.

[0105] It should be noted that the preset time interval is greater than the terminal's response speed. For example, if the average response time of the terminal after receiving any message and responding is 1ms, then in order to ensure that the input device has enough time to determine the terminal's operating system type and avoid misjudgment, the preset time interval set in this embodiment will be much greater than the terminal's response speed. Therefore, the preset time interval can be set to 100ms.

[0106] like Figure 5 As shown, in some embodiments, the method for identifying the operating system based on the input device in this disclosure may further include the following steps:

[0107] Step S401: When the operating system in the terminal is the first operating system, after receiving a press instruction for any key in the virtual keyboard, a first key value conforming to the first operating system is generated based on the selected key, and the first key value is sent to the terminal.

[0108] Step S402: When the operating system in the terminal is the second operating system, after receiving a press command for any key in the virtual keyboard, a second key value conforming to the second operating system is generated based on the selected key, and the second key value is sent to the terminal.

[0109] In the above steps, any key can be any function key, character key, or other key on the virtual keyboard. For example, it could be the letter "A", the Enter key, the arrow keys, etc., covering the entire range of keys simulated by the virtual keyboard.

[0110] When an input device receives a key press command on any key in the virtual keyboard, if the terminal's operating system is a first operating system, based on the received key press command, the input device will generate a first key value that conforms to the first operating system, according to pre-set rules and a method adapted to the first operating system. This generation process is based on the first operating system's requirements for the function and encoding corresponding to the key, to ensure that the generated first key value can be accurately recognized and processed by the first operating system. For example, different operating systems may have different internal encoding representations for the same key; under the first operating system, the correct key value must be generated according to its specifications.

[0111] After generating a valid first key value, the input device sends this first key value to the terminal. Upon receiving the first key value, the terminal can implement the corresponding function according to its own processing logic for these keys, such as displaying the corresponding characters in text editing software, executing corresponding operation commands, or implementing corresponding shortcut key functions, thereby ensuring that the input device can function normally in the operating system environment.

[0112] Similarly, upon receiving a key press command on any key in the virtual keyboard, if the terminal's operating system is a second operating system, the input device will generate a second key value conforming to the requirements of the second operating system based on the selected key. Because the second operating system has its own unique key value encoding standards and function mapping relationships, the generated second key value will differ from that under the first operating system. It will follow the second operating system's established processing method for each key to generate the corresponding key value.

[0113] After generating a valid second key value, the input device sends this key value to the terminal. The terminal can then process the key value according to its own operating system logic, enabling the input device to perform the corresponding input functions as much as possible in the second operating system environment, ensuring that the input device can be used normally under different operating systems.

[0114] like Figure 6 As shown, in some embodiments, the method for identifying the operating system based on the input device in this disclosure may further include the following steps:

[0115] Step S501: When the operating system in the terminal is the first operating system, after receiving the instruction to press the target shortcut key, a first shortcut key value that conforms to the first operating system is generated based on the target shortcut key, and the first shortcut key value is sent to the terminal.

[0116] Step S502: When the operating system in the terminal is the second operating system, after receiving the press instruction of the target shortcut key, a second shortcut key value that conforms to the second operating system is generated based on the target shortcut key, and the second shortcut key value is sent to the terminal.

[0117] The first shortcut key value is different from the second shortcut key value.

[0118] In the above steps, the target shortcut key is a pre-set or user-defined shortcut key. For example, the target shortcut key can be a combination of shortcut keys such as select all, create new, open, save, or some system-level shortcut keys. When the input device receives the user's operation command to press the target shortcut key, it will trigger the subsequent processing flow.

[0119] Because different operating systems handle shortcut keys and have different internal representations, for the first operating system, it is necessary to generate corresponding key values ​​according to its own specifications and protocols. When the operating system in the terminal is the first operating system, after receiving the press command of the target shortcut key, this embodiment of the present disclosure generates a first shortcut key value that conforms to the first operating system based on the target shortcut key. The first shortcut key value is a key value representation that the first operating system can recognize and process. Similarly, when the operating system in the terminal is the second operating system, after receiving the press command of the target shortcut key, this embodiment of the present disclosure generates a second shortcut key value that conforms to the second operating system based on the target shortcut key. The second shortcut key value is a key value representation that the second operating system can recognize and process.

[0120] Furthermore, if the first operating system is Windows and the second operating system is macOS, the following examples illustrate the shortcut key values ​​generated by different target shortcut keys under the two operating systems. Table 1 shows the implementation methods of different shortcut keys provided in this embodiment under different operating systems:

[0121]

[0122]

[0123] Table 1. Implementation methods of different shortcut keys under different operating systems

[0124] As can be seen from Table 1 above:

[0125] When the target shortcut is "Select All", it is the key value of the "Ctrl+A" key in Windows operating system, and the key value of the "Command+A" key in macOS operating system;

[0126] When the target shortcut is "New", it is the key value of the "Shift+Ctrl+N" key in the Windows operating system, and the key value of the "Shift+Command+N" key in the macOS operating system;

[0127] When the target shortcut is "Open", it is the key value of the "Ctrl+O" key in the Windows operating system, and the key value of the "Command+O" key in the macOS operating system;

[0128] When the target shortcut is "Save", it is the key value of the "Ctrl+S" key in the Windows operating system, and the key value of the "Command+S" key in the macOS operating system.

[0129] When the target shortcut is "Cut", it is the key value of the "Ctrl+X" key in Windows operating system, and the key value of the "Command+X" key in macOS operating system;

[0130] When the target shortcut is "copy", it is the key value of the "Ctrl+C" key in the Windows operating system, and the key value of the "Command+C" key in the macOS operating system;

[0131] When the target shortcut is "Paste", it is the key value of the "Ctrl+V" key in Windows operating system, and the key value of the "Command+V" key in macOS operating system;

[0132] When the target shortcut is "Undo", it is the key value of the "Ctrl+Z" key in Windows operating system, and the key value of the "Command+Z" key in macOS operating system;

[0133] When the target shortcut is "back", it is the key value of "Alt + left arrow" in Windows operating system, and the key value of "Command + left square bracket" in macOS operating system;

[0134] When the target shortcut is "Forward", it is the key value of "Alt + Right Arrow" in Windows operating system, and the key value of "Command + Right Square Bracket" in macOS operating system;

[0135] When the target shortcut is "lock screen", it is the key value of the "win+L" key in the Windows operating system, and the key value of the "Control+Command+Q" key in the macOS operating system;

[0136] When the target shortcut is "Return to Desktop", it is the key value of the "Win+D" key in Windows operating system, and the key value of the "Option+Command+H" key in macOS operating system;

[0137] When the target shortcut is "screenshot", it is the key value of "Win+Shift+S" in Windows operating system, and the key value of "Shift+Command+5" in macOS operating system;

[0138] When the target shortcut is "Open My Computer", it is the key value of the "Win+E" key in the Windows operating system, and the key value of the "Shift+Command+C" key in the macOS operating system.

[0139] When the target shortcut is "Switch window", it is the key value of the "win+Tab" key in the Windows operating system, and the key value of the "Command+Tab" key in the macOS operating system;

[0140] When the target shortcut is "Close Program", it is the key value of "Alt+F4" in Windows operating system, and the key value of "Option+Command+Esc" in macOS operating system;

[0141] When the target shortcut is "minimize window", it is the key value of "Windows + M" in Windows operating system, and the key value of "Option + Command + M" in macOS operating system.

[0142] Furthermore, the input device in this embodiment can be equipped with corresponding independent buttons or function buttons. By triggering these buttons, the input device can realize the function of the corresponding target shortcut key. For example, if the input device is a mouse with an independent button, and the set target shortcut key is "Save", when the user clicks the independent button, if the mouse confirms that the terminal's operating system is Windows, it can send the key value of the "Ctrl+S" key to the terminal. Conversely, if the mouse confirms that the terminal's operating system is macOS, it can send the key value of the "Command+S" key to the terminal. Based on this, the shortcut key function on the input device can be compatible with different operating systems.

[0143] like Figure 7 As shown, in some embodiments, step S101 may further include the following steps:

[0144] Step S601: Generate key descriptors based on the pre-set virtual keyboard program, send the key descriptors to the terminal, and perform enumeration operations with the terminal;

[0145] Step S602: After the enumeration operation is completed, the first target key value is generated based on the virtual keyboard program.

[0146] In the above steps, the first step is to generate key descriptors based on a pre-configured virtual keyboard program. A key descriptor is a detailed description of the keys on the virtual keyboard, containing various attributes such as the key's name, function, physical location, and logical mapping. The input device then sends the generated key descriptors to the terminal, allowing the terminal to have a comprehensive understanding of the input device's virtual keyboard for subsequent operations and processing. Furthermore, by sending the key descriptors, the terminal can obtain detailed information about the input device's virtual keyboard, providing foundational information for subsequent operations.

[0147] Enumeration is a process of information exchange and confirmation. The input device sends key descriptors to the terminal, which processes these descriptors, organizing, storing, or confirming the information to ensure consistency between the terminal and the input device regarding virtual keyboard information. Once the enumeration operation is complete, it means that the terminal and the input device have completed the initial communication and confirmation of the virtual keyboard information. The input device can then generate the first target key value according to the virtual keyboard program and perform subsequent operations to confirm the terminal operating system type. This embodiment does not impose specific limitations on this process.

[0148] like Figure 8 As shown, in some embodiments, step S103 may further include the following steps:

[0149] Step S701: Generate a second target key value based on a pre-set virtual keyboard program;

[0150] The second target key value is the key value generated after the second target key in the virtual keyboard is pressed. The second target key is a key that is supported by both the first and second operating systems.

[0151] Step S702: Send the second target key value to the terminal;

[0152] Step S703: When the reply information returned by the terminal for the second target key value is received, it is determined that the operating system in the terminal is the second operating system.

[0153] In the above steps, the second target key is a virtual key selected in this embodiment of the disclosure. It has specific attributes, namely, that the key is supported by both the first and second operating systems. For example, in a comparison scenario between the Windows operating system (assumed to be the first operating system) and the macOS operating system (assumed to be the second operating system), the second target key can be supported by both systems. Exemplarily, the second target key can be a numeric keypad or a 26-letter alphabet key, etc.

[0154] When the second target key is pressed in the virtual keyboard simulated by the virtual keyboard program, a corresponding second target key value is generated according to the pre-set key value generation rules. The second target key value is the key value generated after the second target key in the virtual keyboard is pressed; it can also be called a key report or key command. The second target key value is the basis for subsequent determination of whether the input device can communicate and connect normally with the terminal.

[0155] It should be noted that, in this embodiment of the present disclosure, the input device cannot yet confirm the operating system type of the terminal after not receiving a response from the terminal for the first target key value. This is because the terminal's failure to reply to the input device at this time could also be due to a problem with the communication connection between the terminal and the input device, such as a communication interruption. Therefore, this embodiment of the present disclosure needs to determine such a situation. Based on this, the input device in this embodiment of the present disclosure can send the second target key value to the terminal according to a predetermined communication protocol after not receiving a response from the terminal for the first target key value within a preset time interval.

[0156] If the communication connection between the terminal and the input device is normal, after receiving the second target key value, the terminal will respond to it. The terminal can parse and process this key value according to its own processing mechanism, and will generate corresponding reply information based on the second target key value. Then, through the interface connected to the input device, the terminal sends this reply information back to the input device, informing it that it has received and can process the key value. Therefore, when the input device receives the reply information returned by the terminal for the second target key value, it can determine that the previous lack of a reply information from the terminal for the first target key value was due to the terminal's operating system being a second operating system, not because of a problem with the communication connection between the terminal and the input device.

[0157] For example, if the input device still does not receive a response from the terminal for the second target key value, there are several possible scenarios. For instance, there might be a problem with the communication connection between the terminal and the input device. In this case, the input device can re-enumerate with the terminal and, after the re-enumeration, re-execute steps S101 to S103, including resending the first target key value to the terminal. Alternatively, the terminal can reload the input device's driver after the input device is reconnected to the terminal and then re-enumerate with the input device, followed by re-execute steps S101 to S103. This embodiment of the present disclosure does not impose specific limitations on these scenarios.

[0158] like Figure 9 As shown, Figure 9 This is another schematic flowchart illustrating a method for identifying the operating system based on an input device applied to a terminal, as provided in this disclosure embodiment. This method can be applied to the terminal described in the above embodiments, and includes at least the following:

[0159] Step S801: Receive the first target key value sent by the input device;

[0160] The first target key value is generated by the input device based on a pre-set virtual keyboard program. The virtual keyboard program is used to indicate the corresponding virtual keyboard. The first target key value is the key value generated after the first target key in the virtual keyboard is pressed. The first target key is a key that is supported by the first operating system but not by the second operating system.

[0161] In step S802, when the terminal is operating the first operating system, a reply message is generated based on the first target key value and sent to the input device so that the input device determines that the operating system in the terminal is the first operating system; otherwise, the input device determines that the operating system in the terminal is the second operating system.

[0162] Regarding step S801 above, this embodiment of the disclosure pre-sets a virtual keyboard program in the input device. The virtual keyboard program is a software-level setting used to simulate a corresponding virtual keyboard. Its function and structure are similar to the software-level mapping of a physical keyboard used daily. Through this virtual keyboard program, the input device can know the operation logic corresponding to each key and the corresponding key value generation rules, etc. For example, just as each physical keyboard key generates a specific binary-coded key value when pressed in a computer system, each virtual key in the virtual keyboard program also has a corresponding preset key value.

[0163] The first operating system and the second operating system are two different types of operating systems. For example, the first operating system can be a Windows operating system, and the second operating system can be a macOS operating system. This disclosure uses Windows as the first operating system and macOS as the second operating system as an example for illustration. However, provided that the requirements of this disclosure are met, one of the first and second operating systems can also be a Linux operating system.

[0164] The first target button is a virtual button selected in this embodiment of the disclosure. It has a specific attribute: the button is supported by the first operating system but not by the second operating system. For example, in a comparison scenario between the Windows operating system (assumed to be the first operating system) and the macOS operating system (assumed to be the second operating system), some function buttons unique to the Windows operating system are not supported in the macOS operating system. Such a button can be selected as the first target button.

[0165] When the first target key is pressed in the virtual keyboard simulated by the virtual keyboard program, the corresponding first target key value will be generated according to the pre-set key value generation rules. The first target key value is the key basis for subsequent determination of the terminal operating system type.

[0166] After generating the first target key value based on the virtual keyboard program, the input device sends this first target key value to the terminal through its interface (such as a USB interface) according to a predetermined communication protocol. It should be noted that the communication process between the input device and the terminal follows the corresponding transmission standards to ensure that the first target key value can be accurately transmitted to the terminal; however, this embodiment does not impose specific limitations on this.

[0167] Regarding step S802 above, if the operating system in the terminal is the first operating system, since it supports the previously selected first target key, upon receiving the first target key value sent by the input device, the terminal can parse and process this key value according to its own processing mechanism, and generate corresponding response information based on the first target key value. Then, it sends this response information back to the input device through the interface connected to the input device. For example, the terminal can perform verification operations on the received first target key value, generate response information containing a confirmation flag or related processing results, and send it back to inform the input device that it has received and can process this key value.

[0168] Conversely, if the operating system in the terminal is a secondary operating system, because it does not support the primary target key, the terminal cannot process the primary target key value sent by the input device in the usual way, and therefore will not generate the corresponding response information and send it back to the input device.

[0169] It should be noted that the input device in this embodiment waits for a response from the terminal. Once a response is received, the input device can determine that the operating system in the terminal is the first operating system. If no response is received from the terminal for the first target key value within a certain waiting time (this waiting time can be a pre-set reasonable duration to avoid infinite waiting), the input device can determine that the operating system in the terminal is the second operating system. In this way, the automatic and accurate determination of the terminal's operating system type is achieved, laying the groundwork for the subsequent normal compatibility and use of the input device with the terminal.

[0170] In summary, through steps S801 to S802, the input device can generate a first target key value based on a pre-set virtual keyboard program. The virtual keyboard program is used to indicate the corresponding virtual keyboard. The first target key value is the key value generated after pressing a first target key on the virtual keyboard. The first target key is a key supported by the first operating system but not by the second operating system. Therefore, when the input device sends the first target key value to the terminal, if the terminal is operating under the first operating system, the terminal can respond to the first target key value from the input device because it supports the first target key. This includes generating a response message based on the first target key value and sending the response message to the input device. After this response message is sent, the input device can determine that the operating system in the terminal is the first operating system. Otherwise, if the terminal is operating under the second operating system, it will not respond to the first target key value from the input device because it does not support the first target key, and therefore will not send a response message to the input device. After not receiving a response message for the first target key value, the input device can determine that the operating system in the terminal is the second operating system. In the relevant comparison technology, the scheme of manually determining the type of operating system on the terminal is disclosed in this embodiment. By selecting a first target key that is supported by the first operating system but not by the second operating system, and sending the corresponding first target key value to the terminal, the type of operating system of the terminal can be determined according to the terminal's response. This can accurately identify the type of operating system on the terminal, and the identification process is simpler and more efficient, thereby ensuring the normal use of the input device.

[0171] It should be noted that the method for identifying the operating system based on the input device applied to the terminal in this embodiment may have other steps to achieve the functions described above. Furthermore, the terminal can cooperate with the input device that executes the method for identifying the operating system based on the input device in the above embodiments, and this embodiment does not impose specific limitations on this.

[0172] The embodiments of this disclosure will now be fully described using a specific example.

[0173] like Figure 10 As shown, Figure 10 This is a schematic diagram illustrating the process of an input device automatically recognizing a terminal operating system according to an embodiment of this disclosure. The process includes:

[0174] (1) Begin;

[0175] (2) Check the enumeration;

[0176] The input device has a built-in virtual standard keyboard program. The report descriptor of the virtual keyboard includes a Scroll Lock indicator signal and a Num Lock indicator signal, which correspond to the scroll lock key and the numeric keypad on / off key, respectively.

[0177] Once the start of enumeration is detected, proceed to step (3); otherwise, exit the enumeration or return to step (2) to re-detect the enumeration.

[0178] (3) Begin enumeration;

[0179] When an input device is inserted into the terminal (taking a computer host as an example), the computer host can recognize a standard keyboard after receiving the enumeration information of the input device.

[0180] (4) Whether the enumeration is complete;

[0181] When the enumeration operation is completed, jump to step (5); otherwise, exit the enumeration or return to step (4) to re-execute the enumeration operation. After the enumeration operation is completed, the computer host can then interact further with the input device.

[0182] (5) Send the first target key value;

[0183] The virtual keyboard of the input device sends key reports, such as Scroll Lock or Num Lock key press and release reports, to the computer host. These Scroll Lock or Num Lock key press reports can be used as the first target key value, or target report, and sent to the computer host.

[0184] (6) Have you received a reply?

[0185] The input device detects whether it receives a response from the computer host, i.e., the Scroll Lock or Num Lock indicator signal. If the Scroll Lock or Num Lock indicator signal is received, it jumps to step (8); otherwise, it goes to step (7).

[0186] (7) Check if the wait exceeds 100ms;

[0187] The input device determines whether the preset time threshold of 100ms has been exceeded. If the Scroll Lock or Num Lock indicator signal is not received from the computer host after 100ms, the device jumps to step (9). If the time threshold of 100ms has not been exceeded, the device returns to step (6) to continue the determination.

[0188] (8) The terminal's operating system is Windows.

[0189] If the input device receives a Scroll Lock or Num Lock indicator signal from the computer host within 100ms, it is confirmed that the terminal's operating system is Windows (the first operating system).

[0190] like Figure 11 As shown, Figure 11 This is a schematic diagram of the interaction messages between the computer host and the input device provided in this embodiment. When the computer host of the Windows operating system receives the above-mentioned Scroll Lock key report, it will issue a corresponding Scroll Lock indicator signal command through the setreport command. Among them, "00 0047 00 00 00 00 00" in the first and fourth lines are the data in the Scroll Lock key report, "21 09 00 02 00 00 0100" in the second line is the command issued by the Windows operating system through the set report command to issue the corresponding Scroll Lock indicator signal, "04" in the third line is the status code of the input device after receiving the Scroll Lock indicator signal, and "00 00 0000 0000 00 00" in the fifth line is the key report issued after the Scroll Lock key is released.

[0191] like Figure 12 As shown, Figure 12This is another schematic diagram of the interaction message between the computer host and the input device provided in this embodiment. When the computer host of the Windows operating system receives the above-mentioned Num Lock key report, it will issue a corresponding Num Lock indicator signal command through the setreport command. Among them, "00 00 53 0000 00 00 00" in the first and fourth lines are the data in the Num Lock key report, "21 09 00 02 00 00 01 00" in the second line is the command issued by the Windows operating system through the set report command to issue the corresponding Num Lock indicator signal, "01" in the third line is the status code of the input device after receiving the Num Lock indicator signal, and "00 00 00 00 00 0000 00" in the fifth line is the key report issued after the Num Lock key is released.

[0192] (9) The terminal's operating system is macOS;

[0193] In particular, macOS operating systems do not support Num Lock and Scroll Lock keys. Even if a report of Num Lock or Scroll Lock is received, it will not send a set report command or indication signal. Therefore, if the input device does not receive a Scroll Lock or Num Lock indicator signal from the computer host within 100ms, it is confirmed that the terminal's operating system is macOS (the second operating system).

[0194] (10) End.

[0195] Please see Figure 13 , Figure 13 This is a functional block diagram of an input device-based operating system identification apparatus provided in an embodiment of the present disclosure. The apparatus can be applied to the input device described in the above embodiments. The apparatus includes:

[0196] The key value generation module 1301 is used to generate a first target key value based on a pre-set virtual keyboard program. The virtual keyboard program is used to indicate the corresponding virtual keyboard. The first target key value is the key value generated after the first target key in the virtual keyboard is pressed. The first target key is a key that is supported by the first operating system but not by the second operating system.

[0197] The key value sending module 1302 is used to send the first target key value to the terminal;

[0198] The operating system verification module 1303 is used to determine that the operating system in the terminal is the first operating system when it receives the reply information returned by the terminal for the first target key value; otherwise, it determines that the operating system in the terminal is the second operating system.

[0199] It should be noted that the device for identifying the operating system based on the input device in this embodiment can execute the method for identifying the operating system based on the input device executed in the above embodiments. The input device can generate a first target key value based on a pre-set virtual keyboard program. The virtual keyboard program is used to indicate the corresponding virtual keyboard. The first target key value is the key value generated after the first target key in the virtual keyboard is pressed. The first target key is a key supported by the first operating system but not by the second operating system. Therefore, when the input device sends the first target key value to the terminal, if the terminal is operating under the first operating system, the terminal can respond to the first target key value from the input device because it supports the first target key. This includes generating response information based on the first target key value and sending the response information to the input device. After this, the input device can determine that the operating system in the terminal is the first operating system. Otherwise, if the terminal is operating under the second operating system, it will not respond to the first target key value from the input device because it does not support the first target key. Therefore, it will not send response information to the input device. After not receiving the response information for the first target key value, the input device can determine that the operating system in the terminal is the second operating system. In the relevant comparison technology, the scheme of manually determining the type of operating system on the terminal is disclosed in this embodiment. By selecting a first target key that is supported by the first operating system but not by the second operating system, and sending the corresponding first target key value to the terminal, the type of operating system of the terminal can be determined according to the terminal's response. This can accurately identify the type of operating system on the terminal, and the identification process is simpler and more efficient, thereby ensuring the normal use of the input device.

[0200] The specific implementation of the device for identifying the operating system based on the input device is basically the same as the specific embodiment of the method for identifying the operating system based on the input device executed by the above-described input device, and will not be repeated here. Subject to meeting the requirements of the embodiments of this disclosure, the device for identifying the operating system based on the input device may also be provided with other functional modules to implement the method for identifying the operating system based on the input device in the above embodiments.

[0201] Please see Figure 14 , Figure 14 This is a functional block diagram of an input device-based operating system identification apparatus provided in an embodiment of the present disclosure. The apparatus can be applied to the terminal described in the above embodiments. The apparatus includes:

[0202] The key value receiving module 1401 is used to receive a first target key value sent by the input device. The first target key value is generated by the input device based on a pre-set virtual keyboard program. The virtual keyboard program is used to indicate the corresponding virtual keyboard. The first target key value is the key value generated after the first target key in the virtual keyboard is pressed. The first target key is a key that is supported by the first operating system but not by the second operating system.

[0203] The key response module 1402 is used to generate response information based on a first target key value and send the response information to the input device when the terminal is operating the first operating system, so that the input device determines that the operating system in the terminal is the first operating system; otherwise, the input device determines that the operating system in the terminal is the second operating system.

[0204] It should be noted that the device for identifying the operating system based on the input device in this embodiment can execute the method for identifying the operating system based on the input device executed by the terminal in the above embodiments. The input device can generate a first target key value based on a pre-set virtual keyboard program. The virtual keyboard program is used to indicate the corresponding virtual keyboard. The first target key value is the key value generated after the first target key in the virtual keyboard is pressed. The first target key is a key supported by the first operating system but not by the second operating system. Therefore, when the input device sends the first target key value to the terminal, if the terminal is operating under the first operating system, the terminal can respond to the first target key value from the input device because it supports the first target key. This includes generating response information based on the first target key value and sending the response information to the input device. After this, the input device can determine that the operating system in the terminal is the first operating system. Otherwise, if the terminal is operating under the second operating system, it will not respond to the first target key value from the input device because it does not support the first target key. Therefore, it will not send response information to the input device. After not receiving the response information for the first target key value, the input device can determine that the operating system in the terminal is the second operating system. In the relevant comparison technology, the scheme of manually determining the type of operating system on the terminal is disclosed in this embodiment. By selecting a first target key that is supported by the first operating system but not by the second operating system, and sending the corresponding first target key value to the terminal, the type of operating system of the terminal can be determined according to the terminal's response. This can accurately identify the type of operating system on the terminal, and the identification process is simpler and more efficient, thereby ensuring the normal use of the input device.

[0205] The specific implementation of the device for identifying the operating system based on the input device is basically the same as the specific embodiment of the method for identifying the operating system based on the input device executed by the terminal described above, and will not be repeated here. Subject to meeting the requirements of the embodiments of this disclosure, the device for identifying the operating system based on the input device may also be provided with other functional modules to implement the method for identifying the operating system based on the input device in the above embodiments.

[0206] This disclosure also provides an input device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method for identifying the operating system based on the input device. The input device can be a keyboard, mouse, game controller, handwriting tablet, hub, etc.

[0207] Please see Figure 15 , Figure 15 The hardware structure of an input device according to another embodiment is illustrated. The input device includes:

[0208] The processor 1501 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this disclosure.

[0209] The memory 1502 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1502 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1502 and is called and executed by the processor 1501 to execute the method for identifying the operating system based on the input device according to the embodiments of this disclosure.

[0210] The input / output interface 1503 is used to implement information input and output;

[0211] The communication interface 1504 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0212] Bus 1505 transmits information between various components of the device (e.g., processor 1501, memory 1502, input / output interface 1503, and communication interface 1504);

[0213] The processor 1501, memory 1502, input / output interface 1503 and communication interface 1504 are connected to each other within the device via bus 1505.

[0214] This disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method for operating system identification based on input device performed by the input device or terminal described above.

[0215] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0216] The embodiments described in this disclosure are for the purpose of more clearly illustrating the technical solutions of this disclosure and do not constitute a limitation on the technical solutions provided by this disclosure. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by this disclosure are also applicable to similar technical problems.

[0217] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this disclosure, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0218] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0219] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0220] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in this disclosure and the foregoing drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0221] It should be understood that in this disclosure, "at least one item" and "several" refer to one or more, and "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0222] In the embodiments provided in this disclosure, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

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

[0224] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0225] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0226] The preferred embodiments of the present disclosure have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present disclosure. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and spirit of the present disclosure shall be within the scope of the claims of the present disclosure.

Claims

1. A method for identifying an operating system based on an input device, characterized in that, Applied to input devices, the method for identifying the operating system based on the input device includes: A first target key value is generated based on a pre-set virtual keyboard program, wherein the virtual keyboard program is used to indicate the corresponding virtual keyboard, the first target key value is the key value generated after a first target key in the virtual keyboard is pressed, and the first target key is a key supported by a first operating system but not supported by a second operating system; Send the first target key value to the terminal; When a response is received from the terminal in response to the first target key value, the operating system in the terminal is determined to be the first operating system; otherwise, the operating system in the terminal is determined to be the second operating system.

2. The method of claim 1, wherein the input device is a mouse. The generation of the first target key value based on the pre-set virtual keyboard program includes: From the virtual keyboard indicated by the pre-set virtual keyboard program, the key value generated after the scroll lock key is pressed is used as the first candidate target key value; From the virtual keyboard indicated by the virtual keyboard program, the key value generated after the numeric keypad toggle switch is pressed is used as the second candidate target key value; The first target key value is obtained based on at least one of the first candidate target key value and the second candidate target key value; The scroll lock key and the numeric keypad on / off key are both keys supported by the first operating system but not by the second operating system.

3. The method of claim 1, wherein the input device is a mouse. The step of determining that the operating system in the terminal is the first operating system when a response information is received from the terminal for the first target key value, and otherwise determining that the operating system in the terminal is the second operating system, includes: If, within a preset time interval after the first target key value is sent, a response message is received from the terminal in response to the first target key value, the operating system in the terminal is determined to be the first operating system. Otherwise, the operating system in the terminal is determined to be the second operating system.

4. The method of claim 1, wherein the input device is a mouse. The method for identifying the operating system based on the input device further includes: When the operating system in the terminal is the first operating system, after receiving a press instruction for any key in the virtual keyboard, a first key value conforming to the first operating system is generated based on the selected key, and the first key value is sent to the terminal. When the operating system in the terminal is the second operating system, after receiving a press command for any key in the virtual keyboard, a second key value conforming to the second operating system is generated based on the selected key, and the second key value is sent to the terminal.

5. The method of claim 1 or 4, wherein, The method for identifying the operating system based on the input device further includes: When the operating system in the terminal is the first operating system, after receiving the instruction to press the target shortcut key, a first shortcut key value that conforms to the first operating system is generated based on the target shortcut key, and the first shortcut key value is sent to the terminal. When the operating system in the terminal is the second operating system, after receiving the press instruction of the target shortcut key, a second shortcut key value that conforms to the second operating system is generated based on the target shortcut key, and the second shortcut key value is sent to the terminal; The first shortcut key value is different from the second shortcut key value.

6. The method of claim 1, wherein the input device is a mouse. The generation of the first target key value based on the pre-set virtual keyboard program includes: A key descriptor is generated based on a pre-set virtual keyboard program, and the key descriptor is sent to the terminal for enumeration. Once the enumeration operation is complete, a first target key value is generated based on the virtual keyboard program.

7. The method of claim 1, wherein the input device is a mouse. Determining that the operating system in the terminal is the second operating system includes: A second target key value is generated based on a pre-set virtual keyboard program. The second target key value is the key value generated after a second target key in the virtual keyboard is pressed. The second target key is a key supported by both the first operating system and the second operating system. Send the second target key value to the terminal; When a response is received from the terminal in response to the second target key value, the operating system in the terminal is determined to be the second operating system.

8. A method of identifying an operating system based on an input device, the method comprising: Applied to a terminal, the method for identifying the operating system based on the input device includes: The input device receives a first target key value, wherein the first target key value is generated by the input device based on a pre-set virtual keyboard program, the virtual keyboard program is used to indicate a corresponding virtual keyboard, the first target key value is a key value generated after a first target key in the virtual keyboard is pressed, and the first target key is a key supported by a first operating system but not supported by a second operating system. When the terminal is operating the first operating system, a response message is generated based on the first target key value and sent to the input device so that the input device determines that the operating system in the terminal is the first operating system; otherwise, the input device determines that the operating system in the terminal is the second operating system.

9. A device for identifying an operating system based on an input device, characterized in that, The device for identifying the operating system based on the input device, applied to an input device, includes: A key value generation module is used to generate a first target key value based on a pre-set virtual keyboard program, wherein the virtual keyboard program is used to indicate a corresponding virtual keyboard, the first target key value is the key value generated after a first target key in the virtual keyboard is pressed, and the first target key is a key supported by a first operating system but not supported by a second operating system; A key-value sending module is used to send the first target key-value to the terminal; The operating system verification module is used to determine that the operating system in the terminal is the first operating system when it receives the reply information returned by the terminal for the first target key value; otherwise, it determines that the operating system in the terminal is the second operating system.

10. An input device, characterized by The input device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method for identifying an operating system based on an input device as described in any one of claims 1 to 7.