Input method configuration method, character input method, device and medium
Patent Information
- Application Number
- CN202211198803.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2042-09-29
AI Technical Summary
[0008]本申请提供了一种基于Weston的桌面系统下的输入法配置方法、字符输入方法、装置、设备及存储介质,可以解决嵌入式linux桌面Weston系统仅能实现英文输入,且不支持快捷键以及联想功能的问题,可以实现目标语言的输入、实现支持多种语言软键盘的切换,去掉了传统键盘冗余的按键,使得桌面系统配置的输入法更加具备通用性
[0018]The beneficial effects of this application include at least the following: building a Weston-based desktop system using pre-defined project tools in response to system build operations; compiling fcitx5 to the desktop system in response to compilation operations, with fcitx5 supporting character input for the target language; integrating the soft keyboard source code into the fcitx5 source code in response to source code modification operations to obtain the source code for the input method of the target language; and obtaining the input method-related files configured in the desktop system's usage environment in response to usage environment modification operations, so as to adapt the usage environment to the target language, fcitx5, and the soft keyboard, thereby enabling character input on the desktop system. Upon request, the system calls the input method's source code to display the soft keyboard corresponding to the target language; and associates the input operation indicated by the soft keyboard with characters that match the target language. This solves the problem that the embedded Linux desktop Weston system can only implement English input and does not support shortcut keys or predictive text. Since the desktop system is compiled with fcitx5, which supports character input in the target language, it is possible to use the target language for character input in the Weston-based desktop system, thus improving the flexibility of character input in the Weston-based desktop system.
Smart Images

