System for realizing cross-platform key self-definition and office macro based on software
By designing cross-platform key customization and office macro systems, the problems of inconsistency in configuration and operation complexity between different platforms are solved, cross-platform consistency and user-friendly configuration management are achieved, and user-friendly configuration management is improved, and the user experience and tool practicality is improved.
Patent Information
- Application Number
- CN202411287171.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-12-24
AI Technical Summary
The existing key customization and office macro tools lack consistency between different platforms, and users need to repeatedly set and manage key functions and office macros, resulting in poor user experience.
A software-based cross-platform key customization and office macro system is designed, including user interface module, configuration management module, key monitoring module, macro execution module, cross-platform adaptation module and configuration synchronization module, through the cross-platform UI framework, The key mapping table and macro definition table implement configuration management and synchronization, and support Windows, MacOS and Linux systems.
It realizes the consistency of cross-platform key customization and office macros, reduces configuration complexity, improves user experience and tool practicality, supports users to customize complex key mapping and macro operations, simplifies the configuration process, and meets various office work Automation requirements.
Smart Images

Figure CN119179483A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of software engineering, relates to cross-platform development technology, and specifically is a system for realizing cross-platform key customization and office macros based on software. Background Art
[0002] Nowadays, key customization and office macros are used more and more widely, mainly to improve user operating efficiency and simplify repetitive work; common key customization and office macro tools include AutoHotkey, Karabiner-Elements, Xbindkeys, and Xdotool, which allow users to customize keyboard key functions, create macros to automate tasks, and implement these functions by writing scripts or configuration files; it is now necessary to provide a unified tool that supports Windows, MacOS, and Linux systems, so that users can share configuration files between different operating systems without repeated configuration; by using a unified tool, the complexity of configuration in different operating systems is reduced, so that ordinary users can also easily define keys and macros; when a user uses the unified tool to log in on other devices or operating systems, the configuration synchronization area downloads the configuration file from the cloud or local network, and loads it into the key mapping area and macro definition area to achieve cross-platform consistency of configuration.
[0003] In the prior art, key customization and office macro tools lack consistency between different platforms. Users need to repeatedly set and manage key functions and office macros under different operating systems, and cannot achieve cross-platform key customization and office macro functions. At the same time, due to the complex operation of existing tools, the user experience is poor.
[0004] The present invention provides a system for realizing cross-platform key customization and office macro based on software to solve the above technical problems. Summary of the invention
[0005] The present invention aims to solve at least one of the technical problems existing in the prior art; to this end, the present invention proposes a system for implementing cross-platform key customization and office macros based on software, which is used to solve the problem that key customization and office macro tools in the prior art lack consistency between different platforms, and users need to repeatedly set and manage key functions and office macros under different operating systems, and cannot implement cross-platform key customization and office macro functions; at the same time, due to the complex operation of existing tools, it leads to technical problems of poor user experience.
[0006] To achieve the above-mentioned object, a first aspect of the present invention provides a system for implementing cross-platform key customization and office macros based on software, comprising: a user interface module, a configuration management module, a key monitoring module, a macro execution module, a cross-platform adaptation module, and a configuration synchronization module;
[0007] User interface module: Graphical interface is designed through cross-platform UI framework, and users can customize key mapping and macro definition through the graphical interface; among them, cross-platform UI frameworks include: Qt, Electron;
[0008] Configuration management module: obtains the key mapping table and macro definition table from the database, and performs configuration management on the key mapping and macro definition through the key mapping table and macro definition table;
[0009] Key monitoring module: obtains the user's key input in real time, and determines whether a macro trigger event occurs based on the key input; if yes, performs macro operation according to the macro execution module; if no, executes the original function of the input key;
[0010] Macro execution module: call the macro definition table and execute macro operations according to the macro definition table;
[0011] Cross-platform adaptation module: cross-platform adaptation of key capture and operation execution based on adaptation code and API;
[0012] Configuration synchronization module: stores configuration content and completes configuration synchronization through the synchronization mechanism.
[0013] Preferably, the configuration management of the key mapping and macro definition through the key mapping table and the macro definition table includes:
[0014] Retrieve custom key mapping and macro definition, parse the custom key mapping and macro definition to obtain configuration content, and store corresponding configuration content in the key mapping table and macro definition table respectively; Retrieve the key mapping table and macro definition table, and perform corresponding configuration management through the key mapping table and macro definition table; wherein, storing corresponding configuration content includes: storing the correspondence between the original key and the target key through the key mapping table; storing the unique identifier and operation steps of the macro through the macro definition table; configuration management includes: creating configuration, editing configuration, deleting configuration and saving configuration.
[0015] It should be noted that when the user chooses to edit an existing configuration, the configuration management module updates the corresponding data structure; when the user chooses to delete an existing configuration, the configuration management module removes the corresponding configuration content from the button mapping table and macro definition table; when the user saves the configuration, the configuration management module serializes the button mapping table and macro definition table, and stores them locally and in the cloud.
[0016] The present invention can centrally manage all configuration contents through key mapping tables and macro definition tables, which is convenient for searching, modifying and deleting; and the configuration contents are stored in a table form, which is easy to export and back up, and also convenient for restoring the configuration when needed; users can customize complex key combinations and macro operations, and realize comprehensive support from simple key mapping to complex automation tasks, thereby improving the practicality and functionality of office tools and meeting various office automation needs.
[0017] Preferably, judging whether a macro triggering event occurs according to a key input includes:
[0018] Capture keyboard events and record key inputs through the operating system's API; search for key mappings in a key mapping table based on the captured key inputs; determine whether a key mapping that matches the key input can be found in the key mapping table; if so, execute the corresponding target key operation; if not, search for macros in a macro definition table; determine whether a macro that matches the key input can be found in the macro definition table; if so, a macro trigger event occurs; if not, no macro trigger event occurs.
[0019] The present invention can monitor and protect against potential malicious behaviors by capturing keyboard events and recording key inputs; for a series of operations that need to be executed frequently, automatic processing is achieved through macro definition to reduce human intervention and errors; the system can intelligently search and match in a key mapping table and a macro definition table according to the captured key inputs to ensure that the correct operations are performed.
[0020] Preferably, executing the macro operation according to the macro definition table includes:
[0021] The macro definition table corresponding to the macro trigger event is retrieved, and the operation steps in the macro definition table are parsed by macro parsing technology; wherein the operation steps include: key input, mouse operation, and delay; the operation steps are executed in sequence until the macro execution is completed.
[0022] The present invention can dynamically generate different macro operation sequences according to different needs by using macro parsing technology, making the macro highly flexible. Users can customize it according to specific circumstances to adapt to different usage scenarios; for users, macro parsing technology makes complex operations simple and easy. Users only need to execute a macro command to complete a series of complex tasks, thereby improving user experience.
[0023] Preferably, the cross-platform adaptation of key capture and operation execution according to the adaptation code and API includes:
[0024] Start the device's operating system and detect the operating system type, load the corresponding adaptation code according to the operating system type, and encapsulate the APIs of different operating systems for calling; provide a unified interface to the key monitoring module and macro execution module for key capture and operation execution, and complete cross-platform adaptation.
[0025] The present invention can run on different operating systems through an application program without writing separate codes for each platform, which ensures the compatibility and consistency of key mapping and macro operations on different operating systems; due to the clear code structure and logical separation, when a new operating system needs to be supported, it is only necessary to add a corresponding adaptation layer without modifying the core part of the existing code, which also makes maintenance easier because the codes related to each operating system are encapsulated in their own modules.
[0026] Preferably, storing the configuration content and completing configuration synchronization through a synchronization mechanism includes:
[0027] Retrieve the configuration content and generate a configuration file based on the configuration content; the user saves the configuration file on one device, saves the configuration file in the local file system and uploads it to the cloud storage service; the user logs in on another device, retrieves the cloud storage service, downloads the corresponding configuration file through the cloud storage service and loads it into the device system to complete the configuration synchronization.
[0028] The present invention ensures the configuration consistency on the local device by saving the configuration file in the local file system; and realizes the configuration synchronization between different devices by uploading the configuration file to the cloud storage service; by completing the configuration synchronization, the user can easily migrate the configuration between different devices without manually setting each parameter, thereby reducing the time of manual configuration and improving work efficiency.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] 1. The present invention provides a unified tool that supports Windows, macOS, and Linux systems. Users can share configuration files between different operating systems. Only one configuration is required to use the same key mapping and macro operations on different platforms, thereby improving configuration efficiency and consistency and reducing learning costs. By providing a user-friendly graphical interface and configuration template, users do not need to write complex scripts or configuration files, and can complete key mapping and macro definition through an intuitive graphical interface, thereby reducing the complexity of configuration and enabling ordinary users to easily define keys and macros, significantly lowering the usage threshold and improving the convenience of user operation.
[0031] 2. The present invention supports users to customize complex key mappings and macro operations, and realizes comprehensive support from simple key mapping to complex automation tasks, thereby improving the practicality and functionality of the tool and meeting various office automation needs; through intuitive user interface design and detailed help documentation, users can obtain smooth operation experience and sufficient support during configuration and use, reducing the difficulty of learning and use, and improving the usability and user satisfaction of the tool; the present invention effectively solves the shortcomings of the prior art in cross-platform support, configuration complexity, functional limitations and user experience, and provides users with an efficient, convenient and cross-platform consistent key customization and office macro solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 It is a schematic diagram of the module structure included in the present invention;
[0034] Figure 2 A schematic diagram of the process of implementing cross-platform key customization and office macros in the present invention;
[0035] Figure 3 It is a schematic diagram of the specific steps of the macro execution process of the present invention;
[0036] Figure 4 It is a schematic diagram of specific steps of configuring synchronization on different platforms according to the present invention. DETAILED DESCRIPTION
[0037] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] See also Figure 1-Figure 2 , the first aspect of the present invention provides a system for implementing cross-platform key customization and office macros based on software, including: a user interface module, a configuration management module, a key monitoring module, a macro execution module, a cross-platform adaptation module and a configuration synchronization module;
[0039] User interface module: Graphical interface is designed through cross-platform UI framework, and users can customize key mapping and macro definition through the graphical interface; among them, cross-platform UI frameworks include: Qt, Electron;
[0040] Configuration management module: obtains the key mapping table and macro definition table from the database, and performs configuration management on the key mapping and macro definition through the key mapping table and macro definition table;
[0041] Key monitoring module: obtains the user's key input in real time, and determines whether a macro trigger event occurs based on the key input; if yes, performs macro operation according to the macro execution module; if no, executes the original function of the input key;
[0042] Macro execution module: call the macro definition table and execute macro operations according to the macro definition table;
[0043] Cross-platform adaptation module: cross-platform adaptation of key capture and operation execution based on adaptation code and API;
[0044] Configuration synchronization module: stores configuration content and completes configuration synchronization through the synchronization mechanism.
[0045] See also Figure 3 , the specific steps of the macro execution process, through the cross-platform UI framework to design a graphical interface, the user customizes the key mapping and macro definition through the graphical interface; obtains the key mapping table and macro definition table from the database, parses the customized key mapping and macro definition to obtain the configuration content, and stores the corresponding configuration content in the key mapping table and macro definition table respectively; calls the key mapping table and macro definition table, and performs corresponding configuration management through the key mapping table and macro definition table; wherein, storing the corresponding configuration content includes: storing the corresponding relationship between the original key and the target key through the key mapping table; storing the unique identifier and operation steps of the macro through the macro definition table; configuration management includes: creating configuration, editing configuration, deleting configuration and saving configuration;
[0046] Acquire the user's key input in real time, capture keyboard events and record key input through the operating system's API; search for key mapping in the key mapping table based on the captured key input; determine whether a key mapping matching the key input can be found in the key mapping table; if so, execute the corresponding target key operation; if not, search for the macro in the macro definition table, and determine whether a macro matching the key input can be found in the macro definition table; if so, a macro trigger event occurs, call the macro definition table corresponding to the macro trigger event, and parse the operation steps in the macro definition table through macro parsing technology; if not, no macro trigger event occurs, and the original function of the input key is executed.
[0047] For example, by designing a graphical interface through Qt and Electron, in a Windows system, the user customizes key mapping and macro definition through the graphical interface, obtains the key mapping table and macro definition table from the database, parses the customized key mapping and macro definition to obtain the configuration content, and stores the corresponding configuration content in the key mapping table and macro definition table respectively; the configuration content is: the F1 key and F2 key on the keyboard are used as two customized keys, the action of pressing the F1 key becomes the sending of the key combination Ctrl+Alt+A, and the action of pressing the F2 key becomes the sending of the key combination Ctrl+Shift+Alt+V, and at the same time, the trigger interval between each customized key is set to 0.5s; the key mapping table and macro definition table are retrieved, and corresponding configuration management is performed through the key mapping table and macro definition table;
[0048] The user's key input is obtained in real time as F1 key, and F3 key is input after an interval of 0.5s. Keyboard events are captured through the API of the operating system and key input is recorded; key mapping is searched in the key mapping table according to the captured key input; if a key mapping matching the key input F1 key can be found in the key mapping table, the key combination Ctrl+Alt+A is executed; if a key mapping matching the key input F3 key can not be found in the key mapping table, the macro in the macro definition table is searched, and if it is determined that a macro matching the key input F3 key can not be found in the macro definition table, the original key operation of the F3 key is executed.
[0049] See also Figure 4 , the specific steps of configuration synchronization on different platforms, start the device's operating system, and detect the operating system type, load the corresponding adaptation code according to the operating system type, and encapsulate the API of different operating systems for calling; provide a unified interface to the key monitoring module and the macro execution module for key capture and operation execution to complete cross-platform adaptation; retrieve the configuration content and generate a configuration file based on the configuration content; the user saves the configuration file on one device, saves the configuration file in the local file system and uploads it to the cloud storage service; the user logs in on another device, retrieves the cloud storage service, downloads the corresponding configuration file through the cloud storage service and loads it into the device system to complete configuration synchronization.
[0050] For example, the device's operating system is started, and the operating system type is detected to be MacOS. The corresponding adaptation code is loaded according to the operating system type, and the API of the MacOS system is encapsulated for calling; a unified interface is provided to the key monitoring module and the macro execution module for key capture and operation execution to complete cross-platform adaptation; the configuration content is now retrieved, encrypted into a json file, and the json file is used as the configuration file; user A now saves the configuration file on device one, saves the configuration file in the local file system and uploads it to the cloud storage service; user B logs in on device two, retrieves the cloud storage service, downloads the corresponding configuration file through the cloud storage service and loads it into the device system, completing the configuration synchronization between the Windows system and the MacOS system.
[0051] Part of the data in the above formula is calculated by removing the dimension and taking its numerical value. The formula is a formula closest to the actual situation obtained by software simulation of a large amount of collected data; the preset parameters and preset thresholds in the formula are set by technical personnel in this field according to actual conditions or obtained through simulation of a large amount of data.
[0052] The working principle of the present invention is as follows: the present invention designs a graphical interface through a cross-platform UI framework, and the user customizes key mapping and macro definition through the graphical interface; obtains a key mapping table and a macro definition table from a database, and configures and manages the key mapping and macro definition through the key mapping table and the macro definition table; obtains the user's key input in real time, and determines whether a macro triggering event occurs according to the key input; if yes, performs a macro operation; if not, executes the original function of the input key; executes the macro operation according to the macro definition table; performs cross-platform adaptation of key capture and operation execution according to the adaptation code and API; stores the configuration content and completes the configuration synchronization through the synchronization mechanism.
[0053] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.
Claims
1. A system for implementing cross-platform key customization and office macros based on software, characterized in that: include: User interface module, configuration management module, key monitoring module, macro execution module, cross-platform adaptation module and configuration synchronization module; User interface module: Graphical interface is designed through cross-platform UI framework, and users can customize key mapping and macro definition through the graphical interface; among them, cross-platform UI frameworks include: Qt, Electron; Configuration management module: obtains the key mapping table and macro definition table from the database, and performs configuration management on the key mapping and macro definition through the key mapping table and macro definition table; Key monitoring module: obtains the user's key input in real time, and determines whether a macro trigger event occurs based on the key input; if yes, performs macro operation according to the macro execution module; if no, executes the original function of the input key; Macro execution module: call the macro definition table and execute macro operations according to the macro definition table; Cross-platform adaptation module: cross-platform adaptation of key capture and operation execution based on adaptation code and API; Configuration synchronization module: stores configuration content and completes configuration synchronization through the synchronization mechanism.
2. The system for realizing cross-platform key customization and office macro based on software according to claim 1, characterized in that: The configuration management of the key mapping and macro definition through the key mapping table and the macro definition table includes: Retrieve custom key mapping and macro definition, parse the custom key mapping and macro definition to obtain configuration content, and store corresponding configuration content in the key mapping table and macro definition table respectively; Retrieve the key mapping table and macro definition table, and perform corresponding configuration management through the key mapping table and macro definition table; wherein, storing corresponding configuration content includes: storing the correspondence between the original key and the target key through the key mapping table; storing the unique identifier and operation steps of the macro through the macro definition table; configuration management includes: creating configuration, editing configuration, deleting configuration and saving configuration.
3. The system for realizing cross-platform key customization and office macro based on software according to claim 1, characterized in that: The step of judging whether a macro triggering event occurs according to a key input includes: Capture keyboard events and record key inputs through the operating system's API; search for key mappings in a key mapping table based on the captured key inputs; determine whether a key mapping that matches the key input can be found in the key mapping table; if so, execute the corresponding target key operation; if not, search for macros in a macro definition table; determine whether a macro that matches the key input can be found in the macro definition table; if so, a macro trigger event occurs; if not, no macro trigger event occurs.
4. The system for realizing cross-platform key customization and office macro based on software according to claim 1, characterized in that: The performing of macro operations according to the macro definition table includes: The macro definition table corresponding to the macro trigger event is retrieved, and the operation steps in the macro definition table are parsed by macro parsing technology; wherein the operation steps include: key input, mouse operation, and delay; the operation steps are executed in sequence until the macro execution is completed.
5. The system for realizing cross-platform key customization and office macro based on software according to claim 1, characterized in that: The cross-platform adaptation of key capture and operation execution according to the adaptation code and API includes: Start the device's operating system and detect the operating system type, load the corresponding adaptation code according to the operating system type, and encapsulate the APIs of different operating systems for calling; provide a unified interface to the key monitoring module and macro execution module for key capture and operation execution, and complete cross-platform adaptation.
6. The system for implementing cross-platform key customization and office macros based on software according to claim 1, characterized in that: The storing of configuration content and completing configuration synchronization through a synchronization mechanism include: Retrieve the configuration content and generate a configuration file based on the configuration content; the user saves the configuration file on one device, saves the configuration file in the local file system and uploads it to the cloud storage service; the user logs in on another device, retrieves the cloud storage service, downloads the corresponding configuration file through the cloud storage service and loads it into the device system to complete the configuration synchronization.
Citation Information
Cited By
Big data analysis method and device supporting SAS language analysis and execution and application
CN119597303A
