Virtual keyboard with Chinese Input Method Editor(IME)

FREE
Publisher Mingchong LI
File size 33.82MB
Number of files 25
Latest version 0
Latest release date 2024-09-03 03:38:15
First release date 2024-09-03 03:38:15
Supported Unity versions 2018.4.2 or higher

Main Usage

  • Chinese fonts are needed. My recommendation is Noto, which is free.
  • Text Mesh Pro is compulsory.
  • [Optional] If you want to generate a new Chinese dictionary:
    • A Chinese word list under the Python directory, named wordfreq.txt, formatted as [Chinese word]\t[frequency].
    • pip install pinyin and run cn_parser.py.
    • Open Unity Editor, click Tools > Construct Py Prefab to open the generator, input the Chinese word list and hash txt path, and click generate to get the prefab.
      • For example, if the list you generated is Assets\WPinyin\Dictionary\PinyinWords-words.json, then input Assets\WPinyin\Dictionary\PinyinWords.
      • You can also select how many words you need in the list. The words will be selected based on frequency, with high-frequency words having higher priorities.
    • Open the KeyBoard prefab, drag the word prefab you just generated onto the pyCode field.
  • [Optional] If you want to generate a new English word dictionary:
    • An English word list under the Python directory, named en_freq.txt, with a title in the first line, formatted as [Word]\t[PoS]\t[Freq].
    • Run en_parser.py.

Code Usage

  • To set the target input field: KeyBoardManager.SetTargetField(TMP_InputField target).
  • To refresh and add input field focus listener: KeyBoardManager.GetAllInputFields().

Meta data

  • Author: Mingchong Li (email me)
  • Date: 10/8/2024
  • Version: 0.3