Figure CN115509634B_ABST
Abstract
Description
Technical Field
[0001] This application relates to an input method configuration method, a character input method, a device, and a medium, belonging to the field of computer technology. Background Technology
[0002] Currently, embedded Linux systems or embedded Linux system products do not come with a desktop system; common general-purpose platforms with desktop systems (such as Ubuntu or Debian) are not suitable for embedded products. Therefore, it is necessary to customize embedded Linux systems to include a desktop system.
[0003] The most important program in a desktop system is the display server. Its primary task is to coordinate input and output between the client and other operating systems and hardware. The display server communicates with its clients through display server protocols. Common desktop display servers include: 1. Display Server X11: (1) X11 consists of a client, a server, an image compositor, and a kernel system. During rendering, both the client and the image compositor need to send requests to the server to complete the rendering of the image. The communication is time-consuming and inefficient. (2) X11 can only call some vendor-provided 2D drivers for image rendering. Although it can use 3DOpenGL through extensions, it still cannot bypass the server. Even if it can bypass the server and use 3DOpenGL through extensions, it will make X11 bloated, and most of X11's functions will be unusable, and it will also lose some performance and security.
[0004] 2. Wayland, the next-generation display server: Wayland's principle is that all rendering occurs on the client side. After receiving an input event, the client calculates the area to be rendered. It then allocates a buffer in memory, places the drawn image into the buffer, and notifies Wayland's server (called a compositor). The compositor listens for all client requests, composites the images drawn by the clients, and sends them to the renderer for rendering. This significantly reduces frequent interactions and data transfer between the client and server, improving efficiency.
[0005] In simple terms, the Wayland protocol uses a Compositor / Client model, where Wayland Compositor combines X11's XServer and Compositor into one. Weston is the reference implementation of Wayland Compositor; in other words, Weston is an instance based on Wayland Compositor, providing a desktop environment for desktopless application scenarios.
[0006] The traditional Weston input method and soft keyboard provided a basic input method, but it only supported English input and did not support keyboard shortcuts or predictive text.
[0007] Therefore, there is a problem in Weston-based desktop systems where users cannot input the language they expect. Summary of the Invention
[0008] This application provides an input method configuration method, character input method, device, and storage medium for a Weston-based desktop system. It solves the problem that the embedded Linux desktop Weston system can only support English input and does not support shortcut keys or predictive text. It enables input of the target language, supports switching between multiple language soft keyboards, and eliminates redundant keys on the traditional keyboard, making the input method configured on the desktop system more versatile. This application provides the following technical solutions: Firstly, a method for configuring an input method on a Weston-based desktop system is provided, the method comprising: In response to system build operations, use the preset project tools to build a Weston-based desktop system; In response to the compilation operation, fcitx5 is compiled to the desktop system, wherein fcitx5 supports character input in the target language; In response to the source code modification operation, the source code of the soft keyboard is merged into the source code of the fcitx5 to obtain the source code of the input method of the target language. In response to a usage environment modification operation, the system retrieves the input method-related files configured in the usage environment of the desktop system to adapt the usage environment to the target language, the fcitx5, and the soft keyboard. When the desktop system receives a character input request, the system calls the source code of the input method to display the soft keyboard corresponding to the target language; and associates the characters indicated by the input operation that match the target language with the input operation based on the input operation performed on the soft keyboard.
[0009] Optionally, the step of building a Weston-based desktop system using preset project tools in response to a system build operation includes: The system obtains a command to retrieve the system build operation instruction, and downloads the file repository of the preset project tool, the system files of the build system, the configuration file of the application configuration tool, and the input method interface file of the fcitx5 based on the address carried in the command; the build system is used to compile the desktop system of the embedded system; the application configuration tool is used to build an application that runs on the image of the preset project tool; the versions of the preset project tool, the build system, and the application configuration tool are compatible. The compilation environment for the Weston system is built using the file repository, the system files for building the system, the configuration files for the application configuration tools, and the input method interface files for the fcitx5. In the compilation environment, if the input method interface file does not contain a version of the preset project tool, a version addition operation is received in the input method interface file to add the version corresponding to the preset project tool. In the compilation environment, a language addition operation is performed in the target file to add the character encoding of the target language to the target file, resulting in a modified target file. The target file is the image file that needs to be compiled by the tool for compiling the preset project. In response to the received compilation command, the modified target file is compiled to build the desktop system.
[0010] Optionally, the step of compiling fcitx5 to the desktop system in response to the compilation operation includes: The compilation operation is received in the target configuration file of the preset project tool to add input method and soft keyboard configuration files to the target configuration file, which is used for users to add custom configurations; In the custom layer file of fcitx5, a first deletion operation is received to delete the relevant configuration library file of X11. The custom layer file of fcitx5 includes the relevant configuration library file of X11 and the relevant configuration library file of Weston. In the custom layer file of the soft keyboard, a second deletion operation is received to delete the relevant configuration library file of X11. The custom layer file of the soft keyboard includes the relevant configuration library file of X11 and the relevant configuration library file of Weston.
[0011] Optionally, the step of responding to the source code modification operation by incorporating the soft keyboard source code into the fcitx5 source code to obtain the source code of the input method for the target language includes: Based on the setting operation of the code repository address, the source code of fcitx5 is obtained using the code repository address of fcitx5 indicated by the setting operation, and the branch of the code repository address includes the address of the source code of the soft keyboard; In the source code of fcitx5, a file addition operation is received to add a compressed file that causes compilation errors to the source code of fcitx5, thereby obtaining modified source code of fcitx5; the source code modification operation includes the file addition operation; In the configuration file of fcitx5 in the preset project tool, a source code addition operation is received to add the modified fcitx5 source code to the configuration file of fcitx5, and a blocking operation is received to block the remote download function of the fcitx5 source code; the source code modification operation includes the source code addition operation and the blocking operation; In the configuration file of fcitx5, a report item configuration operation is received to add an error reporting item to the configuration file of fcitx5, so as to suppress the error reports of the input method and software disk of fcitx5 during the compilation process.
[0012] Optionally, adding the compressed file that caused the compilation error to the fcitx5 source code to obtain the modified fcitx5 source code includes: The source code of fcitx5 was compiled based on the obtained source code compilation command, and the compilation error problem was obtained; Obtain the compressed file downloaded by the user based on the aforementioned compilation error; The compressed file is added to the network download file of the fcitx5 source code based on the file addition operation, and the file acquisition method of the network download file is changed from remote download to use local file.
[0013] Optionally, the step of responding to the usage environment modification operation by obtaining the input method-related files configured in the usage environment of the desktop system, so as to adapt the usage environment to the target language, the fcitx5, and the soft keyboard, includes: In the usage environment, a language configuration operation is performed to configure the language environment of the usage environment as the target language; In the usage environment, an input method setting operation is performed to set the default input method as the input method of the target language; In the aforementioned usage environment, a switching setting operation is performed to configure the language switching function of the Fcitx5's soft keyboard; In the usage environment, an input method language setting operation is performed to set the default language of the soft keyboard.
[0014] Optionally, the preset project tool is Yocto.
[0015] Secondly, a character input method based on the Weston desktop system is provided, the method comprising: When the desktop system receives a character input request, it calls the source code of the input method for the target language to display the corresponding soft keyboard. The source code of the input method is obtained by compiling fcitx5 into the desktop system after the system build operation uses a preset project tool to build the desktop system based on Weston, and then in response to the compilation operation, the source code of the soft keyboard is integrated into the source code of fcitx5. The desktop system's usage environment is configured with input method-related files in response to the usage environment modification operation to make the usage environment compatible with the target language, fcitx5, and the soft keyboard. Based on the input operation performed on the soft keyboard, associate the character indicated by the input operation with the target language; Display the characters at the target location on the desktop system.
[0016] Thirdly, an electronic device is provided, the device including a processor and a memory; the memory stores a program, the program being loaded and executed by the processor to implement the input method configuration method under the Weston-based desktop system provided in the first aspect, or to implement the character input method under the Weston-based desktop system provided in the second aspect.
[0017] Fourthly, a computer-readable storage medium is provided, wherein a program is stored therein, and when executed by a processor, the program is used to implement the input method configuration method for a Weston-based desktop system provided in the first aspect, or to implement the character input method for a Weston-based desktop system provided in the second aspect.
[0018] The beneficial effects of this application include at least the following: building a Weston-based desktop system using pre-defined project tools in response to system build operations; compiling fcitx5 to the desktop system in response to compilation operations, with fcitx5 supporting character input for the target language; integrating the soft keyboard source code into the fcitx5 source code in response to source code modification operations to obtain the source code for the input method of the target language; and obtaining the input method-related files configured in the desktop system's usage environment in response to usage environment modification operations, so as to adapt the usage environment to the target language, fcitx5, and the soft keyboard, thereby enabling character input on the desktop system. Upon request, the system calls the input method's source code to display the soft keyboard corresponding to the target language; and associates the input operation indicated by the soft keyboard with characters that match the target language. This solves the problem that the embedded Linux desktop Weston system can only implement English input and does not support shortcut keys or predictive text. Since the desktop system is compiled with fcitx5, which supports character input in the target language, it is possible to use the target language for character input in the Weston-based desktop system, thus improving the flexibility of character input in the Weston-based desktop system.
[0019] In addition, since Fcitx5 supports features such as semantic association, shortcut keys, Chinese double pinyin, and software skins; and supports switching between multiple language soft keyboards, eliminating redundant keys on the traditional keyboard, it can increase the universality of the input method.
[0020] In addition, by setting the versions of the preset project tools, the build system, and the application configuration tools to be compatible, and by adding the corresponding versions of the preset project tools to the input method interface file, compilation errors caused by version inconsistencies can be avoided, ensuring the successful construction of the desktop system.
[0021] In addition, by deleting the X11-related configuration library files from the custom layer files of fcitx5 and the custom layer files of the soft keyboard, compilation errors caused by the X11-related configuration library files can be avoided, ensuring the smooth compilation of the input method and soft keyboard.
[0022] In addition, by adding a compressed file that causes compilation errors to the fcitx5 source code and adding an error reporting item to the fcitx5 configuration file, errors caused during the compilation of the fcitx5 source code can be avoided, thus ensuring the smooth compilation of the input method and soft keyboard.
[0023] In addition, by changing the file acquisition method of network downloads from remote downloads to using local files, the validity of the modified fcitx5 source code can be guaranteed.
[0024] In addition, by configuring the target language in the usage environment, setting the default input method to the target language's input method, configuring the language switching function of the Fcitx5 soft keyboard, and setting the default language of the soft keyboard, it is possible to ensure that the input method-related configurations in the usage environment conform to the user's input method habits and improve the input method usage effect.
[0025] In addition, by using Yocto to build a Weston-based desktop system, X11 can be hidden while retaining Wayland's related configurations. It also supports building a personal system to add the input method to the desktop system, thus enabling input method configuration for Weston-based desktop systems.
[0026] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, the preferred embodiments of this application are described in detail below with reference to the accompanying drawings. Attached Figure Description
[0027] Figure 1 This is a flowchart of an input method configuration method for a Weston-based desktop system provided in one embodiment of this application; Figure 2 This is a flowchart of a character input method based on a Weston desktop system provided in one embodiment of this application; Figure 3 This is a schematic diagram of a character input process in a Weston-based desktop system according to an embodiment of this application; Figure 4 This is a block diagram of an input method configuration device for a Weston-based desktop system according to an embodiment of this application; Figure 5 This is a block diagram of a character input device based on a Weston desktop system according to an embodiment of this application; Figure 6 This is a block diagram of an electronic device provided in one embodiment of this application. Detailed Implementation
[0028] The specific embodiments of this application will be described in further detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate this application, but are not intended to limit the scope of this application.
[0029] First, let me introduce some of the terms used in this application.
[0030] Yocto: Composed of open-source code, designed to help developers create customized Linux systems for embedded products. Common Yocto terms include: Configuration file: Contains globally defined variables, user-defined variables, and hardware configuration information.
[0031] Recipe: The most common form of metadata. A recipe can contain a list of settings and tasks (instructions) for building a binary image file. The recipe describes where the code is obtained and which (code) patches need to be applied. It also describes dependencies on other recipes or libraries, as well as configuration and compilation options. Recipes are stored in layers.
[0032] Layer: A collection of related recipes. Layers allow developers to aggregate metadata and customize builds. Sometimes, custom builds can support multiple different architectures; in such cases, layers can be used to isolate this data.
[0033] Metadata: Files (data) that the Yocto Project's build system parses when building Linux distributions. Metadata is a crucial element of the Yocto Project. Typically, metadata includes recipes, configuration files, other reference build instructions, and data controlling what and how to build. Metadata also includes commands, software version information, where it was obtained, other files used for patching, or information about custom software needed in specific scenarios. OpenEmbedded Core is an important set of verified metadata.
[0034] OpenEmbedded-Core: OE-Core is a combination of base recipes, class files, and metadata related to related files. It is commonly used in OpenEmbedded systems and is also used by the Yocto Project. OE-Core is a key core formed by the OpenEmbedded community by taking the core of its original repositories and fully validated recipes.
[0035] Poky: A reference embedded distribution, also used as a distribution providing basic functionality. It can be used to illustrate (learn) how to customize distributions, test Yocto Project components, and allow users to download Yocto Project. Poky is not production-grade, but it's a good starting point for customization. Poky is a layer integration on top of OE-Core.
[0036] Image: A binary representation of a Linux distribution (operating system) loaded onto a device.
[0037] Fcitx5 is an input method framework with a lightweight kernel and additional language support through addons. Fcitx5 requires the installation of different language input method engines to support input methods for multiple target languages. Optionally, target languages include, but are not limited to, Chinese, English, Korean, and Japanese. In this application, the target languages include at least languages other than English, such as Chinese, and correspondingly, Fcitx5 must have at least one input method engine for the target language installed, such as a Chinese input method engine.
[0038] Figure 1 This is a flowchart of an input method configuration method for a Weston-based desktop system according to an embodiment of this application. The method includes at least the following steps: Step 101: In response to the system build operation, use the preset project tools to build a Weston-based desktop system.
[0039] Pre-built project tools for Weston-based desktop systems include, but are not limited to, Yocto and Buildroot. Because Yocto is suitable for embedded Weston-based desktop systems and uses a layer model, it can disable X11 and retain Wayland when compiling Weston, resulting in better performance compared to Buildroot. Yocto also supports building personal systems, allowing input methods to be added to the desktop system. Therefore, this embodiment uses Yocto as an example for explanation.
[0040] In response to system build operations, building a Weston-based desktop system using pre-defined project tools involves at least the following steps: Step 1: Obtain the system build operation instruction command, and download the file repository of the preset project tools, the system files of the build system, the configuration files of the application configuration tools, and the input method interface files of fcitx5 based on the address carried in the command.
[0041] The build system is used to compile the desktop system of the embedded system. For example, the build system is OE. The application configuration tool is used to build the application that runs on the image of the preset project tool, for example, the application configuration tool is Qt5. Because incompatibility between the versions of the preset project tool, the build system, and the application configuration tool can lead to compilation failures of the preset project tool, this embodiment ensures that the versions of the preset project tool, the build system, and the application configuration tool are compatible. For example, versions of Yocto below 3.4 no longer have corresponding versions of OE and Qt5. Therefore, the Yocto version can be below 3.4, and correspondingly, the build system and application configuration tool are versions compatible with the Yocto version.
[0042] Version compatibility can mean versions with the same version number, or versions with different version numbers that support each other.
[0043] For example, ways to obtain Yocto's file repository include: using the command `git clone git: / / XXXXX` to copy the file repository (poky repository) to an electronic device (or host), and switching to a version below 3.4; One way to obtain the system files for the build system OE is to use the command `git clone https: / / XXXXX` to download the OE system files. There are several ways to obtain the configuration file for the application configuration tool Qt5: use the command `git clone https: / / XXXXX` to download the Qt5 configuration file; or switch both OE and Qt5 to the same version as Yocto. The methods to obtain the Fcitx5 input method interface file include: downloading the Fcitx meta layer (meta-inputmethod), specifically using the following command: Use `git clone https: / / XXXXX` to download the meta layer.
[0044] Step 2: Use the file repository, system files for building the system, configuration files for application configuration tools, and fcitx5 input method interface files to build the Weston system compilation environment.
[0045] Step 3: In the compilation environment, if the input method interface file does not contain a version of the preset project tool, the input method interface file receives a version addition operation to add the version corresponding to the preset project tool.
[0046] Specifically, check if the input method interface file contains a version of the preset project tool; if it does, proceed to step 4; if it does not, receive the version addition operation in the input method interface file to add the version corresponding to the preset project tool.
[0047] For example: In the fcitx5 input method interface file meta-inputmethod, is the LAYERSERIES_COMPAT_inputmethod-layer in the layer.conf file the Yocto version? If yes, it means it exists; if not, it means it doesn't exist. In this case, the version increment operation is applied to layer.conf, and this version increment operation is used to add the following configuration content: The line `LAYERSERIES_COMPAT_inputmethod-layer = "rocko sumo thud warrior zeusdunfell gatesgarth "` is used to add a Yocto version to the fcitx5 input method interface file.
[0048] Step 4: In the compilation environment, add operations to the target file to receive the language, so as to add the character encoding of the target language to the target file and obtain the modified target file. The target file is the image file that the compilation preset project tool needs to compile.
[0049] Since the target language includes at least Chinese, the character encoding must include at least GBK encoding and UTF-8 encoding for Chinese. In other embodiments, if the target language also includes other languages, the character encoding must also include the character encodings for those other languages.
[0050] For example, when compiling Yocto, the selected compilation location is the core-image-sata. Therefore, you need to add the target language character encoding to the core-image-sata.bb file. Specifically, go to the directory: .. / poky / meta / recipes-sato / images / , modify the core-image-sata.bb file, and add the following configuration to enable character encoding: GLIBC_GENERATE_LOCALES = "zh_CN.UTF-8 en_GB.UTF-8 en_US.UTF-8" IMAGE_LINGUAS = "zh-cn" LOCALE_UTF8_ONLY="1".
[0051] Step 5: In response to the received compilation command, compile the modified target file to build the desktop system.
[0052] Specifically, the compilation environment receives compilation commands input by the user, uses these commands to compile the modified target files, and builds the desktop system.
[0053] For example, the corresponding compilation command under the x86 architecture is as follows: bitbake core-image-sato; The corresponding compilation commands for embedded architecture are as follows: bitbake core-image-minimal -r conf / include / rksdk.conf \ $(grep -wq "PATCHLEVEL = 19" .. / .. / kernel / Makefile&&\ echo "-r conf / include / kernel-4.19.conf").
[0054] Step 102: In response to the compilation operation, compile fcitx5 to the desktop system. fcitx5 supports character input for the target language.
[0055] Among them, fcitx5 supports Chinese input methods and features such as semantic association, shortcut keys, Chinese double pinyin, and software skins.
[0056] There are many ways to compile an input method on a desktop system, such as using Qt5 to build a software disk for Chinese input methods or using JavaScript to build a Chinese soft keyboard in a browser. However, although these methods can be used, they are consistent with the demo input method provided by Weston in terms of usage, except that they can input Chinese. Chinese input cannot support features such as semantic association, shortcut keys, Chinese double pinyin, and software skins, resulting in poor performance.
[0057] Most existing Linux distributions use fcitx4, and not only is there no way to use fcitx5, but there is also no way to install and use fcitx5 on embedded platforms.
[0058] The inventors creatively discovered that the Fcitx5 input method uses the zwp_text_input_v1 protocol, which is also the protocol used by the Wayland framework. This allows input methods implemented based on Fcitx5 to communicate with desktop systems using the same protocol. Furthermore, the Fcitx5 input method supports Chinese input methods as well as input methods for other languages, supports predictive text / shortcut keys, and its software disk is universally compatible. It not only supports the Wayland framework but also meets the needs of users for input methods.
[0059] Based on this, in this embodiment, by modifying the fcitx5 source code and adding the corresponding bbfile for fcitx5 and the corresponding bbfile for the soft keyboard to Yocto, the input method can be successfully imported into the Weston-based desktop system.
[0060] Specifically, compiling fcitx5 to a desktop system involves the following steps: Step 1: In the target configuration file of the preset project tool, receive the compilation operation to add input method and soft keyboard configuration files to the target configuration file. This target configuration file is used for users to add custom configurations.
[0061] The target configuration file is generated after the desktop system is built. The built desktop system includes at least two configuration files: bblayers.conf and local.conf. local.conf contains the configuration settings for the user's build environment; bblayers.conf contains the layer settings for the user's build environment. In this embodiment, the target configuration file is local.conf.
[0062] The input method configuration file is used to configure the download path of the source code for fcitx5 and the soft keyboard. This source code includes: the source code of the font for the target language, the character library, the source code of Pinyin, and / or the communication protocol used, etc.
[0063] For example, in Yocto's target configuration file yocto / build / conf / includ / demo.conf, the compilation operation indicates that the input method and soft keyboard configuration file should be added as: include inputmethod_fcitx5.conf, and the configuration of this configuration file is as follows: # Compiling a configuration file using the fcitx5 input method # Add Chinese fonts IMAGE_INSTALL_append = " \ source-han-sans-cn-fonts \ glibc-utils \ localedef \ fontconfig \ ttf-wqy-zenhei \ " ERROR_QA_remove = "compile-host-path" # for wayland gtk IMAGE_INSTALL_append += " gtk-wayland-textinputv1" IMAGE_INSTALL_append += " fcitx5-chinese-addons".
[0064] The `source-han-sans-cn-fonts` directive sets the font for the target language. `localedef` converts source files containing locale-dependent information (such as formatting, date and time formats, and character attributes) into runtime locale object code. `glibc-utils` sets the input method's runtime standards, such as communication protocols. `Fontconfig` sets the font style. `ttf-wqy-zenhei` sets the Chinese character set. `fcitx5-chinese-addons` sets the Chinese input methods, such as Pinyin, Shuangpin, Wubi Pinyin, Ziranma, Cangjie, Bingchan Holographic, and Erbi. `gtk-wayland-textinputv1` sets how the desktop system displays the input box.
[0065] Step 2: In the custom layer file of fcitx5, receive the first deletion operation to delete the relevant configuration library files of X11.
[0066] Because fcitx5's custom layer files include configuration library files for both X11 and Weston, compilation errors occur. Therefore, removing the X11 configuration library files from the fcitx5 custom layer files resolves the issue by ensuring that the custom layer files only contain the Weston configuration library files, thus eliminating the compilation errors caused by the X11 configuration library files.
[0067] For example: After removing the X11-related configuration library files from the bblayer file of fcitx5 based on the first deletion operation, and keeping only the Weston-related library files, the resulting custom layer file of fcitx5 is as follows: DEPENDS = "\ ninja-native extra-cmake-modules virtual / egl expat dbus fmt \ libxkbcommon \ wayland wayland-native wayland-protocols iso-codes cairo \ gdk-pixbuf pango enchant2 json-c fcitx5-tools-native xkeyboard-config \ ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "systemd", "libevent", d)} \".
[0068] Step 3: In the custom layer file of the soft keyboard, receive the second delete operation to delete the relevant configuration library files of X11.
[0069] Because the custom layer files for the soft keyboard include configuration library files for both X11 and Weston, compilation errors occur during subsequent compilation. Therefore, removing the X11 configuration library files from the custom layer files resolves this issue, as the soft keyboard's custom layer files now only include the Weston configuration library files.
[0070] Optionally, the soft keyboard version that comes with Fcitx5 will report an error when compiled to the desktop system. Based on this, the soft keyboard version that comes with Fcitx5 can be modified. The modified soft keyboard version will not cause compilation errors caused by version incompatibility.
[0071] For example, in response to the modification operation, the keyboard mapping table compiler and support library libxkbcommon_0.8.0.bb that comes with fcitx5 is changed to libxkbcommon_0.10.0.bb; that is, the soft keyboard version is changed from version 0.8.0 to version 0.10.0 to solve the compilation error caused by the incompatibility of the software disk version.
[0072] Next, in libxkbcommon_0.10.0.bb, the X11-related configuration library files are removed based on the second deletion operation, leaving only the Weston-related library files as follows: EXTRA_OEMESON = "\ -Denable-docs=false \ -Denable-x11=false \ -Denable-wayland=true \ -Denable-docs=false \ -Dxkb-config-root= / usr / share / X11 / xkb \ -Dx-locale-root= / usr / share / X11 / locale\.
[0073] Step 103: In response to the source code modification operation, the source code of the soft keyboard is merged into the source code of fcitx5 to obtain the source code of the input method for the target language.
[0074] Currently, the official version of Fcitx5 does not support a soft keyboard, and there are almost no Fcitx5 soft keyboards on general-purpose platforms. Therefore, this embodiment integrates the Fcitx5 source code with an open-source soft keyboard to create a universal soft keyboard. Furthermore, after integrating the soft keyboard, the Fcitx5 soft keyboard supports switching between multiple language soft keyboards and eliminates redundant keys on traditional keyboards (i.e., keys unrelated to character input, such as the F1-F12 keys on a computer keyboard), making it more versatile.
[0075] In response to source code modification, the source code of the soft keyboard is integrated into the source code of fcitx5 to obtain the source code of the input method for the target language. This includes at least the following steps: Step 1: Based on the code repository address setting operation, use the fcitx5 code repository address indicated by the setting operation to obtain the source code of fcitx5. The branch of this code repository address includes the address of the soft keyboard source code.
[0076] For example, the code repository address setting operation in fcitx5 is set to: https: / / XXXXX; the branch address of this code repository address is: 5.0.8+virtual-keyboard-squashed, and the source code of the soft keyboard can be obtained based on this branch address.
[0077] Step 2: In the fcitx5 source code, a file addition operation is received to add a compressed file that caused the compilation error to the fcitx5 source code, resulting in modified fcitx5 source code. At this point, the source code modification operation includes the aforementioned file addition operation.
[0078] In the Fcitx5 source code, a file addition operation is received to add a compressed file that causes compilation errors to the Fcitx5 source code, resulting in modified Fcitx5 source code. This includes: compiling the Fcitx5 source code based on the obtained source code compilation commands, resulting in compilation errors; obtaining the compressed file downloaded by the user based on the compilation errors; adding the compressed file to the network download file of the Fcitx5 source code based on the file addition operation, and changing the file acquisition method of the network download file from remote download to use local files.
[0079] During runtime, the fcitx5 source code downloads en_dict-20121020.tar.gz from the network and stores it in the file fcitx5 / src / modules / spell / dict. If this file is empty, it will cause compilation errors. Therefore, in this embodiment, in response to a file addition operation, the source code is modified by adding the compressed file causing the compilation error to the fcitx5 source code. Specifically, en_dict-20121020.tar.gz can be added to fcitx5 / src / modules / spell / dict to resolve the compilation error caused by the empty file.
[0080] To ensure that empty files are not downloaded from the network later, and to make the modified fcitx5 source code effective, this embodiment also needs to change the file acquisition method of the compressed file from remote download to using local files.
[0081] For example: pre-download en_dict-20121020.tar.gz using the command: wget https: / / XXXXX. Then, modify fcitx5 / src / modules / spell / dict / CMakeLists.txt to change the remote download to using a local file. The specific modification method is as follows: set(SPELL_EN_DICT_URL"file: / / XXXXX.
[0082] In this embodiment, the example is to first compile the source code of fcitx5, obtain a compilation error, and then download a compressed file based on the compilation error. In actual implementation, the source code of fcitx5 can also be modified directly based on the modification information entered by the developers who are aware of the compilation error. After obtaining the modified source code of fcitx5, the modified source code of fcitx5 can be compiled.
[0083] Step 3: In the fcitx5 configuration file of the preset project tool, receive a source code addition operation to add modified fcitx5 source code to the fcitx5 configuration file, and receive a blocking operation to block the remote download function of fcitx5 source code. At this time, the source code modification operation also includes the source code addition operation and the blocking operation.
[0084] Specifically, the source code addition operation is applied to the directory of fcitx5 in meta-inputmethod and used to create a new folder named flies; then the modified fcitx5 source code fcitx5-5.0.8 source code is stored in the files folder and compressed into a file named fcitx5-5.0.8.tar.xz to make the source code format consistent with the format of the fcitx5 source code downloaded remotely.
[0085] Disabling remote download functionality of Fcitx5's source code means adding a disabling symbol before the remote download command in the Fcitx5 configuration file. In this case, the disabling operation includes adding the disabling symbol before the remote download command.
[0086] In other embodiments, the remote download command can be removed from the fcitx5 configuration file to disable the remote download functionality of the fcitx5 source code. In this case, the disabling operation includes removing the remote download command from the configuration file.
[0087] For example: blocking or removing remotely downloaded Fcitx5 source code; adding the use of locally modified Fcitx5 source code. The specific implementation method is as follows: #SRC_URI = "https: / / XXXXX" SRC_URI = "file: / / XXXXX" #SRC_URI_append = "\ # file: / / XXXXX # file: / / XXXXX # file: / / XXXXX # file: / / XXXXX # file: / / XXXXX # file: / / XXXXX # file: / / XXXXX # file: / / XXXXX # file: / / XXXXX # file: / / XXXXX # file: / / XXXXX #" #S = "${WORKDIR} / ${BPN}-${PV}" S = "${WORKDIR} / fcitx5-5.0.8" In this context, "#" is a masking symbol, and the commands following "#" are all related to remote downloading.
[0088] Step 4: Configure the receiving report item in the fcitx5 configuration file to add an error reporting item to the fcitx5 configuration file to suppress errors reported by the fcitx5 input method and software disk during the compilation process.
[0089] When compiling the input method and soft keyboard, errors such as QAIssue may occur. In this embodiment, an error reporting item is added to the ccitx5 configuration file inputmethod_fcitx5.conf: ERROR_QA_remove = "compile-host-path". This can suppress the QAIssue error during the compilation process of the fcitx5 input method and soft keyboard.
[0090] Step 104: In response to the usage environment modification operation, obtain the input method-related files configured in the usage environment of the desktop system to make the usage environment compatible with the target language, fcitx5, and soft keyboard. When the desktop system receives a character input request, call the source code of the input method to display the soft keyboard corresponding to the target language; and associate the characters that match the target language with the input operation indication based on the input operation performed on the soft keyboard.
[0091] In response to changes in the usage environment, the system retrieves the input method-related files configured in the desktop system's usage environment to ensure compatibility between the usage environment and the target language, Fcitx5, and the soft keyboard. This includes the following configuration aspects: (1) In the usage environment, the language configuration operation is set to the target language of the usage environment so that the desktop system uses the target language. For example, the way to configure the Chinese language environment in the usage environment is: / etc / profile: export LANG=zh_CN.UTF-8.
[0092] (2) In the usage environment, obtain input method settings to set the default input method to the target language's input method. For example, by adding the following configuration to fcixt5: / etc / xdg / weston / weston.ini, the default input method can be set to the target language's input method: [input-method] path= / usr / bin / fcitx5.
[0093] (3) In the usage environment, obtain the switching settings to configure the language switching function of the Fcitx5 soft keyboard. For example: manually add the Fcitx5 configuration file to: / .config / fcitx5 / config, and create the following content under this configuration file to implement the language switching function of the soft keyboard: [Behavior] ShowInputMethodInformation=False.
[0094] The language switching function includes: switching from Chinese to other languages (such as English), and switching from other languages to Chinese.
[0095] (4) In the usage environment, obtain the input method language setting operation to set the default language of the soft keyboard. The default language of the soft keyboard can be another language, such as English. In this case, the soft keyboard can be switched to Chinese using the language switching function. Alternatively, if the default language of the soft keyboard is Chinese, the soft keyboard can be switched to another language using the language switching function.
[0096] The following example demonstrates how to set the default language of the on-screen keyboard using English as the default language. Modify the configuration file: / .config / fcitx5 / profile to: [Groups / 0] # Group Name Name=US # Layout Default Layout=us # Default Input Method DefaultIM=keyboard-us [Groups / 0 / Items / 0] # Name Name=keyboard-us # Layout Layout= [Groups / 1] # Group Name Name=CH # Layout Default Layout=us # Default Input Method DefaultIM=pinyin [Groups / 1 / Items / 0] # Name Name=keyboard-us # Layout Layout= [Groups / 1 / Items / 1] # Name Name=pinyin # Layout Layout= [GroupOrder] 0=US 1=CH The following example demonstrates how to set the default language of the on-screen keyboard using Chinese as the default language. Modify the configuration file: / .config / fcitx5 / profile to: [Groups / 0] # Group Nameput Method Name=CH # Layout Default Layout=us # Default Input Method DefaultIM=pinyin [Groups / 0 / Items / 0] # Name Name=keyboard-us # Layout Layout= [Groups / 0 / Items / 1] # Name Name=pinyin # Layout Layout= [Groups / 1] # Group Name Name=US # Layout Default Layout=us # Default Input Method DefaultIM=keyboard-us [Groups / 1 / Items / 0] # Name Name=keyboard-us # Layout Layout= [GroupOrder] 0=CH 1=US In summary, the input method configuration method provided in this embodiment for a Weston-based desktop system, in response to system build operations, uses preset project tools to build a Weston-based desktop system; in response to compilation operations, compiles fcitx5 into the desktop system, enabling fcitx5 to support character input for the target language; in response to source code modification operations, integrates the soft keyboard source code into the fcitx5 source code to obtain the source code for the target language input method; and in response to usage environment modification operations, obtains the input method-related files configured in the desktop system's usage environment to adapt the usage environment to the target language, fcitx5, and the soft keyboard, thereby enabling... When the desktop system receives a character input request, it calls the input method's source code to display the soft keyboard corresponding to the target language; and associates the input operation on the soft keyboard with the character that matches the target language. This solves the problem that the embedded Linux desktop Weston system can only implement English input and does not support shortcut keys or predictive text. Since the desktop system is compiled with FcitX5, which supports character input in the target language, it is possible to use the target language for character input in the Weston-based desktop system, thus improving the flexibility of character input in the Weston-based desktop system.
[0097] In addition, since Fcitx5 supports features such as semantic association, shortcut keys, Chinese double pinyin, and software skins; and supports switching between multiple language soft keyboards, eliminating redundant keys on the traditional keyboard, it can increase the universality of the input method.
[0098] In addition, by setting the versions of the preset project tools, the build system, and the application configuration tools to be compatible, and by adding the corresponding versions of the preset project tools to the input method interface file, compilation errors caused by version inconsistencies can be avoided, ensuring the successful construction of the desktop system.
[0099] In addition, by deleting the X11-related configuration library files from the custom layer files of fcitx5 and the custom layer files of the soft keyboard, compilation errors caused by the X11-related configuration library files can be avoided, ensuring the smooth compilation of the input method and soft keyboard.
[0100] In addition, by adding a compressed file that causes compilation errors to the fcitx5 source code and adding an error reporting item to the fcitx5 configuration file, errors caused during the compilation of the fcitx5 source code can be avoided, thus ensuring the smooth compilation of the input method and soft keyboard.
[0101] In addition, by changing the file acquisition method of network downloads from remote downloads to using local files, the validity of the modified fcitx5 source code can be guaranteed.
[0102] In addition, by configuring the target language in the usage environment, setting the default input method to the target language, configuring the language switching function of the Fcitx5 soft keyboard, and setting the default language of the soft keyboard, it is possible to ensure that the input method-related configurations in the usage environment conform to the user's input method habits and improve the input method usage effect.
[0103] In addition, by using Yocto to build a Weston-based desktop system, x11 can be hidden while retaining Wayland's configuration. It also supports building a personal system to add the input method to the desktop system, thus enabling input method configuration for Weston-based desktop systems.
[0104] Optionally, based on the above configuration process, this application will use the character input method under the Weston-based desktop system provided in the following embodiment as an example for use in an electronic device. The electronic device is a terminal or a server. The terminal can be a mobile phone, computer, tablet computer, scanner, electronic eye, surveillance camera, etc. This embodiment does not limit the type of electronic device.
[0105] Figure 2 This is a flowchart of a character input method based on a Weston desktop system according to an embodiment of this application. The method includes at least the following steps: Step 201: When the desktop system receives a character input request, call the source code of the input method for the target language to display the soft keyboard corresponding to the target language.
[0106] The input method's source code is obtained by compiling fcitx5 into the desktop system after the system build operation uses a preset project tool to build the desktop system based on Weston, and then integrating the soft keyboard's source code into the fcitx5 source code in response to the source code modification operation. The desktop system's usage environment is configured with input method-related files in response to usage environment modification operations to make the usage environment compatible with the target language, fcitx5, and the soft keyboard.
[0107] The process of building the desktop system and obtaining the source code of the input method are described in the above embodiments, and will not be repeated here.
[0108] In one example, when the desktop system receives a character input operation, it obtains the character input request.
[0109] Step 202: Based on the input operation performed on the soft keyboard, associate the characters indicated by the input operation with the target language.
[0110] After an electronic device receives an input operation, it can determine the character indicated by the input operation based on the location of the input operation. By executing the source code of the input method, it can obtain the character library corresponding to the character, and thus associate it with the character that matches the target language indicated by the input operation.
[0111] For example: Reference Figure 3 , Figure 3 In this example, a Weston-based desktop system is applied to an embedded framework, such as the embedded RK3568 platform. When an input operation is received in the input box 31 of the browser on the Weston-based desktop system, a character input request is obtained. At this point, the source code of the target language's input method is called to display the corresponding soft keyboard 32 for Chinese characters. Based on the input operation performed on the soft keyboard 32, the corresponding Chinese character 33 is associated with that input operation. Figure 3 It can be seen that the soft keyboard does not have redundant keys unrelated to the input method, and can switch between Chinese and English (by triggering the language switching key "A#"), making it highly versatile.
[0112] Step 203: Display the characters at the target location on the desktop system.
[0113] Indicatively, the target position is the location where the character input operation takes effect.
[0114] In this embodiment, character input operations and input operations can be implemented through a touch screen, in which case the electronic device has a touch screen; or, they can be implemented through an external mouse, in which case the electronic device has an external mouse. This embodiment does not limit the implementation method of character input operations and input operations.
[0115] In summary, when a character input request is received by the desktop system, the source code of the target language's input method is invoked to display the corresponding soft keyboard. The input method's source code is obtained by compiling fcitx5 into the desktop system using a preset project tool in response to system build operations, and then integrating the soft keyboard's source code into the fcitx5 source code in response to source code modification operations. The desktop system's usage environment is configured with input method-related files in response to usage environment modification operations to ensure compatibility between the usage environment and the target language, fcitx5, and the soft keyboard. The system supports input operations on the soft keyboard, including Chinese as the target language. It associates input operation instructions with characters matching the target language. The characters are displayed at the target location on the desktop system. This addresses the limitation of the Weston embedded Linux desktop system, which only supports English input and does not support keyboard shortcuts or predictive text. Since the desktop system includes FcitX5, which supports character input in the target language, it enables character input in the target language within the Weston-based desktop system, improving the flexibility of character input in the Weston-based desktop system.
[0116] Figure 4 This is a block diagram of an input method configuration device for a Weston-based desktop system according to an embodiment of this application. The device includes at least the following modules: a system construction module 410, an input method compilation module 420, a source code fusion module 430, and a usage configuration module 440.
[0117] System build module 410 is used to build a Weston-based desktop system in response to system build operations using preset project tools; The input method compilation module 420 is used to compile fcitx5 into the desktop system in response to the compilation operation, wherein fcitx5 supports character input of the target language; The source code fusion module 430 is used to respond to the source code modification operation and fuse the source code of the soft keyboard into the source code of the fcitx5 to obtain the source code of the input method of the target language. The configuration module 440 is used to, in response to a modification of the usage environment, obtain input method-related files configured in the usage environment of the desktop system, so that the usage environment is adapted to the target language, the fcitx5, and the soft keyboard. When the desktop system receives a character input request, the source code of the input method is called to display the soft keyboard corresponding to the target language; and the input operation performed on the soft keyboard is associated with the character that matches the target language indicated by the input operation.
[0118] For relevant details, please refer to the above method implementation examples.
[0119] It should be noted that the input method configuration device based on the Weston desktop system provided in the above embodiments is only illustrated by the division of the above functional modules when configuring the input method on the Weston desktop system. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the input method configuration device based on the Weston desktop system can be divided into different functional modules to complete all or part of the functions described above. In addition, the input method configuration device based on the Weston desktop system provided in the above embodiments and the input method configuration method embodiments based on the Weston desktop system belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0120] Figure 5 This is a block diagram of a character input device based on a Weston desktop system according to an embodiment of this application. The device includes at least the following modules: a soft keyboard display module 510, a character association module 520, and a character input module 530.
[0121] The soft keyboard display module 510 is used to display the soft keyboard corresponding to the target language by calling the source code of the input method of the target language when the desktop system receives a character input request. The source code of the input method is obtained by compiling fcitx5 into the desktop system after building a Weston-based desktop system using a preset project tool, and then integrating the source code of the soft keyboard into the source code of fcitx5. The desktop system's usage environment is configured with input method-related files to adapt the usage environment to the target language, fcitx5, and the soft keyboard. The target language includes Chinese. The character association module 520 is used to associate characters that correspond to the target language indicated by the input operation based on the input operation performed on the soft keyboard. The character input module 530 is used to display the character at a target location on the desktop system.
[0122] For relevant details, please refer to the above method implementation examples.
[0123] It should be noted that the character input device based on the Weston desktop system provided in the above embodiments is only illustrated by the division of the above functional modules when performing character input on the Weston desktop system. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the character input device based on the Weston desktop system can be divided into different functional modules to complete all or part of the functions described above. In addition, the character input device based on the Weston desktop system provided in the above embodiments and the character input method embodiments based on the Weston desktop system belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0124] Figure 6 This is a block diagram of an electronic device provided in one embodiment of this application. The device includes at least a processor 601 and a memory 602.
[0125] Processor 601 may include one or more processing cores, such as a quad-core processor or an octa-core processor. Processor 601 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 601 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 601 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 601 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0126] Memory 602 may include one or more computer-readable storage media, which may be non-transitory. Memory 602 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in memory 602 is used to store at least one instruction, which is executed by processor 601 to implement the input method configuration method or character input method under a Weston-based desktop system provided in the method embodiments of this application.
[0127] In some embodiments, the electronic device may also optionally include a peripheral device interface and at least one peripheral device. The processor 601, memory 602, and peripheral device interface can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface via a bus, signal line, or circuit board. Indicatively, peripheral devices include, but are not limited to, radio frequency circuits, touch displays, audio circuits, and power supplies.
[0128] Of course, electronic devices may also include fewer or more components, and this embodiment does not limit this.
[0129] Optionally, this application also provides a computer-readable storage medium storing a program that is loaded and executed by a processor to implement the input method configuration method or character input method under the Weston-based desktop system described in the above method embodiments.
[0130] Optionally, this application also provides a computer product including a computer-readable storage medium storing a program that is loaded and executed by a processor to implement the input method configuration method or character input method for a Weston-based desktop system as described in the above method embodiments.
[0131] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0132] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for configuring an input method on a Weston-based desktop system, characterized in that, The method includes: In response to system build operations, use the preset project tools to build a Weston-based desktop system; In response to the compilation operation, fcitx5 is compiled to the desktop system, wherein fcitx5 supports character input in the target language; In response to source code modification operations, the fcitx5 source code containing the soft keyboard source code address is obtained based on the code repository address. The modified fcitx5 source code is added to the fcitx5 configuration file of the preset project tool, and the remote download function of the fcitx5 source code is blocked. An error reporting item is added to the fcitx5 configuration file. The soft keyboard source code is merged into the fcitx5 source code to obtain the source code of the input method for the target language. In response to a usage environment modification operation, the system retrieves input method-related files configured in the usage environment of the desktop system. These files configure the language environment, default input method, soft keyboard language switching function, and soft keyboard default language to adapt the usage environment to the target language, the fcitx5, and the soft keyboard. Upon receiving a character input request from the desktop system, the system invokes the input method's source code to display the soft keyboard corresponding to the target language. Furthermore, it associates the input operation performed on the soft keyboard with characters matching the target language indicated by the input operation.
2. The method according to claim 1, characterized in that, The process of building a Weston-based desktop system in response to a system build operation, using preset project tools, includes: The system obtains a command to retrieve the system build operation instruction, and downloads the file repository of the preset project tool, the system files of the build system, the configuration file of the application configuration tool, and the input method interface file of the fcitx5 based on the address carried in the command; the build system is used to compile the desktop system of the embedded system; the application configuration tool is used to build an application that runs on the image of the preset project tool; the versions of the preset project tool, the build system, and the application configuration tool are compatible. The compilation environment for the Weston system is built using the file repository, the system files of the build system, the configuration files of the application configuration tool, and the input method interface files of fcitx5. In the compilation environment, if the input method interface file does not contain a version of the preset project tool, a version addition operation is received in the input method interface file to add the version corresponding to the preset project tool. In the compilation environment, a language addition operation is performed in the target file to add the character encoding of the target language to the target file, resulting in a modified target file. The target file is the image file that needs to be compiled by the tool for compiling the preset project. In response to the received compilation command, the modified target file is compiled to build the desktop system.
3. The method according to claim 1, characterized in that, The process of compiling fcitx5 to the desktop system in response to a compilation operation includes: The compilation operation is received in the target configuration file of the preset project tool to add input method and soft keyboard configuration files to the target configuration file, which is used for users to add custom configurations; In the custom layer file of fcitx5, a first deletion operation is received to delete the relevant configuration library file of X11. The custom layer file of fcitx5 includes the relevant configuration library file of X11 and the relevant configuration library file of Weston. In the custom layer file of the soft keyboard, a second deletion operation is received to delete the relevant configuration library file of X11. The custom layer file of the soft keyboard includes the relevant configuration library file of X11 and the relevant configuration library file of Weston.
4. The method according to claim 1, characterized in that, In response to the source code modification operation, the fcitx5 source code, which includes the soft keyboard source code address, is obtained based on the code repository address. The modified fcitx5 source code is added to the fcitx5 configuration file of the preset project tool, and the remote download function of the fcitx5 source code is disabled. An error reporting item is added to the fcitx5 configuration file. The soft keyboard source code is then integrated into the fcitx5 source code to obtain the source code of the input method for the target language, including: Based on the setting operation of the code repository address, the source code of fcitx5 is obtained using the code repository address of fcitx5 indicated by the setting operation, and the branch of the code repository address includes the address of the source code of the soft keyboard; In the source code of fcitx5, a file addition operation is received to add a compressed file that causes compilation errors to the source code of fcitx5, thereby obtaining modified source code of fcitx5; the source code modification operation includes the file addition operation; In the configuration file of fcitx5 in the preset project tool, a source code addition operation is received to add the modified fcitx5 source code to the configuration file of fcitx5, and a blocking operation is received to block the remote download function of the fcitx5 source code; the source code modification operation includes the source code addition operation and the blocking operation; In the configuration file of fcitx5, a report item configuration operation is received to add an error reporting item to the configuration file of fcitx5, so as to suppress the error reports of the input method and software disk of fcitx5 during the compilation process.
5. The method according to claim 4, characterized in that, The process involves adding a compressed file that causes compilation errors to the fcitx5 source code, resulting in modified fcitx5 source code, including: The source code of fcitx5 was compiled based on the obtained source code compilation command, and the compilation error problem was obtained; Obtain the compressed file downloaded by the user based on the aforementioned compilation error; The compressed file is added to the network download file of the fcitx5 source code based on the file addition operation, and the file acquisition method of the network download file is changed from remote download to use local file.
6. The method according to claim 1, characterized in that, In response to the usage environment modification operation, the system obtains the input method-related files configured in the usage environment of the desktop system. These files configure the language environment, default input method, soft keyboard language switching function, and soft keyboard default language to adapt the usage environment to the target language, the Fcitx5, and the soft keyboard. In the usage environment, a language configuration operation is performed to configure the language environment of the usage environment as the target language; In the usage environment, an input method setting operation is performed to set the default input method as the input method of the target language; In the aforementioned usage environment, a switching setting operation is performed to configure the language switching function of the Fcitx5's soft keyboard; In the usage environment, an input method language setting operation is performed to set the default language of the soft keyboard.
7. The method according to any one of claims 1 to 6, characterized in that, The preset project tool is Yocto.
8. A character input method based on a Weston desktop system, characterized in that, The method includes: When the desktop system receives a character input request, it calls the source code of the input method for the target language to display the corresponding soft keyboard. The source code of the input method is obtained by compiling fcitx5 into the desktop system after the system build operation uses a preset project tool to build the desktop system based on Weston, and then in response to the source code modification operation, obtaining the fcitx5 source code containing the soft keyboard source code address based on the code repository address. The modified fcitx5 source code is added to the fcitx5 configuration file of the preset project tool, and the remote download function of the fcitx5 source code is blocked. An error reporting item is added to the fcitx5 configuration file. The soft keyboard source code is obtained by merging the fcitx5 source code into the fcitx5 source code. The desktop system's usage environment is configured with input method-related files in response to the usage environment modification operation. The input method-related files are used to configure the language environment, default input method, soft keyboard language switching function, and soft keyboard default language to make the usage environment compatible with the target language, fcitx5, and soft keyboard. Based on the input operation performed on the soft keyboard, associate the character indicated by the input operation with the target language; Display the characters at the target location on the desktop system.
9. An electronic device, characterized in that, The device includes a processor and a memory; the memory stores a program that is loaded and executed by the processor to implement the input method configuration method for a Weston-based desktop system as described in any one of 1 to 7; or, to implement the character input method for a Weston-based desktop system as described in claim 8.
10. A computer-readable storage medium, characterized in that, The storage medium stores a program that, when executed by a processor, is used to implement the input method configuration method for a Weston-based desktop system as described in any one of 1 to 7; or, to implement the character input method for a Weston-based desktop system as described in claim 8.
Citation Information
Patent Citations
Soft keyboard character input processing method and device
CN102298498A
Soft keyboard based on integrated input method
CN113515226A