CN116954809B - Remote control methods, devices, systems and electronic devices based on Android devices - Google Patents
Remote control methods, devices, systems and electronic devices based on Android devices Download PDFInfo
- Publication number
- CN116954809B CN116954809B CN202311205122.XA CN202311205122A CN116954809B CN 116954809 B CN116954809 B CN 116954809B CN 202311205122 A CN202311205122 A CN 202311205122A CN 116954809 B CN116954809 B CN 116954809B
- Authority
- CN
- China
- Prior art keywords
- event
- mouse button
- type
- events
- mouse
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
- G06F9/452—Remote windowing, e.g. X-Window System, desktop virtualisation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4482—Procedural
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Position Input By Displaying (AREA)
Abstract
Description
技术领域Technical field
本发明涉及智能设备控制技术领域,尤其涉及一种基于安卓设备的远程控制方法、装置、系统及电子设备。The present invention relates to the technical field of intelligent device control, and in particular to a remote control method, device, system and electronic device based on Android devices.
背景技术Background technique
目前,Android主要面向于移动设备,其对于鼠标的支持是比较薄弱的。默认的情况下,外接鼠标的右键点击事件会被响应为按下返回键,应用页面会逐级返回上一页,最终返回到系统桌面。例如,对Android系统的平板移动设备外接鼠标,由于没有后续的鼠标抬起动作,无法向此平板移动设备发送右键释放(抬起)指令,会导致平板移动设备的操作系统右键粘连(按下无反应),出现右键操作不灵敏的现象,实则是由于抬起指令丢失导致的指令漏发。Currently, Android is mainly targeted at mobile devices, and its support for mice is relatively weak. By default, the right-click event of the external mouse will be responded to by pressing the return key, and the application page will return to the previous page step by step, and finally return to the system desktop. For example, if an external mouse is connected to a tablet mobile device under the Android system, since there is no subsequent mouse lift action, the right-click release (lift) command cannot be sent to the tablet mobile device, which will cause the operating system of the tablet mobile device to right-click to stick (press no action). reaction), the right-click operation is insensitive, which is actually caused by the missing command due to the loss of the lift command.
因此,如何解决现有技术因无法获取连续的鼠标右键事件,导致远程控制时出现右键粘连、右键操作不灵敏现象的问题,显得十分必要。Therefore, it is very necessary to solve the problem that the existing technology cannot obtain continuous right-click events of the mouse, which causes the right-click to stick and the right-click operation to be insensitive during remote control.
发明内容Contents of the invention
本发明提供一种基于安卓设备的远程控制方法、装置、系统及电子设备,用以克服现有技术因无法获取连续的鼠标右键事件,导致控制时出现右键粘连、右键操作不灵敏现象的缺陷,保证鼠标右键事件的完整性和连续性。The present invention provides a remote control method, device, system and electronic equipment based on Android devices to overcome the defects of the existing technology due to the inability to obtain continuous right-click events of the mouse, resulting in right-click adhesion and insensitive right-click operations during control. Ensure the integrity and continuity of mouse right-click events.
一方面,本发明提供一种基于安卓设备的远程控制方法,包括:基于信号源的界面信息,采集本地输入事件;确定所述本地输入事件为鼠标右键事件;当所述鼠标右键事件构成一个完整事件组时,将所述鼠标右键事件封装为协议数据包;根据所述协议数据包,控制所述信号源的界面;其中,所述完整事件组包括一个鼠标右键按下事件、一个鼠标右键抬起事件以及任意数量的鼠标移动事件。On the one hand, the present invention provides a remote control method based on an Android device, which includes: collecting local input events based on interface information of a signal source; determining that the local input event is a right mouse button event; when the right mouse button event constitutes a complete When forming an event group, the right mouse button event is encapsulated into a protocol data packet; the interface of the signal source is controlled according to the protocol data packet; wherein the complete event group includes a right mouse button press event, a right mouse button up event event and any number of mouse movement events.
进一步地,所述本地输入事件包括第一类事件和第二类事件,所述第一类事件包括键盘事件和所述鼠标右键事件,所述第二类事件包括触点事件和鼠标事件,所述鼠标事件包括所述鼠标右键事件和其他鼠标事件。Further, the local input event includes a first type of event and a second type of event, the first type of event includes a keyboard event and the right mouse button event, and the second type of event includes a touch point event and a mouse event, so The mouse events include the right mouse button event and other mouse events.
进一步地,所述采集本地输入事件,包括:基于安卓可组合界面中的第一监听修饰符,采集所述第一类事件;基于所述安卓可组合界面中的第二监听修饰符,采集所述第二类事件。Further, the collection of local input events includes: collecting the first type of events based on the first listening modifier in the Android composable interface; collecting all the events based on the second listening modifier in the Android composable interface. Describe the second type of event.
进一步地,所述采集本地输入事件,之前包括:向所述安卓可组合界面中增加新的监听修饰符,所述监听修饰符用于采集所述本地输入事件;其中,所述新的监听修饰符包括所述第一监听修饰符和所述第二监听修饰符。Further, the collecting local input events previously included: adding a new listening modifier to the Android composable interface, the listening modifier is used to collect the local input events; wherein, the new listening modifier The qualifier includes the first listening modifier and the second listening modifier.
进一步地,判定所述第一类事件为所述键盘事件或者所述鼠标右键事件,包括:在所述第一类事件的返回键值为KEYCODE_BACK的情况下,确定所述第一类事件为所述鼠标右键事件;在所述第一类事件的返回键值不为KEYCODE_BACK的情况下,确定所述第一类事件为所述键盘事件。Further, determining that the first type of event is the keyboard event or the right mouse button event includes: when the return key value of the first type of event is KEYCODE_BACK, determining that the first type of event is the KEYCODE_BACK event. The right mouse button event is described; when the return key value of the first type event is not KEYCODE_BACK, it is determined that the first type event is the keyboard event.
进一步地,判定所述第二类事件为所述触点事件或者所述鼠标事件,包括:在所述第二类事件的压值为零的情况下,确定所述第二类事件为所述鼠标事件;在所述第二类事件的压值不为零的情况下,确定所述第二类事件为所述触点事件。Further, determining that the second type of event is the contact event or the mouse event includes: when the pressure value of the second type of event is zero, determining that the second type of event is the Mouse event; when the pressure value of the second type of event is not zero, the second type of event is determined to be the contact event.
进一步地,判定所述第二类事件为所述鼠标右键事件或者所述其他鼠标事件,包括:在所述安卓可组合界面中的回调函数所对应回调变量的MotionEvent.BUTTON_BACK值为预设数值的情况下,确定所述第二类事件为所述鼠标右键事件;在所述安卓可组合界面中的回调函数所对应回调变量的MotionEvent.BUTTON_BACK值为预设数值以外的其他数值的情况下,确定所述第二类事件为所述其他鼠标事件。Further, determining that the second type of event is the right mouse button event or the other mouse event includes: the MotionEvent.BUTTON_BACK value of the callback variable corresponding to the callback function in the Android composable interface is a preset value. In this case, it is determined that the second type of event is the right mouse button event; in the case where the MotionEvent.BUTTON_BACK value of the callback variable corresponding to the callback function in the Android composable interface is a value other than the preset value, it is determined The second type of event is the other mouse event.
进一步地,所述确定所述第二类事件为所述鼠标右键事件,之后包括:丢弃所述鼠标右键事件。Further, determining that the second type of event is the right mouse button event includes: discarding the right mouse button event.
进一步地,所述确定所述第一类事件为所述鼠标右键事件,之后包括:采集所述鼠标右键按下事件,在所述安卓设备的操作界面对所述鼠标右键按下事件进行响应;采集所述鼠标右键抬起事件,在所述安卓设备的操作界面对所述鼠标右键抬起事件进行响应;所述安卓设备的操作界面在对所述鼠标右键按下事件进行响应之后,对所述鼠标右键抬起事件进行响应。Further, determining that the first type of event is the right mouse button event includes: collecting the right mouse button press event, and responding to the right mouse button press event on the operating interface of the Android device; Collect the right mouse button lift event, and respond to the right mouse button lift event on the operating interface of the Android device; after responding to the right mouse button press event, the operating interface of the Android device responds to the right mouse button press event. Respond to the above right mouse button lift event.
进一步地,所述确定所述第二类事件为所述其他鼠标事件,之后包括:采集所述鼠标移动事件,在所述安卓设备的操作界面对所述鼠标移动事件进行响应;所述安卓设备的操作界面在对所述鼠标右键按下事件进行响应之后,对所述鼠标移动事件进行响应;所述安卓设备的操作界面在对所述鼠标移动事件进行响应之后,对所述鼠标右键抬起事件进行响应。Further, determining that the second type of event is the other mouse event includes: collecting the mouse movement event, and responding to the mouse movement event on the operating interface of the Android device; the Android device The operation interface of the Android device responds to the mouse move event after responding to the mouse right button press event; the operation interface of the Android device responds to the mouse right button lift after responding to the mouse move event. Respond to events.
第二方面,本发明还提供一种基于安卓设备的远程控制装置,应用上述任一项所述的基于安卓设备的远程控制方法,所述装置包括:输入事件采集模块,用于基于信号源的界面信息,采集本地输入事件;输入事件分析模块,用于确定所述本地输入事件为鼠标右键事件;输入事件封装模块,用于当所述鼠标右键事件构成一个完整事件组时,将所述鼠标右键事件封装为协议数据包;远程控制模块,用于根据所述协议数据包,控制所述信号源的界面;其中,所述完整事件组包括一个鼠标右键按下事件、一个鼠标右键抬起事件以及任意数量的鼠标移动事件。In a second aspect, the present invention also provides a remote control device based on an Android device, applying any of the above remote control methods based on an Android device. The device includes: an input event collection module for Interface information, collect local input events; input event analysis module, used to determine that the local input event is a right mouse button event; input event encapsulation module, used to when the right mouse button event constitutes a complete event group, the mouse right button event The right-click event is encapsulated into a protocol data packet; a remote control module is used to control the interface of the signal source according to the protocol data packet; wherein the complete event group includes a right-click mouse button press event and a right mouse button lift-up event. and any number of mouse movement events.
第三方面,本发明还提供一种基于安卓设备的远程控制系统,包括:键鼠设备、安卓设备、采集控制端以及信号源;所述键鼠设备与所述安卓设备连接,所述键鼠设备用于输入本地输入事件给所述安卓设备;所述安卓设备与所述采集控制端连接,运行时采用上述任一项所述的基于安卓设备的远程控制方法,得到协议数据包;所述采集控制端与所述信号源连接,所述采集控制端用于将所述协议数据包传输给所述信号源,并将所述信号源的界面信息传输给所述安卓设备;所述信号源用于根据接收的所述协议数据包控制界面操作,并传输界面信息给所述采集控制端。In a third aspect, the present invention also provides a remote control system based on an Android device, including: a keyboard and mouse device, an Android device, a collection control terminal and a signal source; the keyboard and mouse device is connected to the Android device, and the keyboard and mouse device is connected to the Android device. The device is used to input local input events to the Android device; the Android device is connected to the collection control terminal, and during operation, the remote control method based on the Android device as described in any one of the above is used to obtain the protocol data packet; The acquisition control end is connected to the signal source, and the acquisition control end is used to transmit the protocol data packet to the signal source, and transmit the interface information of the signal source to the Android device; the signal source Used to control interface operations according to the received protocol data packet and transmit interface information to the collection control terminal.
第四方面,本发明还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任一种所述的基于安卓设备的远程控制方法。In a fourth aspect, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, any one of the above is implemented. The above-mentioned remote control method based on Android devices.
第五方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述的基于安卓设备的远程控制方法。In a fifth aspect, the present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the remote control method based on an Android device is implemented as described in any of the above. .
本发明提供的一种基于安卓设备的远程控制方法,通过基于信号源的界面信息,采集本地输入事件,并确定本地输入事件为鼠标右键事件,在鼠标右键事件足以构成一个完整事件组的情况下,将鼠标右键事件封装为协议数据包,进而根据协议数据包,控制信号源的界面。该方法通过对采集到的本地输入事件进行分析和识别,将包含鼠标右键按下事件和鼠标右键抬起事件的完整事件组封装为协议数据包,以根据该协议数据包控制信号源,该过程不需要专门设置Android系统,也不需要修改Android系统内核,信号源能够提取到完整且连续的鼠标右键事件组,克服了现有技术因无法获取连续的鼠标右键事件,导致远程控制时出现右键粘连、右键操作不灵敏现象的缺陷,保证了鼠标右键事件的完整性和连续性。The invention provides a remote control method based on an Android device, which collects local input events through interface information based on signal sources, and determines the local input event to be a right mouse button event. When the right mouse button event is enough to constitute a complete event group , encapsulate the right mouse button event into a protocol data packet, and then control the interface of the signal source according to the protocol data packet. This method analyzes and identifies the collected local input events, and encapsulates the complete event group including the right mouse button press event and the right mouse button lift event into a protocol data packet to control the signal source according to the protocol data packet. This process There is no need to specially set up the Android system or modify the Android system kernel. The signal source can extract a complete and continuous group of right mouse button events, which overcomes the inability of the existing technology to obtain continuous right mouse button events, which causes right button sticking during remote control. , the defect of insensitive right-click operation is ensured to ensure the integrity and continuity of the mouse right-click event.
附图说明Description of drawings
为了更清楚地说明本发明或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作以简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are of the present invention. For some embodiments of the invention, those of ordinary skill in the art can also obtain other drawings based on these drawings without exerting creative efforts.
图1为本发明提供的基于安卓设备的远程控制方法的主体交互示意图;Figure 1 is a schematic diagram of main body interaction of the remote control method based on Android devices provided by the present invention;
图2为本发明提供的基于安卓设备的远程控制方法的流程示意图;Figure 2 is a schematic flow chart of the remote control method based on Android devices provided by the present invention;
图3为本发明提供的基于安卓设备的远程控制方法的本地输入事件类别示意图;Figure 3 is a schematic diagram of local input event categories of the remote control method based on Android devices provided by the present invention;
图4为本发明提供的基于安卓设备的远程控制方法的整体处理示意图;Figure 4 is a schematic diagram of the overall processing of the remote control method based on Android devices provided by the present invention;
图5为本发明提供的基于安卓设备的远程控制方法的整体框架图;Figure 5 is an overall framework diagram of the remote control method based on Android devices provided by the present invention;
图6为本发明提供的基于安卓设备的远程控制装置的结构示意图;Figure 6 is a schematic structural diagram of a remote control device based on Android devices provided by the present invention;
图7为本发明提供的基于安卓设备的远程控制系统的系统示意图;Figure 7 is a system schematic diagram of the remote control system based on Android devices provided by the present invention;
图8为本发明提供的电子设备的结构示意图。Figure 8 is a schematic structural diagram of the electronic device provided by the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention more clear, the technical solutions in the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention. , not all examples. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
需要说明的是,目前Android主要面向于移动设备,对于鼠标的支持比较薄弱,在默认情况下,外接鼠标的右键点击事件会被响应为按下返回键,应用页面会逐级返回上一页,最终返回到系统桌面。It should be noted that currently Android is mainly oriented to mobile devices, and the support for mice is relatively weak. By default, the right-click event of an external mouse will be responded to by pressing the return key, and the application page will return to the previous page step by step. Finally return to the system desktop.
对此,在Android系统中,现有技术提供了改变鼠标右键响应事件的方式,即通过系统设置或通过修改Android系统内核重新构建系统来实现,但这种修改右键响应事件的方式不具普遍性,推广度极差。In this regard, in the Android system, the existing technology provides a way to change the right mouse button response event, that is, through system settings or by modifying the Android system kernel and rebuilding the system. However, this method of modifying the right mouse button response event is not universal. Very poor promotion.
而在Android Compose UI(安卓可组合界面框架)体系中,开发者可以通过修饰符监听提取到鼠标事件,但其无法兼顾到鼠标右键的所有事件。在通过Android设备的外接鼠标远程控制PC设备时,由于没有后续的鼠标抬起动作,无法向此PC设备发送右键释放指令,会导致PC操作系统右键粘连,出现右键操作不灵敏的现象,实则是由于抬起指令丢失导致的指令漏发。In the Android Compose UI (Android Composable Interface Framework) system, developers can monitor and extract mouse events through modifiers, but it cannot take into account all events of the right mouse button. When remotely controlling a PC device through an external mouse of an Android device, since there is no subsequent mouse lift action, the right-click release command cannot be sent to the PC device, which will cause the PC operating system's right-click to stick and make the right-click operation insensitive. In fact, The command is missed due to the loss of the lift command.
考虑及此,针对前述应用场景所涉及的问题,本发明提出了一种基于安卓设备的远程控制方法,该方法不需要对Android系统进行定制式的设置,也不用修改Android系统内核,重新构建系统,即可实现鼠标右键事件的连续性和完整性。Considering this, in view of the problems involved in the aforementioned application scenarios, the present invention proposes a remote control method based on Android devices. This method does not require customized settings for the Android system, nor does it require modifying the Android system kernel or rebuilding the system. , you can achieve the continuity and integrity of mouse right-click events.
此处,在对本发明所提供的基于安卓设备的远程控制方法进行详细描述之前,首先对该方法所涉及的执行主体进行简单描述。Here, before the detailed description of the remote control method based on Android devices provided by the present invention, the execution subjects involved in the method will first be briefly described.
图1示出了本发明所提供的基于安卓设备的远程控制方法的主体交互示意图。Figure 1 shows a schematic diagram of main body interaction of the remote control method based on Android devices provided by the present invention.
如图1所示,在执行本发明所提供的基于安卓设备的远程控制方法时,需要涉及四个主体,即键鼠设备、安卓设备、采集控制端以及信号源。As shown in Figure 1, when executing the remote control method based on an Android device provided by the present invention, four entities need to be involved, namely, a keyboard and mouse device, an Android device, a collection control terminal, and a signal source.
其中,键鼠设备与安卓设备连接,具体可以为物理连接(有线连接)或无线连接(例如蓝牙连接),在此不作具体限定。Among them, the connection between the keyboard and mouse device and the Android device can be a physical connection (wired connection) or a wireless connection (such as Bluetooth connection), which is not specifically limited here.
安卓设备与采集控制端之间,以及采集控制端与信号源之间存在网络连接。可以理解为,采集控制端在安卓设备与信号源之间起着中间桥梁的作用,以实现安卓设备与信号源之间的一个间接连接和信息交互。其中,采集控制端可以是一台独立的设备,也可以为集成到安卓设备上的一个模块。There is a network connection between the Android device and the acquisition control terminal, as well as between the acquisition control terminal and the signal source. It can be understood that the acquisition control terminal plays the role of an intermediate bridge between the Android device and the signal source to achieve an indirect connection and information interaction between the Android device and the signal source. Among them, the collection control terminal can be an independent device or a module integrated into an Android device.
在实际信息交互过程中,首先,建立好四者之间的连接,实现四者之间的连通。In the actual information interaction process, first, establish the connection between the four and realize the connectivity between the four.
其次,安卓设备存在控制需求时,会将控制需求转发至采集控制端,采集控制端在接收到安卓设备的控制需求(例如信号源的编号、IP地址)之后,会根据控制需求,获取对应信号源的相关信息(如信号源的界面信息),并将获取的相关信息转发给安卓设备。Secondly, when the Android device has control requirements, it will forward the control requirements to the collection control terminal. After receiving the control requirements of the Android device (such as the number and IP address of the signal source), the collection control terminal will obtain the corresponding signal according to the control requirements. Source related information (such as the interface information of the signal source), and forward the obtained related information to the Android device.
然后,安卓设备接收到信号源的相关信息之后,可以通过鼠标对信号源进行远程控制,此时,鼠标输入本地输入事件,安卓设备对本地输入事件进行采集和分析,在接收到完整的本地输入事件组之后,将其封装为协议数据包,并将其转发给采集控制端。Then, after the Android device receives relevant information about the signal source, it can remotely control the signal source through the mouse. At this time, the mouse inputs a local input event, and the Android device collects and analyzes the local input event. After receiving the complete local input After the event group is generated, it is encapsulated into a protocol data packet and forwarded to the collection control end.
紧接着,采集控制端接收到协议数据包之后,将其转发给对应的信号源,从而实现Android端(也即安卓设备)对远程PC端(也即信号源)的控制操作。Immediately after, after receiving the protocol data packet, the acquisition control terminal forwards it to the corresponding signal source, thereby realizing the control operation of the Android terminal (i.e., the Android device) on the remote PC terminal (i.e., the signal source).
与此同时,信号源还会将控制操作后的界面信息传输给安卓设备。At the same time, the signal source will also transmit the interface information after the control operation to the Android device.
在安卓设备,可以对其接收到的界面信息进行在线处理。例如,可以对信号源的文档内容进行修改,修改内容可以直接同步到对应的信号源。又例如,可以将信号源的界面截屏,并在截屏上进行信息标注,从而根据标注内容进行决策,标注内容可以不同步到对应的信号源。On Android devices, the interface information received can be processed online. For example, the document content of the signal source can be modified, and the modified content can be directly synchronized to the corresponding signal source. For another example, you can take a screenshot of the signal source interface and annotate information on the screenshot to make decisions based on the annotated content. The annotated content may not be synchronized to the corresponding signal source.
还需要说明的是,信号源可以为一个,也可以为多个,在此并不作具体限定。It should also be noted that the signal source may be one or multiple, and is not specifically limited here.
在上述内容的基础上,图2示出了本发明所提供的基于安卓设备的远程控制方法的流程示意图。具体地,如图2所示,该方法包括:Based on the above content, FIG. 2 shows a schematic flow chart of the remote control method based on Android devices provided by the present invention. Specifically, as shown in Figure 2, the method includes:
S210,基于信号源的界面信息,采集本地输入事件。S210: Collect local input events based on the interface information of the signal source.
需要说明的是,本发明所提供的基于安卓设备的远程控制方法以安卓设备为执行主体。It should be noted that the remote control method based on the Android device provided by the present invention uses the Android device as the execution subject.
可以理解的是,采集控制端基于安卓设备的控制需求,从对应的信号源获取相应的界面信息,并将其转发给安卓设备。It can be understood that based on the control requirements of the Android device, the acquisition control terminal obtains the corresponding interface information from the corresponding signal source and forwards it to the Android device.
安卓设备接收到信号源的界面信息之后,可以确定对信号源的界面信息的控制指令,从而对信号源的界面信息进行控制。After receiving the interface information of the signal source, the Android device can determine the control instructions for the interface information of the signal source, thereby controlling the interface information of the signal source.
在本步骤中,对信号源的界面信息进行控制,首先需要对本地输入事件进行采集,具体地,可以通过在Android系统的Compose组件(安卓可组合界面)中添加新的监听修饰符采集得到。In this step, to control the interface information of the signal source, you first need to collect local input events. Specifically, this can be collected by adding a new listening modifier in the Compose component of the Android system (Android composable interface).
通常来说,对远程的信号源进行控制,可以通过外接鼠标控制,也可以通过键盘(物理键盘或者屏幕软键盘)控制,还可以通过触点(触屏、手势)控制。Generally speaking, remote signal sources can be controlled through an external mouse, a keyboard (physical keyboard or on-screen soft keyboard), or contacts (touch screen, gestures).
因此,基于信号源的界面信息,采集本地输入事件,本地输入事件可能为鼠标事件,也可能为键盘事件,还可能为触点事件。Therefore, based on the interface information of the signal source, local input events are collected. The local input events may be mouse events, keyboard events, or contact events.
还需要说明的是,信号源的数量可以为一个,也可以同时为多个,在此不做具体限定。It should also be noted that the number of signal sources can be one or multiple at the same time, and is not specifically limited here.
在一个具体的实施例中,信号源有9个,同时接收9个信号源的界面信息,并对这9个信号源的界面信息进行控制。In a specific embodiment, there are 9 signal sources, the interface information of the 9 signal sources is received at the same time, and the interface information of the 9 signal sources is controlled.
需要说明的是,信号源的界面信息指在PC端的显示屏上显示的信号源的画面内容。该信号源的画面内容可以为例如一页文档、一张照片、播放中视频的一帧页面等等。It should be noted that the interface information of the signal source refers to the screen content of the signal source displayed on the display screen of the PC. The picture content of the signal source can be, for example, a page of a document, a photo, a frame of a video being played, etc.
S220,确定本地输入事件为鼠标右键事件。S220: Determine the local input event to be the right mouse button event.
可以理解的是,在步骤S210基于信号源的界面信息,采集本地输入事件的基础上,需要进一步判断采集得到的本地输入事件是否为鼠标右键事件,在确定本地输入事件为鼠标右键事件的情况下,执行在后步骤S230。It can be understood that, on the basis of collecting local input events based on the interface information of the signal source in step S210, it is necessary to further determine whether the collected local input event is a right mouse button event. In the case where it is determined that the local input event is a right mouse button event, , execute the subsequent step S230.
确定本地输入事件为鼠标右键事件,具体地,可以通过Android系统的Compose组件中设置不同修饰符的组合使用来实现。Determining that the local input event is a right mouse button event can be achieved by setting a combination of different modifiers in the Compose component of the Android system.
例如,可以采用IF语句,在本地输入事件的某一属性满足预设条件的情况下,确定本地输入事件为鼠标右键事件。For example, an IF statement can be used to determine that the local input event is a right mouse button event when a certain attribute of the local input event meets a preset condition.
其中,鼠标右键事件包括鼠标右键按下事件、鼠标右键抬起事件以及在上述按下事件和抬起事件之间进行的鼠标移动事件。The right mouse button event includes a right mouse button press event, a right mouse button lift event, and a mouse movement event between the press event and the lift event.
在一个具体的实施例中,通过本地输入事件对应的返回键值是否为KEYCODE_BACK(返回键值),来判断本地输入事件是否为鼠标右键事件。当本地输入事件对应的键值为KEYCODE_BACK时,确定本地输入事件确实为鼠标右键事件。In a specific embodiment, whether the local input event is a right mouse button event is determined by whether the return key value corresponding to the local input event is KEYCODE_BACK (return key value). When the key value corresponding to the local input event is KEYCODE_BACK, it is determined that the local input event is indeed a right mouse button event.
需要说明的是,此处KEYCODE_BACK可以为预先设定的一个或多个数值,例如,设定为数值1、3或5,在此不做具体限定。It should be noted that KEYCODE_BACK here can be one or more preset values, for example, set to a value of 1, 3 or 5, which is not specifically limited here.
还需要说明的是,当本地输入事件为其他事件类型时,如键盘事件和触点事件,现有的事件处理流程能够给较好地处理,故在此不作具体展开。It should also be noted that when the local input event is of other event types, such as keyboard events and contact events, the existing event processing flow can handle it better, so it will not be elaborated here.
S230,当鼠标右键事件构成一个完整事件组时,将鼠标右键事件封装为协议数据包。S230: When the right mouse button event constitutes a complete event group, the right mouse button event is encapsulated into a protocol data packet.
可以理解的是,在步骤S220确定本地输入事件为鼠标右键事件的基础上,进一步地,在采集到的鼠标右键事件足以构成一个完整事件组的情况下,对采集到的鼠标右键事件进行封装打包,得到相应的协议数据包。It can be understood that, on the basis of determining that the local input event is a right mouse button event in step S220, further, if the collected right mouse button events are enough to constitute a complete event group, the collected right mouse button events are encapsulated and packaged. , get the corresponding protocol data packet.
完整事件组指对一个本地输入事件的触发启动,以及该本地输入事件的触发终止的完整且连续的指令事件集合。其中,完整事件组包括一个鼠标右键按下事件、一个鼠标右键抬起事件以及任意数量的鼠标移动事件。A complete event group refers to a complete and continuous set of instruction events that trigger the triggering of a local input event and terminate the triggering of the local input event. Among them, the complete event group includes a right mouse button down event, a right mouse button up event, and any number of mouse movement events.
在一个具体的实施例中,首先采集到了一个鼠标右键按下事件,然后采集到了一个鼠标右键抬起事件,二者可以构成一个完整事件组,将该鼠标右键按下事件和鼠标右键抬起事件封装为一个协议数据包。In a specific embodiment, a right mouse button press event is first collected, and then a right mouse button lift event is collected. The two can form a complete event group, and the right mouse button press event and the right mouse button lift event are Encapsulated into a protocol data packet.
在另一个具体的实施例中,首先采集到了一个鼠标右键按下事件,并随后采集到了5个鼠标移动事件,以及一个鼠标右键抬起事件,此时亦就可以构成一个完整事件组,将一个鼠标右键按下事件、5个鼠标移动事件以及一个鼠标右键抬起事件封装为一个协议数据包。In another specific embodiment, a right mouse button press event is first collected, and then five mouse movement events and a right mouse button lift event are collected. At this time, a complete event group can be formed, and a The right mouse button press event, 5 mouse movement events and a right mouse button lift event are encapsulated into a protocol data packet.
也就是说,在完整事件组中,鼠标右键按下事件和鼠标右键抬起事件的数量是固定的,各为一个,但鼠标移动事件的数量是不固定的,可以为0个或多个。That is to say, in the complete event group, the number of right mouse button down events and right mouse button up events is fixed, one each, but the number of mouse movement events is not fixed and can be 0 or more.
以采集时间为衡量依据,在采集到鼠标右键按下事件之后,且采集到鼠标右键抬起事件之前,中间发生的鼠标移动事件都算在完整事件组内。Based on the collection time, after the right mouse button press event is collected and before the right mouse button lift event is collected, the mouse movement events that occur in between are included in the complete event group.
S240,根据协议数据包,控制信号源的界面。S240, according to the protocol data packet, controls the interface of the signal source.
可以理解的是,步骤S230在鼠标右键事件构成一个完整事件组的情况下,将鼠标右键事件封装为协议数据包,进一步地,将该协议数据包通过网络传输给待控制的一个或多个信号源,从而实现安卓设备对远程的信号源的控制操作。It can be understood that, in step S230, when the right mouse button event constitutes a complete event group, the right mouse button event is encapsulated into a protocol data packet, and further, the protocol data packet is transmitted to one or more signals to be controlled through the network. source, thereby realizing the control operation of the remote signal source by the Android device.
具体地,可以通过UDP(User Datagram Protocol,用户数据报协议)或WebSocket(一种在单个传输控制协议连接上进行全双工通信的协议)将协议数据包传输到对应的信号源。Specifically, the protocol data packet can be transmitted to the corresponding signal source through UDP (User Datagram Protocol) or WebSocket (a protocol for full-duplex communication on a single Transmission Control Protocol connection).
在本实施例中,通过基于信号源的界面信息,采集本地输入事件,并确定本地输入事件为鼠标右键事件,在鼠标右键事件足以构成一个完整事件组的情况下,将鼠标右键事件封装为协议数据包,进而根据协议数据包,控制信号源的界面。该方法通过对采集到的本地输入事件进行分析和识别,将包含鼠标右键按下事件和鼠标右键抬起事件的完整事件组封装为协议数据包,以根据该协议数据包控制信号源,该过程不需要专门设置Android系统,也不需要修改Android系统内核,信号源能够提取到完整且连续的鼠标右键事件组,克服了现有技术因无法获取连续的鼠标右键事件,导致远程控制时出现右键粘连、右键操作不灵敏现象的缺陷,保证了鼠标右键事件的完整性和连续性。In this embodiment, the local input event is collected through the interface information based on the signal source, and the local input event is determined to be the right mouse button event. When the right mouse button event is enough to form a complete event group, the right mouse button event is encapsulated into a protocol Data packets, and then control the interface of the signal source according to the protocol data packets. This method analyzes and identifies the collected local input events, and encapsulates the complete event group including the right mouse button press event and the right mouse button lift event into a protocol data packet to control the signal source according to the protocol data packet. This process There is no need to specially set up the Android system or modify the Android system kernel. The signal source can extract a complete and continuous group of right mouse button events, which overcomes the inability of the existing technology to obtain continuous right mouse button events, which causes right button sticking during remote control. , the defect of insensitive right-click operation is ensured to ensure the integrity and continuity of the mouse right-click event.
通过本发明,可以实现安卓设备对键盘事件、鼠标右键事件、触点事件的准确识别。上述各类事件可以依据用户的使用需求而交互使用。用户不用局限于某一种操控模式。增加用户与安卓设备的交互便利性。Through the present invention, the Android device can accurately identify keyboard events, mouse right-click events, and contact events. The above types of events can be used interactively according to the user's needs. Users are not limited to a certain control mode. Increase the convenience of interaction between users and Android devices.
在上述实施例的基础上,进一步地,图3示出了本发明所提供的基于安卓设备的远程控制方法的本地输入事件类别示意图。Based on the above embodiments, further, FIG. 3 shows a schematic diagram of local input event categories of the remote control method based on Android devices provided by the present invention.
如图3所示,本地输入事件包括第一类事件和第二类事件,第一类事件包括键盘事件和鼠标右键事件,第二类事件包括触点事件和鼠标事件,鼠标事件包括鼠标右键事件和其他鼠标事件。As shown in Figure 3, local input events include the first type of events and the second type of events. The first type of events include keyboard events and right mouse button events. The second type of events include touch events and mouse events. Mouse events include right mouse button events. and other mouse events.
可以理解的是,在本实施例中,将本地输入事件一次划分为两大类,即第一类事件和第二类事件。It can be understood that in this embodiment, local input events are divided into two major categories at a time, namely, first type events and second type events.
在第一类事件中,对其进行分析,可以将其细分为键盘事件和鼠标右键事件;在第二类事件中,对其进行分析,可以将其细分为触点事件和鼠标事件。In the first category of events, analyzing them can be subdivided into keyboard events and right mouse button events; in the second category of events, analyzing them can be subdivided into touch events and mouse events.
其中,需要说明的是,第二类事件中的鼠标事件不仅包括鼠标右键事件,还包括鼠标右键事件以外的其他鼠标事件,比如鼠标左键事件,滚动事件等。Among them, it should be noted that the mouse events in the second type of events include not only right mouse button events, but also other mouse events other than right mouse button events, such as left mouse button events, scrolling events, etc.
为了避免鼠标右键事件在采集到第一类事件、采集到第二类事件时发生同一事件的多次响应,因此只对第一类事件中的鼠标右键事件进行响应,对第二类事件中的鼠标右键事件(存在不连续现象)不做应答处理。具体地,当在第二类事件中分析得到,本地输入事件为鼠标右键事件时,为了避免冗余数据和鼠标右键事件组的不连续现象,直接将鼠标右键事件丢弃,不对其做任何处理。In order to avoid multiple responses to the same event when the right mouse button event is collected when the first type of event and the second type of event are collected, only the right mouse button event in the first type of event is responded to, and the right mouse button event in the second type of event is responded to. The right mouse button event (discontinuity exists) is not processed. Specifically, when it is analyzed in the second type of event that the local input event is a right mouse button event, in order to avoid redundant data and discontinuity in the right mouse button event group, the right mouse button event is directly discarded without any processing.
对于上述不同类型的本地输入事件,可以通过Compose组件中增加新的不同监听修饰符采集得到。For the above different types of local input events, they can be collected by adding new different listening modifiers in the Compose component.
展开地,采集本地输入事件,包括:基于Compose组件(安卓可组合界面)中的第一监听修饰符,采集第一类事件;基于Compose组件中的第二监听修饰符,采集第二类事件。Expand, collect local input events, including: collecting the first type of events based on the first listening modifier in the Compose component (Android composable interface); collecting the second type of events based on the second listening modifier in the Compose component.
在一个具体的实施例中,第一监听修饰符为Modifier.onKeyEvent修饰符,第二监听修饰符为Modifier.pointerInput修饰符。In a specific embodiment, the first listening modifier is Modifier.onKeyEvent modifier, and the second listening modifier is Modifier.pointerInput modifier.
也就是说,对于第一类事件,可以直接调用Compose组件中的Modifier.onKeyEvent修饰符(监听和处理按键输入事件的修饰符)进行采集,对于第一类事件的进一步分析和识别在后续实施例中展开。That is to say, for the first type of events, you can directly call the Modifier.onKeyEvent modifier (modifier for monitoring and processing key input events) in the Compose component for collection. Further analysis and identification of the first type of events will be provided in subsequent embodiments. Expand in.
对于第二类事件,可以直接调用Compose组件中的Modifier.pointerInput修饰符(监听和处理指针输入事件的修饰符)进行采集,对于第二类事件的进一步分析和识别在后续实施例中展开。For the second type of events, you can directly call the Modifier.pointerInput modifier (modifier for monitoring and processing pointer input events) in the Compose component to collect. Further analysis and identification of the second type of events will be carried out in subsequent embodiments.
需要说明的是,在默认情况下,Compose组件中的Modifier.onKeyEvent修饰符采集到的本地输入事件为键盘事件,Compose组件中的Modifier.pointerInput修饰符采集到的本地输入事件为触点事件。It should be noted that by default, the local input events collected by the Modifier.onKeyEvent modifier in the Compose component are keyboard events, and the local input events collected by the Modifier.pointerInput modifier in the Compose component are contact events.
也就是说,这两个修饰符在默认情况下均不为鼠标事件服务,如此,可以避免将鼠标右键按下事件被默认响应为按下返回键的情况。In other words, these two modifiers do not serve mouse events by default. In this way, you can avoid the situation where the right mouse button press event is responded to the return key by default.
还需要说明的是,在采集本地输入事件之前,安卓设备会向Compose组件中添加新的监听修饰符,例如上述第一监听修饰符和第二监听修饰符,以利用新增加的监听修饰符采集不同的本地输入事件。It should also be noted that before collecting local input events, the Android device will add new listening modifiers to the Compose component, such as the first listening modifier and the second listening modifier mentioned above, to take advantage of the newly added listening modifiers to collect Different local input events.
在本实施例中,通过将本地输入事件划分为第一类事件和第二类事件,第一类事件具体可以分为键盘事件和鼠标右键事件,第二类事件具体可以分为触点事件和鼠标事件,并分别采用Compose组件中的Modifier.onKeyEvent修饰符和Modifier.pointerInput修饰符,对第一类事件和第二类事件进行采集,进而对本地输入事件进行分析和识别,将包含鼠标右键按下事件和鼠标右键抬起事件的完整事件组封装为协议数据包,从而根据该协议数据包控制信号源,该过程不需要专门设置Android系统,也不需要修改Android系统内核,信号源能够提取到完整且连续的鼠标右键事件组,克服了现有技术因无法获取连续的鼠标右键事件,导致远程控制时出现右键粘连、右键操作不灵敏现象的缺陷,保证了鼠标右键事件的完整性和连续性。In this embodiment, local input events are divided into first-type events and second-type events. The first-type events can be specifically divided into keyboard events and mouse right-click events. The second-type events can be specifically divided into contact events and Mouse events, and use the Modifier.onKeyEvent modifier and Modifier.pointerInput modifier in the Compose component to collect the first type of events and the second type of events, and then analyze and identify the local input events, including the right mouse button press The complete event group of the down event and the right mouse button up event is encapsulated into a protocol data packet, thereby controlling the signal source according to the protocol data packet. This process does not require special setting of the Android system, nor does it need to modify the Android system kernel. The signal source can be extracted The complete and continuous right-click event group overcomes the shortcomings of the existing technology due to the inability to obtain continuous right-click events, resulting in right-click sticking and insensitive right-click operations during remote control, and ensures the integrity and continuity of right-click events. .
在上述实施例的基础上,进一步地,判定第一类事件为键盘事件或者鼠标右键事件,包括:在第一类事件的返回键值为KEYCODE_BACK的情况下,确定第一类事件为鼠标右键事件;在第一类事件的返回键值不为KEYCODE_BACK的情况下,确定第一类事件为键盘事件。On the basis of the above embodiment, further determining that the first type of event is a keyboard event or a right mouse button event includes: when the return key value of the first type of event is KEYCODE_BACK, determining that the first type of event is a right mouse button event. ; When the return key value of the first type of event is not KEYCODE_BACK, determine the first type of event to be a keyboard event.
可以理解的是,基于信号源的界面信息,采集本地输入事件,在此基础上,需要进一步地确定本地输入事件的事件类型,从而对不同的事件类型,按照对应的事件处理流程进行处理。It can be understood that local input events are collected based on the interface information of the signal source. On this basis, the event type of the local input event needs to be further determined, so that different event types are processed according to the corresponding event processing flow.
在本实施例中,主要是针对于第一类事件中键盘事件和鼠标右键事件的分析和识别。In this embodiment, the main focus is on the analysis and identification of keyboard events and right mouse button events in the first type of events.
展开地,如若本地输入事件是通过Compose组件中的Modifier.onKeyEvent修饰符采集得到,则可以初步判定本地输入事件属于第一类事件,而不属于第二类事件。Expanding, if the local input event is collected through the Modifier.onKeyEvent modifier in the Compose component, it can be preliminarily determined that the local input event belongs to the first type of event rather than the second type of event.
在确定本地输入事件为第一类事件的基础上,本地输入事件可能为键盘事件,也可能为鼠标右键事件,故需要对其做进一步的分析和识别。On the basis of determining that the local input event is the first type of event, the local input event may be a keyboard event or a right mouse button event, so further analysis and identification are required.
具体地,在第一类事件中,每一个键盘值均对应有相应的返回键值,鼠标右键事件对应的返回键值为KEYCODE_BACK,因此,可以通过第一类事件的返回键值,确定本地输入事件是否为鼠标右键事件。Specifically, in the first type of event, each keyboard value corresponds to a corresponding return key value. The return key value corresponding to the right mouse button event is KEYCODE_BACK. Therefore, the local input can be determined through the return key value of the first type of event. Whether the event is a right mouse button event.
也即,当第一类事件的返回键值为KEYCODE_BACK时,本地输入事件的类型为鼠标右键事件,进一步地,还可以通过第一类事件的type属性值判断当前鼠标右键事件为鼠标右键按下事件(KeyEventType.KeyDown),还是为鼠标右键抬起事件(KeyEventType.KeyUp)。That is, when the return key value of the first type of event is KEYCODE_BACK, the type of the local input event is the right mouse button event. Furthermore, the current right mouse button event can be judged to be the right mouse button press by the type attribute value of the first type of event. event (KeyEventType.KeyDown), or the right mouse button lift event (KeyEventType.KeyUp).
当第一类事件的返回键值不为KEYCODE_BACK的情况下,确定本地输入事件的类型为键盘事件,则按照键盘事件的处理流程进行处理。When the return key value of the first type of event is not KEYCODE_BACK, it is determined that the type of the local input event is a keyboard event, and the process is processed according to the keyboard event processing flow.
需要说明的是,第一类事件与第二类事件均包含有鼠标右键事件,但是,在第一类事件和第二类事件均分析得到鼠标右键事件时,第二类事件中分析得到的鼠标右键事件会直接被丢弃,不对其做任何操作,换言之,鼠标右键事件只有在第一类事件中被分析得到时,才会得到相应处理(将鼠标右键事件的指令分发到键盘事件的分支,并进行相应处理)。It should be noted that both the first type of event and the second type of event include the right mouse button event. However, when the first type of event and the second type of event both analyze and obtain the right mouse button event, the second type of event analyzes the mouse right button event. The right-click event will be discarded directly without any operation. In other words, the right-click event will only be processed accordingly when it is analyzed in the first type of event (distribute the instruction of the right-click event to the branch of the keyboard event, and handle accordingly).
在本实施例中,通过第一类事件的返回键值对第一类事件进行类型细分,在确定第一类事件的返回键值为KEYCODE_BACK的情况下,本地输入事件为鼠标右键事件,而在确定第一类事件的返回键值不为KEYCODE_BACK的情况下,本地输入事件为键盘事件,从而根据本地输入事件的实际事件类型,分别作不同的处理。在此过程中,将包含鼠标右键按下事件和鼠标右键抬起事件的完整事件组封装为协议数据包,从而根据该协议数据包控制信号源,该过程不需要专门设置Android系统,也不需要修改Android系统内核,信号源能够提取到完整且连续的鼠标右键事件组,克服了现有技术因无法获取连续的鼠标右键事件,导致远程控制时出现右键粘连、右键操作不灵敏现象的缺陷,保证了鼠标右键事件的完整性和连续性。In this embodiment, the first type of event is subdivided by the return key value of the first type of event. When it is determined that the return key value of the first type of event is KEYCODE_BACK, the local input event is a right mouse button event, and When it is determined that the return key value of the first type of event is not KEYCODE_BACK, the local input event is a keyboard event, so that different processing is performed according to the actual event type of the local input event. In this process, the complete event group including the right mouse button down event and the right mouse button up event is encapsulated into a protocol data packet, thereby controlling the signal source according to the protocol data packet. This process does not require special setting of the Android system, nor does it require Modifying the Android system kernel, the signal source can extract a complete and continuous right-click event group of the mouse, overcoming the shortcomings of the existing technology that cannot obtain continuous right-click events, resulting in right-click sticking and insensitive right-click operations during remote control, ensuring Improved the integrity and continuity of mouse right-click events.
在上述实施例的基础上,进一步地,判定第二类事件为触点事件或者鼠标事件,包括:在第二类事件的压值为零的情况下,确定第二类事件为鼠标事件;在第二类事件的压值不为零的情况下,确定第二类事件为触点事件。On the basis of the above embodiment, further determining that the second type of event is a touch event or a mouse event includes: when the pressure value of the second type of event is zero, determining that the second type of event is a mouse event; When the pressure value of the second type of event is not zero, the second type of event is determined to be a contact event.
可以理解的是,基于信号源的界面信息,采集本地输入事件,在此基础上,需要进一步地确定本地输入事件的事件类型,从而对不同的事件类型,按照对应的事件处理流程进行处理。It can be understood that local input events are collected based on the interface information of the signal source. On this basis, the event type of the local input event needs to be further determined, so that different event types are processed according to the corresponding event processing flow.
在本实施例中,主要是针对于第二类事件中触点事件和鼠标事件的分析和识别。In this embodiment, the focus is mainly on the analysis and identification of touch events and mouse events in the second type of events.
展开地,如若本地输入事件是通过Compose组件中的Modifier.pointerInput修饰符采集得到,则可以初步判定本地输入事件属于第二类事件,而不属于第一类事件。Expanding, if the local input event is collected through the Modifier.pointerInput modifier in the Compose component, it can be initially determined that the local input event belongs to the second type of event, not the first type of event.
在确定本地输入事件为第二类事件的基础上,本地输入事件可能为触点事件,也可能为鼠标右键事件,还可能为鼠标右键事件以外的其他鼠标事件,如鼠标左键事件,故需要对其做进一步的分析和识别。On the basis of determining that the local input event is the second type of event, the local input event may be a contact event, it may be a right mouse button event, or it may be other mouse events other than the right mouse button event, such as a left mouse button event, so it is necessary Perform further analysis and identification on it.
具体地,在第二类事件中,触点事件对应有压力值,而鼠标事件对应的压力值为零,考虑及此,本实施通过第二类事件的压值(调用第二类事件的属性值isBackPress),确定本地输入事件是否为鼠标事件。Specifically, in the second type of event, the contact event corresponds to a pressure value, and the pressure value corresponding to the mouse event is zero. Considering this, this implementation uses the pressure value of the second type of event (calling the attribute of the second type of event value isBackPress), determines whether the local input event is a mouse event.
也即,当第二类事件的压值为零时,本地输入事件的类型为鼠标事件,此时鼠标事件可能为鼠标右键事件,也可能为鼠标右键事件以外的其他鼠标事件。That is, when the pressure value of the second type of event is zero, the type of the local input event is a mouse event. At this time, the mouse event may be a right mouse button event or other mouse events other than the right mouse button event.
进一步地,判定第二类事件为鼠标右键事件或者其他鼠标事件,包括:在Compose组件中的回调函数所对应回调变量的MotionEvent.BUTTON_BACK值为预设数值的情况下,确定第二类事件为鼠标右键事件;在Compose组件中的回调函数所对应回调变量的MotionEvent.BUTTON_BACK值为预设数值以外的其他数值的情况下,确定第二类事件为其他鼠标事件。Further, determining that the second type of event is a right mouse button event or other mouse event includes: determining that the second type of event is a mouse when the MotionEvent.BUTTON_BACK value of the callback variable corresponding to the callback function in the Compose component is a preset value. Right-click event; when the MotionEvent.BUTTON_BACK value of the callback variable corresponding to the callback function in the Compose component is a value other than the preset value, the second type of event is determined to be other mouse events.
具体地,通过Compose组件(安卓可组合界面)中的回调函数(awaitPointerEventScope)的回调变量(event.buttons.isBackPressed)的MotionEvent.BUTTON_BACK值是否为预设数值,来判断鼠标事件的具体类型。Specifically, the specific type of mouse event is determined by whether the MotionEvent.BUTTON_BACK value of the callback variable (event.buttons.isBackPressed) of the callback function (awaitPointerEventScope) in the Compose component (Android composable interface) is a preset value.
在Compose组件中的回调函数(awaitPointerEventScope)的回调变量(event.buttons.isBackPressed)的MotionEvent.BUTTON_BACK值为预设数值的情况下,鼠标事件具体为鼠标右键事件,且该鼠标右键事件必然为鼠标右键按下事件。When the MotionEvent.BUTTON_BACK value of the callback variable (event.buttons.isBackPressed) of the callback function (awaitPointerEventScope) in the Compose component is the preset value, the mouse event is specifically a right mouse button event, and the right mouse button event must be a right mouse button Press event.
在Compose组件中的回调函数(awaitPointerEventScope)的回调变量(event.buttons.isBackPressed)的MotionEvent.BUTTON_BACK值为预设数值以外的其他数值的情况下,鼠标事件为鼠标右键事件以外的其他鼠标事件。When the MotionEvent.BUTTON_BACK value of the callback variable (event.buttons.isBackPressed) of the callback function (awaitPointerEventScope) in the Compose component is a value other than the preset value, the mouse event is a mouse event other than the right mouse button event.
其中,预设数值可以根据实际情况进行设置,在此不作具体限定。Among them, the preset value can be set according to the actual situation, and is not specifically limited here.
例如,在一个实施例中,预设数值为8。For example, in one embodiment, the preset value is 8.
当第二类事件的压值不为零时,说明本地输入事件的产生附带有压力值,本地输入事件为触点事件。When the pressure value of the second type of event is not zero, it means that the generation of the local input event is accompanied by a pressure value, and the local input event is a contact event.
同样需要说明的是,在第二类事件分析得到本地输入事件为鼠标右键事件时,第二类事件这一分支并不会对鼠标右键事件进行处理,而是直接丢弃该事件。It should also be noted that when the second type of event analysis finds that the local input event is a right mouse button event, the branch of the second type of event will not process the right mouse button event, but directly discard the event.
在本实施例中,通过第二类事件的压值对第二类事件进行类型细分,在确定第二类事件的压值为零的情况下,第二类事件为鼠标事件,而在确定第二类事件的压值不为零的情况下,第二类事件为触点事件,从而根据第二类事件的实际事件类型,分别作不同的处理。在此过程中,将包含鼠标右键按下事件和鼠标右键抬起事件的完整事件组封装为协议数据包,从而根据该协议数据包控制信号源,该过程不需要专门设置Android系统,也不需要修改Android系统内核,信号源能够提取到完整且连续的鼠标右键事件组,克服了现有技术因无法获取连续的鼠标右键事件,导致远程控制时出现右键粘连、右键操作不灵敏现象的缺陷,保证了鼠标右键事件的完整性和连续性。In this embodiment, the second type of event is subdivided by the pressure value of the second type of event. When it is determined that the pressure value of the second type of event is zero, the second type of event is a mouse event. When the pressure value of the second type of event is not zero, the second type of event is a contact event, so different processing is performed according to the actual event type of the second type of event. In this process, the complete event group including the right mouse button down event and the right mouse button up event is encapsulated into a protocol data packet, thereby controlling the signal source according to the protocol data packet. This process does not require special setting of the Android system, nor does it require Modifying the Android system kernel, the signal source can extract a complete and continuous right-click event group of the mouse, overcoming the shortcomings of the existing technology that cannot obtain continuous right-click events, resulting in right-click sticking and insensitive right-click operations during remote control, ensuring Improved the integrity and continuity of mouse right-click events.
在上述实施例的基础上,进一步地,确定第二类事件的压值为零,且基于Compose组件中的回调函数,确定本地输入事件为鼠标右键事件,之后包括:丢弃鼠标右键事件,不执行其他操作。Based on the above embodiment, it is further determined that the pressure value of the second type of event is zero, and based on the callback function in the Compose component, it is determined that the local input event is a right mouse button event, and then includes: discarding the right mouse button event and not executing Other operations.
可以理解的是,可以将上述第一类事件和第二类事件理解为两个分支,即第一分支和第二分支。It can be understood that the above-mentioned first type of event and second type of event can be understood as two branches, namely the first branch and the second branch.
其中,第一分支用于对鼠标右键事件和键盘事件进行处理,而第二分支用于对鼠标右键事件以外的其他鼠标事件,以及触点事件进行处理。Among them, the first branch is used to process right mouse button events and keyboard events, while the second branch is used to process other mouse events other than right mouse button events, as well as touch events.
当本地输入事件为鼠标右键事件时,第一分支和第二分支会同时采集到该事件,而由于第二分支无法获取到完整且持续的鼠标右键事件,同时也是避免冗余的数据重复传输,因此,当第二分支采集得到的本地输入事件为鼠标右键事件时,不对该鼠标右键事件做任何处理,而是直接将该事件在该分支中丢弃。When the local input event is a right mouse button event, the first branch and the second branch will collect the event at the same time. Since the second branch cannot obtain a complete and continuous right mouse button event, it also avoids redundant repeated data transmission. Therefore, when the local input event collected by the second branch is a right mouse button event, no processing is performed on the right mouse button event, but the event is directly discarded in this branch.
根据上述可知,当本地输入事件为鼠标右键事件时,仅由第一分支对其进行处理,第二分支直接将其丢弃,不执行任何其他操作。According to the above, when the local input event is a right mouse button event, it is only processed by the first branch, and the second branch directly discards it without performing any other operations.
在本实施例中,通过在第二类事件中分析得到本地输入事件为鼠标右键事件之后,在第二类事件中丢弃该鼠标右键事件,不对其执行任何其他操作,可以避免鼠标右键事件在第一类事件和第二类事件中被重复传输和处理,也即避免了冗余的数据重复传输,同时也避免了在第二类事件中鼠标右键事件组的不连续现象。In this embodiment, by analyzing the local input event as a right mouse button event in the second type of event, discarding the right mouse button event in the second type of event and not performing any other operations on it, it is possible to avoid the right mouse button event in the second type of event. The first type of event and the second type of event are repeatedly transmitted and processed, which avoids redundant data repeated transmission, and also avoids the discontinuity of the right mouse button event group in the second type of event.
另外,图4示出了本发明所提供的基于安卓设备的远程控制方法的整体处理示意图。In addition, FIG. 4 shows an overall processing schematic diagram of the remote control method based on Android devices provided by the present invention.
如图4所示,首先,采集本地输入事件,初步采集时,本地输入事件可能为第一类事件,也可能为第二类事件。As shown in Figure 4, first, local input events are collected. During preliminary collection, the local input events may be the first type of events or the second type of events.
在第一类事件这一分支中,可以通过第一类事件的返回键值,进一步判断本地输入事件为第一类事件中的键盘事件或鼠标右键事件。In the branch of the first type of event, the local input event can be further determined to be a keyboard event or a right mouse button event in the first type of event through the return key value of the first type of event.
具体地,当第一类事件的返回键值为KEYCODE_BACK时,本地输入事件为鼠标右键事件;当第一类事件的返回键值不为KEYCODE_BACK时,本地输入事件为键盘事件,从而,分别按照鼠标右键事件和键盘事件的处理流程执行后续步骤。Specifically, when the return key value of the first type of event is KEYCODE_BACK, the local input event is a mouse right-click event; when the return key value of the first type of event is not KEYCODE_BACK, the local input event is a keyboard event. Therefore, according to the mouse The processing flow of right-click events and keyboard events executes subsequent steps.
在第二类事件这一分支中,可以通过第二类事件的压值,进一步判断本地输入事件为第二类事件中的鼠标事件或触点事件。In the branch of the second type of event, the local input event can be further determined to be a mouse event or a touch event in the second type of event through the pressure value of the second type of event.
具体地,当第二类事件的压值为零时,本地输入事件为鼠标事件;当第二类事件的压值不为零时,本地输入事件为触点事件。Specifically, when the pressure value of the second type of event is zero, the local input event is a mouse event; when the pressure value of the second type of event is not zero, the local input event is a contact event.
需要说明的是,在第二类事件这一分支中,确定本地输入事件为鼠标右键的情况下,为了避免数据冗余重复传输,也是为了避免鼠标右键事件组的不连续,直接将其丢弃(该鼠标右键事件在第一类事件所属分支中被处理),不对其作任何处理。It should be noted that in the branch of the second type of event, when the local input event is determined to be the right mouse button, in order to avoid redundant repeated transmission of data and to avoid the discontinuity of the right mouse button event group, it is directly discarded ( The right mouse button event is processed in the branch to which the first type of event belongs), and no processing is performed on it.
对于鼠标右键事件以外的其他事件,现有技术能够对其做出较好的处理。For events other than the right mouse button event, the existing technology can handle them better.
对于鼠标右键事件,当采集到的鼠标右键事件足够构成一个完整事件组时,将采集到的鼠标右键事件封装为协议数据包,从而根据网络传输协议,将协议数据包传输到被控制的一个或多个信号源,从而实现对至少一个信号源的控制。For the right mouse button event, when the collected right mouse button events are enough to form a complete event group, the collected right mouse button events will be encapsulated into protocol data packets, and the protocol data packets will be transmitted to the controlled one or Multiple signal sources to control at least one signal source.
图5示出了本发明所提供的基于安卓设备的远程控制方法的整体框架图。Figure 5 shows the overall framework diagram of the remote control method based on Android devices provided by the present invention.
如图5所示,对于本地输入事件,主要包括对本地输入事件的采集和分析,采集可以通过Compose组件中的Modifier.onKeyEvent修饰符和Modifier.pointerInput修饰符实现,而分析,则可以通过本地输入事件的返回键值和压值实现。As shown in Figure 5, for local input events, it mainly includes the collection and analysis of local input events. Collection can be achieved through the Modifier.onKeyEvent modifier and Modifier.pointerInput modifier in the Compose component, and analysis can be achieved through local input The return key value and pressure value of the event are implemented.
对本地输入事件进行分析,得到其实际所属事件类型之后,按照对应的处理流程处理即可。After analyzing the local input event and obtaining its actual event type, it can be processed according to the corresponding processing flow.
针对于鼠标右键事件,在确定采集到的鼠标右键事件足以构成一个完整事件组的情况下,将采集到的鼠标右键事件进行协议封装,得到一个协议数据包,然后,根据网络传输协议进行数据发送,将该协议数据包传输至远程的至少一个信号源,从而实现安卓设备对至少一个信号源的控制。For the right mouse button event, when it is determined that the collected right mouse button event is enough to form a complete event group, the collected right mouse button event is encapsulated in the protocol to obtain a protocol data packet, and then the data is sent according to the network transmission protocol. , transmit the protocol data packet to at least one remote signal source, thereby enabling the Android device to control at least one signal source.
进一步地,确定第一类事件为鼠标右键事件之后,本发明提供的方法还包括:采集鼠标右键按下事件,在安卓设备的操作界面对鼠标右键按下事件进行响应。以及,采集鼠标右键抬起事件,在安卓设备的操作界面对鼠标右键抬起事件进行响应。以及,安卓设备的操作界面在对鼠标右键按下事件进行响应之后,再对鼠标右键抬起事件进行响应。由此可知,鼠标右键事件是基于按下触发的,基于抬起终止的,两者的顺序固定。Further, after determining that the first type of event is a right mouse button event, the method provided by the present invention further includes: collecting a right mouse button press event, and responding to the right mouse button press event on the operating interface of the Android device. And, collect the right mouse button lift event, and respond to the right mouse button lift event on the operating interface of the Android device. Also, after the operation interface of the Android device responds to the right mouse button press event, it then responds to the right mouse button lift event. It can be seen that the right mouse button event is triggered based on pressing and terminated based on lifting, and the order of the two is fixed.
再进一步地,确定第二类事件为其他鼠标事件之后,本发明提供的方法还包括:采集鼠标移动事件,在安卓设备的操作界面对鼠标移动事件进行响应。然后,安卓设备的操作界面在对鼠标右键按下事件进行响应之后,对鼠标移动事件进行响应。最后,安卓设备的操作界面在对鼠标移动事件进行响应之后,对鼠标右键抬起事件进行响应。由此可知,鼠标右键事件是基于按下触发的,基于抬起终止的,鼠标移动事件属于在上述按下和抬起之间的过程动作,三者的顺序固定。需要说明的是,鼠标右键的按下及抬起是分发到键盘事件分支中进行响应处理的;而鼠标的移动是分发到触点事件的分支中进行响应处理的,多种事件类型交互工作。Furthermore, after determining that the second type of event is another mouse event, the method provided by the present invention also includes: collecting mouse movement events, and responding to the mouse movement events on the operating interface of the Android device. Then, the operation interface of the Android device responds to the mouse movement event after responding to the mouse right button press event. Finally, after responding to the mouse movement event, the operating interface of the Android device responds to the right mouse button lift event. It can be seen that the right mouse button event is triggered based on pressing and terminated based on lifting. The mouse movement event belongs to the process action between the above-mentioned pressing and lifting, and the order of the three is fixed. It should be noted that the pressing and lifting of the right mouse button are distributed to the keyboard event branch for response processing; while the movement of the mouse is distributed to the contact event branch for response processing, and multiple event types work interactively.
图6示出了本发明所提供的基于安卓设备的远程控制装置的结构示意图。如图6所示,该装置包括:Figure 6 shows a schematic structural diagram of a remote control device based on an Android device provided by the present invention. As shown in Figure 6, the device includes:
输入事件采集模块610,用于基于信号源的界面信息,采集本地输入事件;输入事件分析模块620,用于确定所述本地输入事件为鼠标右键事件;输入事件封装模块630,用于当所述鼠标右键事件构成一个完整事件组时,将所述鼠标右键事件封装为协议数据包;远程控制模块640,用于根据所述协议数据包,控制所述信号源的界面;其中,所述完整事件组包括一个鼠标右键按下事件、一个鼠标右键抬起事件以及任意数量的鼠标移动事件。The input event collection module 610 is used to collect local input events based on the interface information of the signal source; the input event analysis module 620 is used to determine that the local input event is a mouse right-click event; the input event encapsulation module 630 is used to when the When the right mouse button event constitutes a complete event group, the right mouse button event is encapsulated into a protocol data packet; the remote control module 640 is used to control the interface of the signal source according to the protocol data packet; wherein, the complete event The group includes a right mouse button down event, a right mouse button up event, and any number of mouse move events.
在本实施例中,通过输入事件采集模块610基于信号源的界面信息,采集本地输入事件,输入事件分析模块620确定本地输入事件为鼠标右键事件,在输入事件封装模块630确定鼠标右键事件足以构成一个完整事件组的情况下,将鼠标右键事件封装为协议数据包,进而远程控制模块640根据协议数据包,控制信号源的界面。该装置通过对采集到的本地输入事件进行分析和识别,将包含鼠标右键按下事件和鼠标右键抬起事件的完整事件组封装为协议数据包,以根据该协议数据包控制信号源,该过程不需要专门设置Android系统,也不需要修改Android系统内核,信号源能够提取到完整且连续的鼠标右键事件组,克服了现有技术因无法获取连续的鼠标右键事件,导致远程控制时出现右键粘连、右键操作不灵敏现象的缺陷,保证了鼠标右键事件的完整性和连续性。In this embodiment, the input event collection module 610 collects local input events based on the interface information of the signal source. The input event analysis module 620 determines that the local input event is a right mouse button event. The input event encapsulation module 630 determines that the right mouse button event is sufficient to constitute In the case of a complete event group, the right mouse button event is encapsulated into a protocol data packet, and then the remote control module 640 controls the interface of the signal source according to the protocol data packet. The device analyzes and identifies the collected local input events, and encapsulates the complete event group including the right mouse button press event and the right mouse button lift event into a protocol data packet to control the signal source according to the protocol data packet. This process There is no need to specially set up the Android system or modify the Android system kernel. The signal source can extract a complete and continuous group of right mouse button events, which overcomes the inability of the existing technology to obtain continuous right mouse button events, which causes right button sticking during remote control. , the defect of insensitive right-click operation is ensured to ensure the integrity and continuity of the mouse right-click event.
需要说明的是,本实施例所提供的基于安卓设备的远程控制装置,与上文描述的基于安卓设备的远程控制方法,可相互对应参照,在此不再赘述。It should be noted that the remote control device based on the Android device provided in this embodiment and the remote control method based on the Android device described above can be referenced correspondingly and will not be described again here.
图7示出了本发明所提供的基于安卓设备的远程控制系统的系统示意图。如图7所示,该系统包括:Figure 7 shows a system schematic diagram of the remote control system based on Android devices provided by the present invention. As shown in Figure 7, the system includes:
键鼠设备710、安卓设备720、采集控制端730以及信号源740;所述键鼠设备710与安卓设备720连接,键鼠设备710用于输入本地输入事件给安卓设备720;安卓设备720与采集控制端730连接,运行时采用上述任一实施例所述的基于安卓设备的远程控制方法,得到协议数据包;采集控制端730与信号源740连接,采集控制端用于将协议数据包传输给信号源740,并将信号源740的界面信息传输给安卓设备720;信号源740用于根据接收的协议数据包控制界面操作,并传输界面信息给采集控制端730。Keyboard and mouse device 710, Android device 720, collection control terminal 730 and signal source 740; the keyboard and mouse device 710 is connected to the Android device 720, and the keyboard and mouse device 710 is used to input local input events to the Android device 720; the Android device 720 is connected to the collection The control terminal 730 is connected, and during operation, the remote control method based on the Android device described in any of the above embodiments is used to obtain the protocol data packet; the collection control terminal 730 is connected to the signal source 740, and the collection control terminal is used to transmit the protocol data packet to Signal source 740, and transmit the interface information of the signal source 740 to the Android device 720; the signal source 740 is used to control the interface operation according to the received protocol data packet, and transmit the interface information to the collection control terminal 730.
键鼠设备710包含鼠标、物理键盘、屏幕软键盘等。安卓设备720可以为安卓终端、安卓ipad或者安卓电脑,在此并不作具体限定。The keyboard and mouse device 710 includes a mouse, a physical keyboard, an on-screen soft keyboard, etc. The Android device 720 can be an Android terminal, an Android iPad or an Android computer, which is not specifically limited here.
信号源740可以为手机、电脑、摄像头或者监控器等,在此亦不作具体限定。The signal source 740 can be a mobile phone, a computer, a camera, a monitor, etc., and is not specifically limited here.
需要说明的是,本实施例中的信号源740的数量至少为1个,在此并不作具体限定。It should be noted that the number of signal sources 740 in this embodiment is at least one, which is not specifically limited here.
还需要说明的是,本实施例所提供的基于安卓设备的远程控制系统,与上文描述的基于安卓设备的远程控制方法可相互对应参照,在此亦不作具体展开。It should also be noted that the remote control system based on the Android device provided in this embodiment can correspond to the remote control method based on the Android device described above, and will not be elaborated here.
以及,该基于安卓设备的远程控制系统,与上文描述的基于安卓设备的远程控制方法,基于安卓设备的远程控制装置,均可以应用于教学的应用场景中,具体展开地,教师一端可以视为安卓设备720,学生端可以视为信号源740,教师端可以通过外接的鼠标,对至少一个学生端的作业、报告等进行批注、讲解,并将批注和讲解内容同步给学生端,从而学生端能够根据老师端的批注和讲解进行修改和调整。Moreover, the remote control system based on Android devices, the remote control method based on Android devices and the remote control device based on Android devices described above can be applied in teaching application scenarios. Specifically, the teacher can view For the Android device 720, the student terminal can be regarded as the signal source 740. The teacher terminal can annotate and explain the homework, reports, etc. of at least one student terminal through an external mouse, and synchronize the comments and explanation content to the student terminal, so that the student terminal Able to modify and adjust according to the teacher's comments and explanations.
在本实施例中,该系统通过对采集到的本地输入事件进行分析和识别,将包含鼠标右键按下事件和鼠标右键抬起事件的完整事件组封装为协议数据包,以根据该协议数据包控制信号源,该过程不需要专门设置Android系统,也不需要修改Android系统内核,信号源能够提取到完整且连续的鼠标右键事件组,克服了现有技术因无法获取连续的鼠标右键事件,导致远程控制时出现右键粘连、右键操作不灵敏现象的缺陷,保证了鼠标右键事件的完整性和连续性。In this embodiment, the system analyzes and identifies the collected local input events, and encapsulates the complete event group including the right mouse button press event and the right mouse button lift event into a protocol data packet, so as to use the protocol data packet according to the protocol data packet. Controlling the signal source does not require special settings for the Android system or modification of the Android system kernel. The signal source can extract a complete and continuous group of right mouse button events, overcoming the inability of the existing technology to obtain continuous right mouse button events. The defects of right-click sticking and insensitive right-click operation occur during remote control, ensuring the integrity and continuity of mouse right-click events.
图8示例了一种电子设备的实体结构示意图,如图8所示,该电子设备可以包括:处理器(processor)810、通信接口(communications Interface)820、存储器(memory)830和通信总线840,其中,处理器810,通信接口820,存储器830通过通信总线840完成相互间的通信。处理器810可以调用存储器830中的逻辑指令,以执行基于安卓设备的远程控制方法,该方法包括:基于信号源的界面信息,采集本地输入事件;确定所述本地输入事件为鼠标右键事件;当所述鼠标右键事件构成一个完整事件组时,将所述鼠标右键事件封装为协议数据包;根据所述协议数据包,控制所述信号源的界面;其中,所述完整事件组包括一个鼠标右键按下事件、一个鼠标右键抬起事件以及任意数量的鼠标移动事件。Figure 8 illustrates a schematic diagram of the physical structure of an electronic device. As shown in Figure 8, the electronic device may include: a processor (processor) 810, a communications interface (communications interface) 820, a memory (memory) 830 and a communication bus 840. Among them, the processor 810, the communication interface 820, and the memory 830 complete communication with each other through the communication bus 840. The processor 810 can call the logical instructions in the memory 830 to execute a remote control method based on the Android device. The method includes: collecting local input events based on the interface information of the signal source; determining that the local input event is a right mouse button event; when When the right mouse button event constitutes a complete event group, the right mouse button event is encapsulated into a protocol data packet; the interface of the signal source is controlled according to the protocol data packet; wherein the complete event group includes a right mouse button Press events, a right mouse button up event, and any number of mouse move events.
此外,上述的存储器830中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logical instructions in the memory 830 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code. .
另一方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各方法提供的基于安卓设备的远程控制方法,该方法包括:基于信号源的界面信息,采集本地输入事件;确定所述本地输入事件为鼠标右键事件;当所述鼠标右键事件构成一个完整事件组时,将所述鼠标右键事件封装为协议数据包;根据所述协议数据包,控制所述信号源的界面;其中,所述完整事件组包括一个鼠标右键按下事件、一个鼠标右键抬起事件以及任意数量的鼠标移动事件。On the other hand, the present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. The computer program is implemented when executed by the processor to execute the remote control method based on the Android device provided by the above methods. The method includes: collecting local input events based on interface information of a signal source; determining that the local input event is a right mouse button event; and when the right mouse button event constitutes a complete event group, encapsulating the right mouse button event into protocol data Package; control the interface of the signal source according to the protocol data package; wherein the complete event group includes a right mouse button press event, a right mouse button lift event and any number of mouse movement events.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative. The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in One location, or it can be distributed across multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Persons of ordinary skill in the art can understand and implement the method without any creative effort.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the part of the above technical solution that essentially contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disc, optical disk, etc., including a number of instructions to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or certain parts of the embodiments.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that it can still be used Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent substitutions are made to some of the technical features; however, these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (12)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311205122.XA CN116954809B (en) | 2023-09-19 | 2023-09-19 | Remote control methods, devices, systems and electronic devices based on Android devices |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311205122.XA CN116954809B (en) | 2023-09-19 | 2023-09-19 | Remote control methods, devices, systems and electronic devices based on Android devices |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN116954809A CN116954809A (en) | 2023-10-27 |
| CN116954809B true CN116954809B (en) | 2023-12-12 |
Family
ID=88449508
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311205122.XA Active CN116954809B (en) | 2023-09-19 | 2023-09-19 | Remote control methods, devices, systems and electronic devices based on Android devices |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116954809B (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103810121A (en) * | 2014-02-19 | 2014-05-21 | 福建升腾资讯有限公司 | Method for achieving mouse right key for windows virtual desktop connection under environment of Android system |
| CN114816585A (en) * | 2022-06-20 | 2022-07-29 | 北京麟卓信息科技有限公司 | Remote input redirection method across operating environments |
| CN115334375A (en) * | 2022-08-12 | 2022-11-11 | 福建天晴在线互动科技有限公司 | Optimization method and system for controlling An Zhuo Yuancheng |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10394346B2 (en) * | 2016-05-20 | 2019-08-27 | Citrix Systems, Inc. | Using a hardware mouse to operate a local application running on a mobile device |
-
2023
- 2023-09-19 CN CN202311205122.XA patent/CN116954809B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103810121A (en) * | 2014-02-19 | 2014-05-21 | 福建升腾资讯有限公司 | Method for achieving mouse right key for windows virtual desktop connection under environment of Android system |
| CN114816585A (en) * | 2022-06-20 | 2022-07-29 | 北京麟卓信息科技有限公司 | Remote input redirection method across operating environments |
| CN115334375A (en) * | 2022-08-12 | 2022-11-11 | 福建天晴在线互动科技有限公司 | Optimization method and system for controlling An Zhuo Yuancheng |
Also Published As
| Publication number | Publication date |
|---|---|
| CN116954809A (en) | 2023-10-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104866272B (en) | The control process system and method for monitor screen curtain wall | |
| EP4068064A1 (en) | File processing method, electronic apparatus, system, and storage medium | |
| CN108011951B (en) | Remote assistance method, device and system and electronic equipment | |
| CN103312814B (en) | Method for establishing VNC hidden channel between cloud management platform and virtual machine terminal user | |
| JP2002091914A (en) | Terminal device for computer network and operation history recording method | |
| US20190051147A1 (en) | Remote control method, apparatus, terminal device, and computer readable storage medium | |
| CN108027725B (en) | Method, apparatus and apparatus for instructing operation of terminal equipment | |
| CN105992066B (en) | Character input method and character input device applied to intelligent equipment | |
| WO2016019495A1 (en) | Terminal, server, and terminal control method | |
| CN112799891A (en) | iOS device test method, device, system, storage medium and computer device | |
| CN104065679B (en) | The method and client of a kind of remote desktop operation | |
| WO2019100898A1 (en) | Input operation processing method and processing device, and computer-readable storage medium | |
| WO2023098732A1 (en) | Cross-device interaction method and apparatus, electronic device, and storage medium | |
| WO2018086454A1 (en) | Page data processing method and device | |
| CN116954809B (en) | Remote control methods, devices, systems and electronic devices based on Android devices | |
| CN114979730B (en) | Screen transmission interaction method, device, computer equipment and storage medium | |
| CN102279654A (en) | Method for realizing keyboard in keyboard, video and mouse (KVM) all-in-one machine calling on screen display (OSD) menu of display | |
| WO2017167234A1 (en) | Method and apparatus for sharing mobile terminal content | |
| US10540136B2 (en) | Faster frame buffer rendering over a network | |
| CN115729665A (en) | Instruction transmission method, device, readable medium and electronic equipment | |
| WO2023173726A1 (en) | Interaction method and apparatus, and storage medium | |
| CN113891441A (en) | Network connection method and device and electronic equipment | |
| CN115068937A (en) | Game picture display adjusting method and device, storage medium and electronic equipment | |
| CN107491205B (en) | an all-in-one machine | |
| CN107390981B (en) | A global menu control method, device, device and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |