Interaction simulation method and device, storage medium and electronic device
By acquiring interaction information from external devices and generating corresponding control events, the problem of poor convenience of interactive simulation operation in the development and debugging phase of touch screen electronic devices is solved, and more convenient and efficient interactive simulation operation is achieved.
Patent Information
- Application Number
- CN202310261588.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-16
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2043-03-16
AI Technical Summary
Touchscreen electronic devices have poor interactive simulation operation convenience during the development and debugging phase, especially since scroll wheel operation and drag operation are not supported by the system, resulting in discontinuous and cumbersome operation.
By acquiring interaction information from external devices, an event interceptor adds it to the event stream to be processed, and generates corresponding control events based on the event processing status, including mouse press, drag and release events, which are then directly published to the target system, thus preventing users from performing unsupported scroll wheel and drag operations.
It improves the convenience of interactive simulation operation of touch screen electronic devices during the development and debugging phase, simplifies the user operation process, and enhances the efficiency and accuracy of interactive simulation.
Smart Images

Figure CN116303016B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more particularly to an interactive simulation method, apparatus, storage medium, and electronic device. Background Technology
[0002] Touchscreen electronic devices have become indispensable tools for people's daily work, study, and entertainment, allowing users to conveniently and flexibly use them through touch operations on the screen. However, during the development and debugging phase, many debugging tasks need to be performed on a computer, thus requiring the touchscreen electronic device to be connected. However, most computers currently lack touchscreen functionality, generally only allowing interaction via a mouse, keyboard, or touchpad. Therefore, during the debugging phase, developers can only input interactive information using a mouse, keyboard, or touchpad, and respond to this interactive information and execute corresponding operation events through an emulator configured on the computer.
[0003] However, mouse wheel operations and some touchpad operations are not supported by the systems of touchscreen electronic devices. Taking page scrolling and dragging as an example, there are currently two ways to implement it: The first way is to lock a display control by holding down the left mouse button, and then move the display control to the corresponding position by continuously dragging it; the second way is for the user to hold down the touchpad with one finger and slide the other finger on the touchpad to achieve the dragging operation.
[0004] Both of these methods involve intermittent operation, especially the second method, where the user must find a support point to apply force before swiping. Therefore, the ease of operation in interactive simulation for touchscreen electronic devices during the development and debugging phase is currently quite poor. Summary of the Invention
[0005] This disclosure provides an interactive simulation method, apparatus, storage medium, and electronic device, thereby improving the ease of operation of interactive simulation in touchscreen electronic devices during the development and debugging phase.
[0006] In a first aspect, one embodiment of this disclosure provides an interactive simulation method, including:
[0007] Acquire interactive information input from external devices and add the interactive information to the event stream to be processed;
[0008] Determine the event processing status of the event stream to be processed; wherein the event processing status is used to characterize whether the event processing process is idle;
[0009] Based on the event processing status and the pre-configured event type, a control event corresponding to the interaction information is generated, and the control event is published to the target system.
[0010] In one optional embodiment of this disclosure, acquiring the interaction information input from the external device and adding the interaction information to the event stream to be processed includes:
[0011] A pre-configured event interceptor is invoked to obtain the interaction information input by the external device from the listening interface of the target system, and the interaction information is added to the event stream to be processed.
[0012] In one optional embodiment of this disclosure, the step of invoking a pre-configured event interceptor to obtain the interaction information input by the external device from the listening interface of the target system, and adding the interaction information to the event stream to be processed, includes:
[0013] The pre-configured event interceptor is invoked to obtain the interaction information input by the external device from the listening interface of the target system;
[0014] Determine the information response identifier of the interactive information and the display position of the interactive component in the interactive simulator;
[0015] If the information response identifier is the simulator identifier of the interactive simulator, and the display position is within the preset simulation area, then the interactive information is added to the event stream to be processed.
[0016] In one optional embodiment of this disclosure, generating the control event corresponding to the interaction information based on the event processing status and the pre-configured event type includes:
[0017] If the event handling state is idle, then a mouse press event is generated;
[0018] If the event handling state is an interactive state, and the interactive information is not an interaction end information, then a mouse drag event is generated.
[0019] If the event handling state is the interaction end state, then a mouse release event is generated.
[0020] In one optional embodiment of this disclosure, the mouse press event, the mouse drag event, and the mouse release event are all mouse left button events.
[0021] In one optional embodiment of this disclosure, generating a mouse drag event if the event handling state is an interactive state and the interactive information is not interactive end information includes:
[0022] If the event handling state is an interactive state, and the interactive information is not an interaction end information, then the movement vector of the interactive component in the interactive information is determined.
[0023] The target drag position of the interactive component is determined based on the initial position of the interactive component and the movement vector.
[0024] Generate the mouse drag event that moves the interactive component to the target drag position.
[0025] In one optional embodiment of this disclosure, generating a mouse release event if the event handling state is an interaction end state includes:
[0026] If the event handling state is the interaction end state, then the interaction position of the interaction component before obtaining the interaction information input from the external device is determined;
[0027] Generate the mouse release event that moves the interactive component to the interactive position.
[0028] In one optional embodiment of this disclosure, the interaction information is mouse wheel information.
[0029] Secondly, one embodiment of this disclosure provides an interactive simulation device, the device comprising:
[0030] The acquisition module is used to acquire interactive information input from external devices and add the interactive information to the event stream to be processed;
[0031] A determination module is used to determine the event processing status of the event stream to be processed; wherein the event processing status is used to characterize whether the event processing process is idle;
[0032] The generation module is used to generate the control event corresponding to the interaction information according to the event processing status and the pre-configured event type, and publish the control event to the target system.
[0033] Thirdly, one embodiment of this disclosure provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the method described above.
[0034] Fourthly, one embodiment of this disclosure provides an electronic device, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the above-described method by executing the executable instructions.
[0035] The technical solution disclosed herein has the following beneficial effects:
[0036] The aforementioned interactive simulation method first acquires the interactive information input from an external device and adds it to the event stream to be processed. Then, it determines the event processing state of the event stream and finally generates a control event corresponding to the interactive information based on the event processing state and a pre-configured event type. The control event is then published to the target system. This eliminates the need for users to perform general touch operations through external devices, such as scroll wheel operations and drag operations, which may not be supported by the target system of the touchscreen electronic device. The method generates the control event corresponding to the interactive information based on the event processing state and the pre-configured event type, making user operation more convenient. This solves the technical problem of poor operational convenience of interactive simulation in the development and debugging phase of current touchscreen electronic devices, and achieves the technical effect of improving the operational convenience of interactive simulation in the development and debugging phase.
[0037] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0039] Figure 1 A flowchart illustrating an interactive simulation method in this exemplary embodiment is shown;
[0040] Figure 2 A flowchart illustrating an interactive simulation method in this exemplary embodiment is shown;
[0041] Figure 3 This illustration shows an interactive schematic diagram of an interactive simulation method in this exemplary embodiment;
[0042] Figure 4 A flowchart illustrating an interactive simulation method in this exemplary embodiment is shown;
[0043] Figure 5 A flowchart illustrating an interactive simulation method in this exemplary embodiment is shown;
[0044] Figure 6 This diagram illustrates the structure of an interactive simulation device in this exemplary embodiment.
[0045] Figure 7 A schematic diagram of the structure of an electronic device in this exemplary embodiment is shown. Detailed Implementation
[0046] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of exemplary embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0047] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0048] The flowchart shown in the attached diagram is merely an illustrative example and does not necessarily include all steps. For example, some steps may be broken down, while others may be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0049] In related technologies, touchscreen electronic devices have become an indispensable tool for people's daily work, study, and entertainment. Users can conveniently and flexibly use these tools through touch operations on the screen. However, during the development and debugging phase, many debugging tasks need to be performed on a computer, thus requiring the touchscreen electronic device to be connected to a computer. However, most computers currently lack touchscreen functionality and generally only allow interaction via a mouse, keyboard, or touchpad. Therefore, during the debugging phase, developers can only input interactive information using a mouse, keyboard, or touchpad, and respond to this interactive information and execute corresponding operation events through an emulator configured on the computer. However, mouse wheel operations and some touchpad operations are not supported by the touchscreen electronic device system. Taking page scrolling and dragging as an example, there are currently two implementation methods: the first method involves holding down the left mouse button to lock a display control, and then continuously dragging the display control to the corresponding position; the second method involves the user holding down one finger on the touchpad and continuously sliding another finger on the touchpad to achieve the dragging operation. Both of these methods involve intermittent operation, especially the second method, where the user must find a support point to apply force before swiping. Therefore, the ease of operation in interactive simulation for touchscreen electronic devices during the development and debugging phase is currently quite poor.
[0050] In view of the above problems, this disclosure provides an interactive simulation method to improve the ease of operation of interactive simulation in touchscreen electronic devices during the development and debugging phase. The following is a brief introduction to the application environment of the interactive simulation method provided by this disclosure:
[0051] The interactive simulation method provided in this disclosure is applied to a terminal device. This terminal device has a display for showing an interactive interface or interactive scene, allowing the user to observe the interactive state in real time. The terminal device can be a computer, laptop, or server, etc., as long as it provides debugging functionality for touchscreen electronic devices during the debugging process. The touchscreen electronic device can be an Android system, an iOS system, or any other touchscreen device. This disclosure does not impose specific limitations and the appropriate device can be selected based on the actual situation.
[0052] Before describing the embodiments disclosed in this application, the following definitions are provided for some of the English terms used in the embodiments:
[0053] iOS: Apple's operating system for its mobile devices;
[0054] Mac: The operating system developed by Apple for its laptops;
[0055] CGEvent: An abstract class for mouse and keyboard events in macOS.
[0056] CGEventType.scrollWheel: The mouse wheel event type on macOS, typically triggered by two-finger interaction between the mouse wheel and trackpad.
[0057] CGEventType.leftMouseDown: The event type for left mouse button press on Mac systems. It can also be triggered by a single finger tap on the trackpad.
[0058] CGEventType.leftMouseDragged: The event type for dragging while holding down the left mouse button on a Mac system. It can also be triggered by pressing and dragging with two fingers on the trackpad.
[0059] CGEventType.leftMouseUp: The same event type for releasing the left mouse button on Mac systems. It is also triggered when clicking and releasing the trackpad.
[0060] The following example uses the terminal device as the execution subject and applies the interaction simulation method to the terminal device to debug touch screen electronic devices of the iOS system. Please refer to [link / reference]. Figure 1 The interactive module method provided in this embodiment includes the following steps 101-103:
[0061] Step 101: Obtain the interaction information input from the external device and add the interaction information to the event stream to be processed.
[0062] The external device refers to a device that is independent of the terminal device but communicatively connected to it, allowing users (such as developers or testers) to input interactive information. This external device can be any device such as a mouse, touchpad, or keyboard; this disclosure does not impose specific limitations. The interactive information refers to the operation instructions input by the user through operations on the external device. This information can be stored as data in the data source of the terminal device's system and retrieved from the terminal device's system or storage module during use. Alternatively, temporary storage may not be required; the terminal device can directly retrieve the information from the external device during use. This disclosure does not impose specific limitations. The pending event stream refers to the event queue formed by pending events, containing data packets of interactive information arranged in a certain order.
[0063] Step 102: Determine the event processing status of the event stream to be processed.
[0064] Among them, the event handling status is used to characterize whether the event handling process is idle, that is, whether there are pending events, whether the event handling process is idle, and whether the event handling process has ended.
[0065] Step 103: Generate the control event corresponding to the interaction information based on the event processing status and the pre-configured event type, and publish the control event to the target system.
[0066] Event types refer to operation events that require user input via external devices and are responded to by the target system of the touchscreen electronic device. Examples include scroll wheel events, click events, long press events, swipe events, etc., and are not exhaustive. Interaction information corresponds one-to-one with operation events. Different event processing states correspond to different operation events. The specific division of processing states and the content of the corresponding operation events are open to developers for configuration; this disclosure does not impose any limitations.
[0067] The interactive simulation method provided in this disclosure first acquires interactive information input from an external device and adds the interactive information to a pending event stream. Then, it determines the event processing state of the pending event stream. Finally, it generates a control event corresponding to the interactive information based on the event processing state and a pre-configured event type, and publishes the control event to the target system. This eliminates the need for users to perform general touch operations through external devices, such as scroll wheel operations and drag operations, which the target system of the touch screen electronic device may not support. The method generates a control event corresponding to the interactive information based on the event processing state and a pre-configured event type, making user operation more convenient. This solves the technical problem of poor operational convenience of interactive simulation in the development and debugging phase of current touch screen electronic devices, and achieves the technical effect of improving the operational convenience of interactive simulation in the development and debugging phase.
[0068] In an optional embodiment of this disclosure, step 101, obtaining the interaction information input from the external device and adding the interaction information to the event stream to be processed, includes the following step A:
[0069] Step A: Invoke the pre-configured event interceptor to obtain the interaction information input from the external device from the target system's listening interface, and add the interaction information to the event stream to be processed.
[0070] For example, developers can pre-register a "scroll wheel button" event interceptor named "CGEventType.scrollWheel" in the debugging system of the terminal device. Then, when developers use an external device to perform actions such as scrolling the mouse wheel or swiping two fingers on the touchpad, corresponding interactive information is generated. Inside the debugger, an event interceptor with the following event type, "NSEvent.EventTypeMask.scrollWheel," is created running on the main thread and listens for mouse wheel events. When a developer inputs interactive information via an external device, this event interceptor can intercept the mouse wheel event from the target system's mouse wheel event listener window and forward it to the pending event stream for temporary or permanent storage.
[0071] This embodiment of the disclosure obtains interactive information input from external devices from the listening interface of the target system through a pre-configured event interceptor. The specific types of intercepted events in the event interceptor can be flexibly configured by developers, resulting in greater flexibility. At the same time, obtaining interactive information input from external devices directly from the listening interface of the target system through the event interceptor improves both the accuracy and efficiency of the information.
[0072] In one optional embodiment of this disclosure, the events to be processed in the event stream can be processed at the frequency of the terminal device's screen refresh rate, so that the terminal device's screen refresh rate is consistent with the processing efficiency of the events to be processed, ensuring that the events to be processed in the event stream are at a stable level, and reducing storage pressure while ensuring the efficiency of the events to be processed.
[0073] Please see also Figure 2 and Figure 3 In an optional embodiment of this disclosure, step A above, which involves calling a pre-configured event interceptor to obtain interaction information input from an external device from the target system's listening interface and adding the interaction information to the event stream to be processed, includes the following steps 201-203:
[0074] Step 201: Invoke the pre-configured event interceptor to obtain the interaction information input from the external device from the target system's listening interface.
[0075] The method for obtaining interactive information is the same as in step A above, and will not be repeated here.
[0076] Step 202: Determine the information response identifier of the interactive information and the display position of the interactive component in the interactive simulator.
[0077] Step 203: If the information response identifier is the simulator identifier of the interactive simulator and the display position is within the preset simulation area, then add the interactive information to the event stream to be processed.
[0078] The response identifier refers to the program identifier that responds to the interactive information. The interactive information may contain various information types, and this embodiment primarily simulates information from the interactive simulator. Therefore, it is only necessary to process interactive information whose response identifier is the simulator identifier of the interactive simulator. This ensures that events only involve simulator operations are intercepted from the source. Simultaneously, the preset simulation area refers to the simulation area of the interactive simulator. Only when the guidance component of an external device is located in this area, such as a mouse cursor, can the information be identified as interactive simulator information. This approach significantly improves the cleanliness of event information in the event stream to be processed, further enhancing the efficiency of interactive simulation in this embodiment.
[0079] In one optional embodiment of this disclosure, step 103, generating the control event corresponding to the interaction information based on the event processing status and the pre-configured event type, includes at least the following three cases:
[0080] In the first case, if the event handling state is idle, a mouse press event is generated.
[0081] In the second scenario, if the event handling state is interactive and the interaction information is not the end of the interaction, then a mouse drag event is generated.
[0082] In the third case, if the event handling state is the interaction end state, then a mouse release event is generated.
[0083] Taking mouse wheel events as an example, when there is an event to be processed in the event stream, it is considered that the mouse has started scrolling interaction, and the event stream loop starts by default. Regardless of whether the current event processing state of the event stream is idle, it can be considered that the external device has started scrolling interaction. At this time, the terminal device simulates a mouse press event and publishes it to the target system. In the second case, after the first case, if the event processing state of the event stream is detected to be interactive, that is, the event stream is in the process of event interaction, and no information other than the end of interaction is clearly detected, it is considered that the mouse is in a dragging state. In this case, a mouse drag event can be generated and published to the target system. In the third case, when the event processing state is the end of interaction, it means that the mouse scrolling or dragging operation has ended, that is, the mouse has been released, and a mouse release event named "CGEventType.mouseMoved" is generated.
[0084] This embodiment generates corresponding mouse events based on different event handling states, avoiding the need for developers to use external devices to perform scroll wheel operation events, drag operation events, etc., making the operation more convenient.
[0085] In one optional embodiment of this disclosure, the mouse press event, mouse drag event, and mouse release event are all mouse left button events.
[0086] When the external device is a mouse, the left mouse button is used more frequently than the right mouse button, and there are more types of operations that are combined with the left mouse button. For example, the mouse press event, mouse drag event, and mouse release event mentioned above are generally combined with the left mouse button. Therefore, in this embodiment, these three operations are configured in the left mouse button event to adapt to most current mouse operations and make the application more widespread. At the same time, configuring these three more complex operations in the left mouse button can, to a certain extent, separate them from the right mouse button event, avoid mutual interference, and thus improve the independence and reliability of mouse operation events.
[0087] Please see Figure 4 In an optional embodiment of this disclosure, for the second situation described above, if the event handling state is an interactive state and the interactive information is not an interaction end information, a mouse drag event is generated, including the following steps 401-403:
[0088] Step 401: If the event handling state is interactive and the interactive information is not the end of the interaction, then determine the movement vector of the interactive component in the interactive information.
[0089] Unlike the example for the second scenario in the above embodiments, this embodiment, when the event handling state is interactive and the interaction information is not interaction end information, first determines the movement vector of the interactive component, which includes the movement position and direction of the interactive component from its initial position to its current position, and calculates the corresponding movement vector based on its corresponding coordinate points. It should be explained that the interactive component refers to the component of the external device displayed in the simulator, such as the mouse cursor in the display interface.
[0090] Step 402: Determine the target drag position of the interactive component based on its initial position and movement vector.
[0091] The initial position refers to the location of the interactive component before the drag operation is performed, that is, before the current interaction information is obtained. The target drag position refers to the target location that the player wants to drag the component to, determined by the developers based on the interaction information input through an external device, using the initial position as a reference.
[0092] Step 403: Generate a mouse drag event that moves the interactive component to the target drag position.
[0093] It should be explained that in this embodiment of the disclosure, only a mouse drag event is generated to move the interactive component to the target drag position, and not the mouse drag event is executed. The mouse drag event can be understood as an instruction with specific information (target drag position), and the execution of the mouse drag event is implemented by the target system.
[0094] Please see Figure 5 In an optional embodiment of this disclosure, for the third situation described above, if the event handling state is the interaction end state, a mouse release event is generated, including the following steps 501-502:
[0095] Step 501: If the event handling state is the interaction end state, then determine the interaction position of the interactive component before obtaining the interaction information input from the external device.
[0096] Step 502: Generate a mouse release event that moves the interactive component to the interactive position.
[0097] The interaction position is the location of the interactive component after it has completed the interaction operation, that is, the location of the interactive component before obtaining the interaction information regarding mouse release. The interactive component can be released when the event handling state in the pending event stream is the interaction end state. In this case, a mouse release event is generated, which is an instruction with specific information (interaction position) that is executed or implemented by the target system.
[0098] When the event handling state is the interaction end state, the interaction position of the interactive component before obtaining the interaction information input from the external device is first determined, and then a mouse release event is generated to move the interactive component to the interaction position. The accuracy of this mouse release event is higher, which can further improve the accuracy of the interaction model method of this embodiment.
[0099] In one optional embodiment of this disclosure, the above-mentioned interactive information is mouse scroll wheel information.
[0100] The interactive information is mouse wheel information. That is, in this embodiment of the disclosure, the mouse wheel information input by an external device is used to control the interactive simulator to achieve or generate page scrolling interaction. This avoids the need for developers to intermittently execute the necessary events such as scroll wheel operation events and drag operation events that are required for general touch operation through an external device, but which may not be supported by the target system of the touch screen electronic device. The interactive information corresponding to the control event can be generated according to the event processing status and the pre-configured event type, making the user operation more convenient. This solves the technical problem of poor operation convenience of interactive simulation in the development and debugging stage of current touch screen electronic devices, and achieves the technical effect of improving the operation convenience of interactive simulation in the development and debugging stage.
[0101] Please continue reading Figure 3 In one optional embodiment of this disclosure, to obtain the interaction information in the above-described interaction simulation, it is necessary to request accessibility permissions from the user in advance, such as listening and interception permissions. The interaction information is then obtained only after the user confirms authorization. For example, if the target system is a Mac system, the `func AXIsProcessTrusted()->Bool` interface (accessibility permission query interface) provided by the Application Services framework of the Mac system is used to determine if the permission is not enabled. If so, accessibility permissions are requested through the `funcAXIsProcessTrustedWithOptions(_options:CFDictionary?)->Bool` interface (accessibility permission request interface). A timer is used to periodically check if the permission is enabled. Once enabled, the interaction information in the program is initialized. When accessibility permissions are enabled, the above-described interaction simulation method is started to obtain the corresponding interaction information from the system interface.
[0102] Please see Figure 6 To implement the above-mentioned interactive simulation method, one embodiment of this disclosure provides an interactive simulation device 600. Figure 6 A schematic architecture diagram of the interactive simulation device 600 is shown, including: an acquisition module 610, a determination module 620, and a generation module 630, wherein:
[0103] The acquisition module 610 is used to acquire interactive information input from an external device and add the interactive information to the event stream to be processed;
[0104] The determining module 620 is used to determine the event processing status of the event stream to be processed; wherein, the event processing status is used to characterize whether the event processing process is idle;
[0105] The generation module 630 is used to generate control events corresponding to interactive information based on the event processing status and pre-configured event types, and publish the control events to the target system.
[0106] In an optional embodiment, the acquisition module 610 is specifically used to call a pre-configured event interceptor to obtain the interaction information input by the external device from the listening interface of the target system, and add the interaction information to the event stream to be processed.
[0107] In an optional embodiment, the acquisition module 610 is specifically used to: call a pre-configured event interceptor to acquire interactive information input from an external device from the listening interface of the target system; determine the information response identifier of the interactive information and the display position of the interactive component in the interactive simulator; if the information response identifier is the simulator identifier of the interactive simulator and the display position is within a preset simulation area, then add the interactive information to the event stream to be processed.
[0108] In an optional embodiment, the generation module 630 is specifically configured to: generate a mouse press event if the event processing state is an idle state; generate a mouse drag event if the event processing state is an interactive state and the interactive information is not interactive end information; and generate a mouse release event if the event processing state is an interactive end state.
[0109] In an optional embodiment, the mouse press event, mouse drag event, and mouse release event are all left mouse button events.
[0110] In an optional embodiment, the generation module 630 is specifically configured to: if the event processing state is an interactive state and the interactive information is not interactive end information, determine the movement vector of the interactive component in the interactive information; determine the target drag position of the interactive component based on the initial position of the interactive component and the movement vector; and generate a mouse drag event that moves the interactive component to the target drag position.
[0111] In an optional embodiment, the generation module 630 is specifically used to: if the event processing state is the interaction end state, determine the interaction position of the interactive component before obtaining the interaction information input from the external device; and generate a mouse release event to move the interactive component to the interaction position.
[0112] In an optional embodiment, the interaction information is mouse wheel information.
[0113] Exemplary embodiments of this disclosure also provide a computer-readable storage medium that can be implemented as a program product including program code, which, when run on an electronic device, causes the electronic device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. In one embodiment, the program product can be implemented as a portable compact disc read-only memory (CD-ROM) including program code and can run on an electronic device, such as a personal computer. However, the program product of this disclosure is not limited thereto. In this document, the readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0114] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0115] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0116] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0117] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider). In embodiments of this disclosure, the program code stored in a computer-readable storage medium, when executed, can implement any of the steps in the interactive simulation method described above.
[0118] Please see Figure 7 Exemplary embodiments of this disclosure also provide an electronic device 700, which can be a backend server for an information platform. Reference is made below. Figure 7 This electronic device 700 will be described. It should be understood that... Figure 7 The electronic device 700 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0119] like Figure 7 As shown, the electronic device 700 is presented in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, and a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710).
[0120] The storage unit stores program code, which can be executed by the processing unit 710 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 710 can perform actions such as... Figure 1 The methods and steps shown are as follows.
[0121] Storage unit 720 may include volatile storage units, such as random access memory (RAM) 721 and / or cache memory 722, and may further include read-only memory (ROM) 723.
[0122] The storage unit 720 may also include a program / utility 724 having a set (at least one) of program modules 725, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0123] Bus 730 may include a data bus, an address bus, and a control bus.
[0124] Electronic device 700 can also communicate with one or more external devices 2000 (e.g., keyboard, pointing device, Bluetooth device, etc.) via input / output (I / O) interface 740. Electronic device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public network, such as the Internet) via network adapter 750. As shown, network adapter 750 communicates with other modules of electronic device 700 via bus 730. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0125] In the embodiments of this disclosure, the program code stored in the electronic device can be executed to perform any of the steps in the interactive simulation method described above.
[0126] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0127] Those skilled in the art will understand that various aspects of this disclosure can be implemented as systems, methods, or program products. Therefore, various aspects of this disclosure can be embodied in entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as “circuit,” “module,” or “system.” Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
[0128] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is defined only by the appended claims.
Claims
1. An interactive simulation method, characterized in that, include: Acquire interactive information input from external devices and add the interactive information to the event stream to be processed; Determine the event processing status of the event stream to be processed; wherein the event processing status is used to characterize whether the event processing process is idle; Based on the event processing status and the pre-configured event type, a control event corresponding to the interaction information is generated, and the control event is published to the target system; Wherein, the event type is a mouse wheel event; the step of generating the control event corresponding to the interaction information based on the event processing status and the pre-configured event type includes: If the event handling state is idle, then a mouse press event is generated; If the event handling state is an interactive state, and the interactive information is not an interaction end information, then a mouse drag event is generated. If the event handling state is the interaction end state, then a mouse release event is generated.
2. The interactive simulation method according to claim 1, characterized in that, The step of acquiring interaction information input from an external device and adding the interaction information to the event stream to be processed includes: A pre-configured event interceptor is invoked to obtain the interaction information input by the external device from the listening interface of the target system, and the interaction information is added to the event stream to be processed.
3. The interactive simulation method according to claim 2, characterized in that, The step of invoking a pre-configured event interceptor to obtain the interaction information input from the external device from the target system's listening interface and adding the interaction information to the event stream to be processed includes: The pre-configured event interceptor is invoked to obtain the interaction information input by the external device from the listening interface of the target system; Determine the information response identifier of the interactive information and the display position of the interactive component in the interactive simulator; If the information response identifier is the simulator identifier of the interactive simulator, and the display position is within the preset simulation area, then the interactive information is added to the event stream to be processed.
4. The interactive simulation method according to claim 1, characterized in that, The mouse press event, the mouse drag event, and the mouse release event are all left mouse button events.
5. The interactive simulation method according to claim 1, characterized in that, If the event handling state is an interactive state, and the interactive information is not an interaction end information, then a mouse drag event is generated, including: If the event handling state is an interactive state, and the interactive information is not an interaction end information, then the movement vector of the interactive component in the interactive information is determined. The target drag position of the interactive component is determined based on the initial position of the interactive component and the movement vector. Generate the mouse drag event that moves the interactive component to the target drag position.
6. The interactive simulation method according to claim 1, characterized in that, If the event handling state is the interaction end state, then a mouse release event is generated, including: If the event handling state is the interaction end state, then the interaction position of the interaction component before obtaining the interaction information input from the external device is determined; Generate the mouse release event that moves the interactive component to the interactive position.
7. The interactive simulation method according to claim 1, characterized in that, The interactive information is mouse wheel information.
8. An interactive simulation device, characterized in that, The device includes: The acquisition module is used to acquire interactive information input from external devices and add the interactive information to the event stream to be processed; A determination module is used to determine the event processing status of the event stream to be processed; wherein the event processing status is used to characterize whether the event processing process is idle; A generation module is used to generate a control event corresponding to the interaction information based on the event processing status and the pre-configured event type, and to publish the control event to the target system; Wherein, the event type is a mouse wheel event; the step of generating the control event corresponding to the interaction information based on the event processing status and the pre-configured event type includes: If the event handling state is idle, then a mouse press event is generated; If the event handling state is an interactive state, and the interactive information is not an interaction end information, then a mouse drag event is generated. If the event handling state is the interaction end state, then a mouse release event is generated.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 7.
10. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1 to 7 by executing the executable instructions.
Citation Information
Patent Citations
Devices, methods, and user interfaces for conveying proximity-based and contact-based input events
CN112119370A