Response method and device for mouse operation in interlocking operation representation machine and storage medium
By managing the response method of multiple mouse devices in the interlocking operation representation machine, the problem that a single mouse configuration cannot meet the needs of multiple operators is solved, and efficient management of collaborative operation of multiple devices is realized, which is suitable for complex station application scenarios.
Patent Information
- Application Number
- CN202510162154.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-05-23
AI Technical Summary
In the computer interlocking system of railway stations, a single screen is difficult to meet the display needs of large stations, and when multiple operators operate at the same time, a single mouse configuration cannot meet the needs, resulting in the inability to effectively manage the coordinated operation of multiple mouse devices.
A response method for interlocking operation represents a mouse operation in a machine is provided to manage and optimize the processing of mouse events in a multi-window environment by connecting at least two mouse devices with unique identification. The method includes judging the display status of the sub-window, judging the operating status of the mouse, obtaining the display level of the window, judging the blocking status, setting the target mouse device, judging the coordinate position and hierarchy relationship, and finally responding to the mouse event.
It realizes the coordinated operation of multiple mouse devices on the same screen, improves the flexibility and efficiency of operation, can meet the needs of multiple operators and multiple operating equipment, and is suitable for complex station application scenarios.
Smart Images

Figure CN120029475A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to human-computer interaction technology, and in particular to a method, device and storage medium for responding to mouse operations in an interlocking operation display machine. Background Art
[0002] With the rapid development of railway technology, the traditional station relay interlocking system has been unable to adapt to the needs of current railway stations due to the complex configuration of relays and cables, and is gradually being replaced by computer interlocking systems. With the continuous commissioning of multi-directional and larger-scale stations and yards, the application scenarios of stations have become more complex, and the importance of computer interlocking systems in railway systems has become increasingly prominent. However, the development of an interlocking system that not only meets the logic of the interlocking circuit but also can adapt to the interweaving and concurrency of multiple scenarios faces huge challenges.
[0003] The interlocking operation display machine serves as the human-computer interaction interface in the station computer interlocking system. In general, a single screen can meet the display and operation requirements of the station yard. However, for larger stations, a single screen can no longer meet the station display requirements, and dual or multiple screens are required. In addition, when multiple operation areas are set up in the station yard and two or more operators are required to operate at the same time, the configuration of a single mouse in the operating system can no longer meet the needs. Therefore, how to solve the problem of multiple operators and multiple operating devices is particularly critical. In actual use, there is an urgent need for a solution that can meet the needs of multiple operators using mouse devices to operate the interlocking operation display machine at the same time. Summary of the invention
[0004] Embodiments of the present application provide a method, device and storage medium for responding to mouse operations in an interlocking operation display machine.
[0005] A method for responding to mouse operations in an interlocking operation display machine, wherein the interlocking operation display machine is connected to at least two mouse devices, wherein each mouse device has a unique identifier and can operate the human-computer interaction interface of the interlocking operation display machine, wherein: When multiple mouse devices control the same human-computer interaction interface, the human-computer interaction interface is currently provided with sub-windows triggered by mouse operations, wherein the following operations are performed on each sub-window, including: Step 1: Determine whether the sub-window is displayed in the human-computer interaction interface, and when the sub-window is displayed in the human-computer interaction interface, execute step 2; Step 2: Determine whether the sub-window is a new window that is recently opened in response to a mouse operation; If the sub-window is a new window that is recently opened in response to a mouse operation, execute step 3; otherwise, execute step 6; Step 3: Obtain the window display level of the sub-window in the management area of each mouse device, and execute step 4; Step 4: Determine whether the operation state of the sub-window is blocked; If the operation state of the sub-window is blocked, execute step 5; otherwise, execute step 6; Step 5: Set the operation state of the mouse device in the sub-window to blocked, obtain the target mouse device, and execute step 6; Step 6: Determine whether each mouse device meets a preset condition, wherein the preset condition is that the operation state of the mouse device is not blocked; or the preset condition is that the operation state of the mouse device is blocked and the sub-window is a window that triggers the blocking of the mouse device; the mouse device that meets the preset condition is taken as the target mouse device, and step 7 is executed; Step 7: Determine whether the coordinates of the target mouse device are located in the sub-window, and if the coordinates of the target mouse device are located in the sub-window, execute step 8; Step 8: Determine whether the sub-window is located at the top layer in the management area of the target mouse device, and if the sub-window is a window located at the top layer, execute step 9; Step 9: Respond to the mouse event triggered by the target mouse device.
[0006] A device for responding to mouse operations in an interlocking operation display machine comprises a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to execute the method described above.
[0007] A storage medium stores a computer program, wherein the computer program is configured to execute the method described above when running.
[0008] The technical solution provided by the embodiment of the present application can manage and optimize the processing of mouse events in a multi-window environment when multiple mouse devices control the same human-computer interaction interface.
[0009] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by implementing the present application. Other advantages of the present application can be realized and obtained by the schemes described in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The accompanying drawings are used to provide an understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0011] Figure 1 A schematic diagram of managing mouse operations in an interlocking operation display machine provided in an embodiment of the present application; Figure 2 A flowchart of a method for responding to mouse operations in an interlocking operation display machine provided in an embodiment of the present application. DETAILED DESCRIPTION
[0012] The present application describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present application. Although many possible feature combinations are shown in the drawings and discussed in the specific embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.
[0013] The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in the present application may also be combined with any conventional features or elements to form a unique invention scheme. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme. Therefore, it should be understood that any feature shown and / or discussed in the present application may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other restrictions. In addition, various modifications and changes may be made within the scope of protection of the attached claims.
[0014] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps of the specific order described. As will be understood by those of ordinary skill in the art, other sequences of steps are also possible. Therefore, the specific sequence of the steps set forth in the specification should not be interpreted as a limitation to the claims. In addition, the claims for the method and / or process should not be limited to the steps of performing them in the order written, and those skilled in the art can easily understand that these sequences can be changed and still remain within the spirit and scope of the embodiments of the present application.
[0015] The embodiment of the present application provides an interlocking operation display machine, connected to at least two mice, wherein each mouse has a unique identifier and can operate the human-computer interaction interface area of the interlocking operation display machine. The human-computer interaction interface uses a multi-window form for interaction. For example, the interlocking operation display machine is operated using a windows system.
[0016] In addition, the interlocking operation display machine is also provided with a communication port corresponding to at least two mouse devices, wherein the communication port is used to connect the mouse device, wherein the type of the communication port includes at least one of USB, PS / 2 and serial port, wherein each mouse device has a unique identifier and can operate the human-computer interaction interface of the interlocking operation display machine.
[0017] The interlocking operation display machine allows multiple different types of mouse devices (including serial port, USB, PS / 2 interface) to operate on the same computer screen. The implementation steps are as follows: Step A: Configuration Reading Read the locally stored mouse device configuration information, which includes the operating area of each mouse, mouse ID number, and movement speed. Loading this information is to ensure that the software can correctly initialize and operate the mouse device according to the preset parameters.
[0018] Specifically, reading configuration data from local storage (such as files, databases, or registry) usually involves parsing configuration files (such as INI, XML, or JSON formats) to obtain the required settings. For example, find a file called "mouse_settings.json" that contains configuration information for all mouse devices, such as screen area coordinates, mouse ID, and speed.
[0019] Step B: Device monitoring The purpose of this step is to enable the software to monitor the input events of the mouse device (such as movement, clicks, wheel operations) and the events of device connection or disconnection (hot plug) in real time. This is crucial to ensure that the software can respond to mouse operations and device status changes in a timely manner.
[0020] Specifically, register the corresponding event listener or callback function to receive notification when a mouse event occurs or the device state changes. For example, the software may use the API provided by the operating system to register a listener for mouse events and register a hot plug event listener for USB devices. In Windows systems, this may involve using the Windows API to register device event listeners, such as using the RegisterDeviceNotification function to listen for device insertion and removal events. In Qt, you can use event filters (QEventFilter) or signal and slot mechanisms to listen and respond to these events.
[0021] Step C: Device Initialization Call Windows API to obtain the information of the currently inserted mouse device, initialize the mouse device handle and initial coordinate position. Hide the system mouse cursor and shield the system mouse events to avoid conflicts with custom mouse operations. This step is to obtain the information of the currently connected mouse devices and initialize the necessary operating parameters for these devices, such as device handles and initial coordinate positions. At the same time, in order to ensure that the software can fully control the mouse operation, it is necessary to hide the system default mouse cursor and shield the system default mouse event processing.
[0022] Among them, system mouse events usually refer to mouse operations captured and processed at the operating system level, such as mouse movement, clicks, wheel scrolling, etc. These events are the basic way for users to interact with computers, and the operating system responds to user input through these events. Blocking system mouse events before allowing multiple mice to operate the same device is mainly to avoid conflicts and ensure the accuracy of operations.
[0023] In this step, the system cursor is hidden by calling Windows API functions, such as SetCursor, and the raw input device is registered by RegisterRawInputDevices. For example, functions such as GetRawInputDeviceList and GetRawInputDeviceInfoA are called to obtain the number and status of mouse devices in the current system, and then a device handle is created for each device. In addition, this step directly involves the Windows system device monitoring interface function. By calling Windows APIs such as GetRawInputDeviceList, GetRawInputDeviceInfoA, SetCursor, etc., mouse device information is obtained, device handles are initialized, cursor properties are set, etc. These operations are all based on the device monitoring and event processing mechanism of the Windows system.
[0024] Step D: Cursor creation and event monitoring Based on the connected mouse devices and configuration information, a mouse cursor with a unique ID number is created for each device. This allows the software to distinguish between different mouse devices and provide independent control for each mouse device. For example, a Cursor object is created for each mouse device and its properties, such as position, appearance, etc., are set based on the configuration information. In addition, the mouse device input is monitored, the ID number of the current mouse device is identified, and the cursor position is updated. The mouse operation area boundary check is performed, and the mouse position is updated after the coordinates are recalculated to ensure that the cursor position is confined to the configured boundary area.
[0025] The reason for determining the position twice in the above process is that the first determination of the position records the initial position in the mousedown event, providing a basis for calculating the subsequent movement distance; while the second determination of the position is in the mousemove event. Based on the difference between the current actual position of the mouse and the initial position, the new position of the mouse is calculated, and boundary checks and final position updates are performed. Through these two operations of determining the position, it can be ensured that when multiple mice operate on the same display screen, the mouse cursor can accurately reflect the operator's intention and always move within the permitted operation area.
[0026] Step E: Event handling This step is to handle the input events of the mouse device, including movement, clicking, scrolling operations, etc. This step needs to identify the source device of the event, update the cursor position, and ensure that the cursor position is within the configured boundary area. In addition, it is also necessary to identify the event type and call the corresponding processing function to respond to these events. Specifically, by listening to the mouse input events, identifying the event type and the source device, and then updating the cursor position and calling the processing function according to the configuration information and the event type. For example, when the software detects a mouse movement event, it will check the device ID of the event, update the position of the cursor of that device, and ensure that the position is within the configured screen area.
[0027] This step involves the event distribution processing function and event listening function of Qt. In Qt, mouse events such as QMouseEvent can be handled by overriding the event() function of QWidget. In addition, event filters can also be used to listen to and handle mouse events. For the boundary check and coordinate update of the mouse operation area, it can be achieved by calculating the coordinates of the mouse event and comparing them with the configured boundary area.
[0028] Step F: Hot plug response When a plug and unplug event of the mouse device is detected, start repeating from step C to adapt to the new device configuration. This step is to handle the dynamic connection and disconnection of the mouse device. When the device status change is detected, the software needs to re-initialize the device to ensure that these devices can be correctly managed and operated. For example, if the software detects that a mouse device is unplugged, it will release the resources related to that device. When the same or another mouse device is connected again, the software will re-acquire the device information, create a new device handle, and initialize the cursor, etc.
[0029] In addition, after operating the plug and unplug of the mouse device, the cursor of the currently inserted mouse device can be updated again. When a new mouse is inserted, a mouse cursor with the corresponding ID number is added. When the mouse is unplugged, the corresponding mouse cursor automatically disappears. And when the unplugged mouse device is inserted again after being unplugged, the position of the mouse cursor remains the same as before unplugging.
[0030] This step requires reinitializing the mouse device handle, coordinate position, etc., which involves the Windows system device monitoring interface function and Qt event distribution processing function. When a change in the mouse device is detected, the device information needs to be re-acquired and the event listener needs to be updated.
[0031] Figure 1 The following is a schematic diagram of the management of mouse operation in the interlocking operation display machine provided in the embodiment of the present application. Figure 1 As shown, in the initialization phase, the mouse device is initialized, a mouse cursor is created for each mouse device, and the system mouse events are shielded. Subsequently, the input monitoring phase is entered to determine whether the current input is a mouse device, match the mouse ID, and perform the first mouse boundary check and the first mouse position update operation on the mouse device. Next, the event type of the mouse device and the state of the mouse position and mouse wheel are obtained, and then the second mouse boundary check and the second mouse position update operation are performed. Finally, according to the event type, the corresponding window event processing or button event processing function is called, and the mouse cursor is switched when necessary, for example, switching between the gesture icon and the arrow icon.
[0032] Through this solution, coordinated operation of multiple mouse devices on the same screen can be achieved, which improves the flexibility and efficiency of operation. It is suitable for application scenarios that require multi-mouse operation, such as multi-user collaborative environments or complex graphic design work.
[0033] The interlocking operation indicates that multiple different types of mouse devices (including serial port, USB, PS / 2 interface) can be operated on the same computer screen. The implementation steps involve the following Windows system functions: Qt event dispatch processing function: responsible for encapsulating native events generated by the operating system (such as mouse clicks, keyboard input, etc.) into Qt events and distributing them to the corresponding Qt objects for processing. For example, QApplication::sendEvent processes mouse events and sends them to the top-level window where the mouse is located. The core is QEventLoop, which takes events from the event queue and calls the event() function of the target object.
[0034] Qt event monitoring functions, for example, nativeEvent can monitor events such as mouse movement and device hot plugging. Among them, Qt provides multiple event types (such as QMouseEvent, QKeyEvent, etc.), and users can implement customized behaviors by rewriting event processing functions (such as mousePressEvent, keyPressEvent). It also supports event filters (QEventFilter), allowing events to be intercepted and processed before they reach the target object.
[0035] Windows system device monitoring interface functions: monitor and manage hardware device status changes. For example, through the WinUSB API, monitor USB device connection, disconnection and other events. These functions interact with device drivers and hardware interfaces to achieve device communication and status management.
[0036] Windows event interface functions: handle operating system level events, such as window creation, destruction, focus change, etc. These events are passed to the application through callback functions (such as WinEventProc). For example, EVENT_OBJECT_CREATE indicates that the object is created, and EVENT_OBJECT_DESTROY indicates that the object is destroyed. These functions allow applications to interact with the Windows system event mechanism to monitor and respond to system events.
[0037] For sub-window events in the human-computer interaction interface, the initialization phase allocates a mouse event handler object for each sub-window created to ensure that each sub-window can independently respond to and handle mouse events occurring on it. The mouse event handler object is an object specifically used to handle mouse events (such as mouse clicks, movements, wheel scrolling, etc.). It usually contains a series of event handling functions that define the operations that should be performed when a specific type of mouse event occurs.
[0038] When multiple mouse devices control the same human-computer interaction interface, the human-computer interaction interface is currently provided with sub-windows triggered by mouse operations, wherein the following operations are performed on each sub-window, including: Figure 2 The following is a flow chart of a method for responding to mouse operation in an interlocking operation display machine provided in an embodiment of the present application. Figure 2 As shown, the implementation steps of the method are as follows: Step 1: Determine whether the subwindow is displayed in the human-computer interaction interface; If the sub-window is displayed in the human-computer interaction interface, execute step 2; otherwise, execute step 10; Step 2: Determine whether the sub-window is a new window that is recently opened in response to a mouse operation; If the sub-window is a new window that is recently opened in response to a mouse operation, execute step 3; otherwise, execute step 6; Step 3: Obtain the window display level of the sub-window in the management area of each mouse device, and execute step 4; Step 4: Determine whether the operation state of the sub-window is blocked; If the operation state of the sub-window is blocked, execute step 5; otherwise, execute step 6; Step 5: Set the operation state of the mouse device in the sub-window to blocked, obtain the target mouse device, and execute step 6; Step 6: Determine whether each mouse device meets a preset condition, wherein the preset condition is that the operation state of the mouse device is not blocked; or the preset condition is that the operation state of the mouse device is blocked and the sub-window is a window that triggers the blocking of the mouse device; the mouse device that meets the preset condition is taken as the target mouse device, and step 7 is executed; Step 7: Determine whether the coordinates of the target mouse device are located in the sub-window, and if the coordinates of the target mouse device are located in the sub-window, execute step 8; Step 8: Determine whether the sub-window is located at the top layer in the management area of the target mouse device, and if the sub-window is a window located at the top layer, execute step 9; Step 9: Respond to the mouse event triggered by the target mouse device.
[0039] Step 10: Determine whether the sub-window is the window that is most recently closed in response to a mouse operation; If the sub-window is the window that is most recently closed in response to a mouse operation, then execute step 11; otherwise, execute step 12; Step 11: Delete the sub-window from the human-computer interaction interface, and continue to step 12; Step 12: determining whether the operation state of the mouse device in the sub-window is blocked, and executing step 13 when the operation state of the mouse device is blocked; Step 13: Determine whether the operation state of the sub-window is blocked, and if the sub-window is in the blocked state, execute step 14; Step 14: Clear the blocking state of the sub-window.
[0040] In addition, the method further comprises: Remove the mouse device that does not meet the preset conditions in step 6 from the human-computer interaction interface; In step 8, if the sub-window is not located at the top level in the management area of the target mouse device, the sub-window is removed from the human-computer interaction interface.
[0041] Below Figure 2 The following is further explained in the following part: In step 1, before processing any mouse events, first check whether the child window is in the display state. If the window is not visible (for example, it is minimized, hidden, or not yet displayed), there is no need to process mouse events because the user cannot interact with an invisible window.
[0042] In step 2 and step 3, if the child window is in the display state and is a newly opened window, its window display hierarchy needs to be recorded. The window display hierarchy refers to the stacking order of each window on the screen in a multi-window environment. In simple terms, it determines which windows are at the top, which windows are blocked, and the relative position relationship between them.
[0043] For example, when multiple windows are opened, the operating system will dynamically adjust the stacking order of the windows based on factors such as the order in which the windows are created and user operations (such as clicking on a window). The most recently opened window is usually placed on the top, covering the previous window. If a window is minimized or moved behind other windows, its window display level will change. The window display level can be queried and modified through the API provided by the window manager. For example, the Windows system provides the GetWindow function, which can be used to obtain the hierarchical relationship of windows (such as parent window, child window, sibling window, etc.).
[0044] In step 5, if the child window is a blocking window (i.e., a modal window), the mouse device within the child window needs to be set to a blocked state. This means that mouse events will be limited to the current modal window, and the user cannot interact with other windows outside the modal window. At the same time, the system will ignore mouse events from other windows. For example, the user opens a login dialog box, which is a modal window. When the login dialog box is displayed, the mouse is set to a blocked state, and the user cannot click or interact with other windows outside the login dialog box. At this time, the system only processes mouse events within the login dialog box and ignores events from other windows.
[0045] In step 6, determine whether the mouse is in a blocked state: If the mouse is in the blocked state and the child window is the window that triggered the mouse blocking, the mouse event is processed.
[0046] If the mouse is not in a blocked state, it is directly determined whether the mouse event position is within the child window.
[0047] In step 7, before processing the mouse event, it is necessary to determine whether the position of the mouse event is within the child window. If the mouse is outside the window, the event is ignored.
[0048] In step 8, when the mouse event is located in the sub-window, it is determined that the sub-window is the top-level window of the current mouse event position.
[0049] When the mouse event is located within the window, it is necessary to further determine whether the child window is the top-level window of the mouse event location. The top-level window refers to the window at the top layer at the current mouse location. If the child window is not a top-level window, the mouse event is ignored because the user cannot interact with the obscured window.
[0050] For example, if a user opens multiple windows and one of them is blocked by other windows, when the user clicks the mouse in the area of the blocked window, the system needs to determine the top-level window at the current mouse position. If the clicked window is not a top-level window, the mouse event is ignored because the user actually clicked the window covering it.
[0051] These steps ensure that the processing logic of mouse events is consistent with the state of the child window and the context of user interaction. By determining whether the window is displayed, whether it is a new window, whether it is a modal window, and the location and hierarchical relationship of the mouse event, unnecessary event processing can be avoided, improving the accuracy of the application's interaction logic and user experience.
[0052] In step 9, according to the global coordinate position of the window and the coordinate position of the mouse event, the smallest unit control in the child window is located, and the custom mouse event is sent to the smallest unit control to complete the processing of the mouse event.
[0053] In a Qt-based application, the following steps can be used to locate the smallest unit control in the child window according to the global coordinates of the mouse event, and send the custom mouse event to the smallest unit control to complete the event processing.
[0054] The process of locating the smallest unit control is as follows: Get the global coordinates of the mouse event; start from the child window and recursively check the child controls of each control. If a control contains child controls and the position of the mouse event is within the range of the child controls, continue to search recursively. If a control has no child controls, then the control is the minimum unit control.
[0055] Among them, the mouse event is a type and parameter set according to specific needs. For example, the mouse press event needs to specify which button is pressed (left button, right button, etc.); the mouse lift event needs to specify which button (left button, right button, etc.) is lifted; the mouse wheel event needs to specify the scrolling direction and amplitude of the wheel; the mouse drag event needs to specify the starting and ending coordinates of the drag; the QMouseEvent class can be used to encapsulate this information.
[0056] When sending custom mouse events, use the QApplication::postEvent() or QObject::sendEvent() function to send the custom mouse events to the smallest unit control; the postEvent() function puts the event into the event queue and waits for the event loop to process it; the sendEvent() function processes the event directly and returns the result of the event processing.
[0057] After the smallest unit control receives a custom mouse event, it will respond according to its event processing logic. For example, a button control may trigger a click action after receiving a mouse press event. A scroll bar may scroll the content based on a wheel event. A drag event may move the position of a control. When processing a mouse press event, if a sub-window opening or closing event occurs, these sub-windows must also be managed.
[0058] In this way, the mouse events can be flexibly processed and accurately delivered to the controls that need to respond. This process involves multiple steps such as coordinate conversion, control search, event creation, and event sending, which ultimately achieves accurate control and processing of mouse events.
[0059] exist Figure 2 In the flowchart shown, a hover event usually refers to an event triggered when the mouse pointer hovers over an interface element (such as a button, menu item, icon, etc.). This event can be used to implement some user interaction effects, such as displaying a tooltip, changing the appearance of an element (such as changing the color, displaying additional graphics, etc.), or previewing the results of certain operations.
[0060] Among them, "Hover event refresh (move in)" and "Hover event refresh (move out)" refer to two different states of event processing triggered when the mouse pointer moves over interface elements (such as windows, buttons, icons, etc.). Among them: Hover event refresh (move in) means that when the mouse pointer moves over an interface element for the first time, an "move in" event is triggered. This event is usually used to display additional information or change the appearance of an interface element to provide user feedback. For example, when the mouse moves into a button, the button may change color or display a tooltip. Applications may use this event to initialize some dynamic effects, such as animation, sound, or load additional data.
[0061] Hover event refresh (move out) means that when the mouse pointer moves away from an interface element, the "move out" event is triggered. This event is used to clear or undo the state or effect set in the "move in" event. For example, when the mouse moves out of a button, the button may return to its original color or hide the tooltip. The application may use this event to release resources allocated in the "move in" event, such as stopping animations, sounds, or cleaning up loaded data.
[0062] These two event handling mechanisms are interaction patterns in user interface design, which help provide intuitive and dynamic user feedback and enhance user experience.
[0063] Steps 10 to 14 describe a logical flow for handling a window closing event, especially the handling of the mouse blocking state and the window blocking flag. The following is a detailed explanation of each step in the figure: In step 10, it is necessary to determine whether a window has been closed. If the child window is a newly closed window, then appropriate cleanup and resource release operations need to be performed to ensure that system resources are properly managed and the user interface remains updated. For example, this can be triggered by Qt's event distribution mechanism, such as QApplication::notify() or QObject::event() being called when processing a window closing event.
[0064] In step 11, if the child window is closed, it needs to be removed from the list of windows displayed in the current mouse area. This step ensures that the user interface reflects the latest window state, that is, the closed window no longer appears in the list of windows that the user can interact with. This step involves Qt's event distribution mechanism, for example, the QCloseEvent event is triggered when the window is closed.
[0065] In step 12, when closing the window, you need to check whether the child window is in a blocked state. If the child window is a blocked window, you need to handle any pending interactions or events before closing it to ensure the consistency and responsiveness of the user interface. For example, to listen to mouse events, use Qt's event listening functions, such as QWidget::mousePressEvent() or QWidget::mouseMoveEvent().
[0066] In step 13, if the child window is a blocked window, its blocked state needs to be cleared when the window is closed. This allows mouse events to be reassigned to other windows and the user can interact with the new top-level window. For example, use the Windows system device monitoring interface function (such as SetWindowsHookEx()) to monitor the state of the mouse or window.
[0067] In step 14, clear the blocked flag of the child window, which is a cleanup step to ensure that all blocked states associated with the child window are cleared. This includes updating any internal states or flags to reflect that the child window is no longer a blocked window. Get the window close event in the system message queue through the Windows event interface function (such as GetMessage() or PeekMessage()), or modify the state or properties of the window.
[0068] These steps ensure that the system can correctly manage mouse events and user interface state when the window is closed, providing a consistent and smooth user experience. These steps can prevent mouse events from being incorrectly processed after the window is closed, and also ensure that resources are properly released.
[0069] These steps ensure that the system can correctly manage mouse events and user interface state when the window is closed, providing a consistent and smooth user experience. Through these steps, mouse events can be prevented from being incorrectly processed after the window is closed, and resources are also ensured to be properly released. Qt event dispatch processing functions, Qt event listening functions, Windows system device listening interface functions, and Windows event interface functions play an important role in these steps to help applications interact with the operating system and users.
[0070] The solutions corresponding to steps 1 to 9 mainly focus on managing and optimizing the processing of mouse events in a multi-window environment. The technical effects of this process include: Improve interaction accuracy: By ensuring that only displayed windows can receive mouse events, invalid interaction attempts are avoided, thereby improving the accuracy of user operations.
[0071] Enhanced user experience: By managing the display hierarchy and blockage status of windows, users can interact with the currently active window more intuitively, reducing the possibility of confusion and incorrect operations.
[0072] Optimize resource utilization: By precisely controlling which windows can receive mouse events, the system can allocate resources more efficiently and avoid unnecessary processing of inactive windows.
[0073] Support for complex interaction scenarios: In a multi-window and multi-tasking environment, this solution can handle complex user interactions, such as interactions between modal dialog boxes and non-modal windows, improving the flexibility and adaptability of the system.
[0074] Enhance system responsiveness: By quickly and accurately identifying and responding to mouse events, the system is able to provide a smoother user experience, especially when quickly switching windows or performing complex operations.
[0075] The solutions corresponding to steps 11 to 14 mainly focus on handling window closing events, ensuring that the system can properly manage and release resources when the window is closed. The technical effects of this process include: Ensure that resources are released correctly: By clearing the blocking status and flags when the window is closed, it ensures that related resources are released correctly, avoiding memory leaks or other resource management problems.
[0076] Maintaining system stability: By ensuring that related mouse events are no longer processed after the window is closed, possible system errors or crashes are prevented, and the stability and reliability of the system are enhanced.
[0077] Update UI state: By removing closed windows from the display list, the UI is kept updated and accurate, ensuring that the UI state seen by the user is consistent with the actual state.
[0078] Support for smooth window management: This solution supports smooth and efficient window management, including window opening, closing, and status updating, improving the efficiency of multitasking.
[0079] Enhanced user control: By ensuring that users can interact with the new top-level window immediately after closing a window, users' sense of control over the system is enhanced, improving user satisfaction.
[0080] The technical advantages of some steps in the solution provided in the embodiments of this application are as follows: Technical advantages of steps 3 and 13: These two steps involve the management of the blocked state of the window, which is the key to handling modal dialog boxes and ensuring that users focus on the current task. By precisely controlling which windows can receive input, the logic and efficiency of user interaction can be significantly improved.
[0081] Technical advantages of step 5: This step determines whether to process mouse events by judging whether the mouse device meets preset conditions. This not only improves the response efficiency of the system, but also enhances the flexibility of the system and can adapt to different user interaction needs.
[0082] Technical advantage of step 11: Removing the window from the display list when the window is closed is critical to maintaining the accuracy of the user interface. It ensures that the user does not try to interact with a window that no longer exists after the window is closed, thereby improving system usability and user satisfaction.
[0083] An embodiment of the present application also provides a device for responding to mouse operations in an interlocking operation display machine, comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described above.
[0084] Optionally, the apparatus is further provided with communication ports corresponding one-to-one to at least two mouse devices, wherein the communication ports are used to connect the mouse devices, and the types of the communication ports include at least one of USB, PS / 2 and serial port.
[0085] An embodiment of the present application further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the method described above when running.
[0086] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As is known to those skilled in the art, the term "computer storage medium" includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
Claims
1. A method for responding to mouse operation in an interlocking operation display machine, characterized in that: The interlocking operation display machine is connected to at least two mouse devices, each of which has a unique identifier and can operate the human-computer interaction interface of the interlocking operation display machine, wherein: When multiple mouse devices control the same human-computer interaction interface, the human-computer interaction interface is currently provided with sub-windows triggered by mouse operations, wherein the following operations are performed on each sub-window, including: Step 1: Determine whether the sub-window is displayed in the human-computer interaction interface, and when the sub-window is displayed in the human-computer interaction interface, execute step 2; Step 2: Determine whether the sub-window is a new window that is recently opened in response to a mouse operation; If the sub-window is a new window that is recently opened in response to a mouse operation, execute step 3; otherwise, execute step 6; Step 3: Obtain the window display level of the sub-window in the management area of each mouse device, and execute step 4; Step 4: Determine whether the operation state of the sub-window is blocked; If the operation state of the sub-window is blocked, execute step 5; otherwise, execute step 6; Step 5: Set the operation state of the mouse device in the sub-window to blocked, obtain the target mouse device, and execute step 6; Step 6: Determine whether each mouse device meets a preset condition, wherein the preset condition is that the operation state of the mouse device is not blocked; or the preset condition is that the operation state of the mouse device is blocked and the sub-window is a window that triggers the blocking of the mouse device; the mouse device that meets the preset condition is taken as the target mouse device, and step 7 is executed; Step 7: Determine whether the coordinates of the target mouse device are located in the sub-window, and if the coordinates of the target mouse device are located in the sub-window, execute step 8; Step 8: Determine whether the sub-window is located at the top layer in the management area of the target mouse device, and if the sub-window is a window located at the top layer, execute step 9; Step 9: Respond to the mouse event triggered by the target mouse device.
2. The method according to claim 1, characterized in that The method further comprises: In step 1, when the sub-window is not displayed in the human-computer interaction interface, execute step 10; Step 10: Determine whether the sub-window is the window that is most recently closed in response to a mouse operation; If the sub-window is the window that is most recently closed in response to a mouse operation, then execute step 11; otherwise, execute step 12; Step 11: Delete the sub-window from the human-computer interaction interface, and continue to step 12; Step 12: determining whether the operation state of the mouse device in the sub-window is blocked, and executing step 13 when the operation state of the mouse device is blocked; Step 13: Determine whether the operation state of the sub-window is blocked, and if the sub-window is in the blocked state, execute step 14; Step 14: Clear the blocking state of the sub-window.
3. The method according to claim 1, characterized in that The method further comprises: Remove the mouse device that does not meet the preset conditions in step 6 from the human-computer interaction interface; In step 8, if the sub-window is not located at the top level in the management area of the target mouse device, the sub-window is removed from the human-computer interaction interface.
4. The method according to claim 1, characterized in that: The step of responding to the mouse event triggered by the target mouse device includes: Acquire the event type of the target mouse device, wherein the event type includes at least one of press, lift, move and scroll; Using the identifier of the target mouse device, the event type and the location of the mouse event, a preset processing function is called to respond to the mouse event triggered by the target mouse device.
5. The method according to claim 1, characterized in that The method further comprises: Before multiple mouse devices control the same human-computer interaction interface, the system mouse events in the interlocking operation representation machine are shielded.
6. The method according to claim 1, characterized in that The Qt event distribution processing function and Qt event monitoring function in the windows system are used to manage mouse operations.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: After detecting that the mouse device connected to the interlocking operation indicating machine has been hot-plugged, the mouse device currently connected to the interlocking operation indicating machine is re-initialized.
8. A device for responding to mouse operation in an interlocking operation display machine, comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.
9. The device according to claim 8, characterized in that The device is also provided with communication ports corresponding to at least two mouse devices one by one, wherein the communication ports are used to connect the mouse devices, and the types of the communication ports include at least one of USB, PS / 2 and serial port.
10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when executed.