Skip to content

openvanilla/McTibetimWeb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

McTibetimWeb - 小麥藏文輸入法 Web/Chrome OS/PIME 版本

Static Badge ChromeOS Static Badge CI Ask DeepWiki codecov

English

McTibetimWeb uses TypeScript/JavaScript to build a cross-platform Tibetan input method. It can run on the following platforms:

  • Web
  • Chrome OS
  • Windows (via PIME)

Supported keyboard layouts:

  • Dzongkha
  • Sambhota Keymap #1
  • Sambhota Keymap #2
  • TCC Keyboard 1
  • TCC Keyboard 2
  • Wylie

Dzongkha AltGr Note

The Dzongkha layout uses four keyboard layers: Normal, Shift, AltGr, and Shift+AltGr. To access the third and fourth layers, use the right-side Alt key (AltGr) together with the base key, or Shift+AltGr for the fourth layer.

Depending on the platform, AltGr may be reported as AltGraph, Right Alt, or Ctrl+Alt. McTibetimWeb maps Dzongkha's special keys through the platform's AltGr handling, so if a key does not match the printed Dzongkha layout, check how your operating system exposes AltGr.

On Chrome OS, the extension currently does not process Alt or AltGr key combinations, so the Dzongkha AltGr layers are not available there yet.

This input method is developed using TypeScript, so it can be compiled on Windows, macOS, and Linux platforms. Please install Node.js and Git first, then run the build commands in your terminal.

Most Node.js versions should compile this project successfully; you can also check the Node.js version we use in our CI/CD.

Build

Web Version

McTibetimWeb provides a Web version, suitable for use in environments connected to the internet with a physical keyboard, where installing an input method is inconvenient. Examples include public computers, school classrooms, iPad tablets, and various e-paper devices equipped with keyboards. Since no additional input method installation is required, it is also highly suitable for teaching. The web version features simple colors, avoiding extra gradients, animations, and other elements that might interfere with reading, enabling users to focus on using the input method, and is specifically tailored for e-paper devices.

To build the web version, enter:

npm install
npm run build

Open output/example/index.html in a browser to start using the input method.

You can also embed McTibetimWeb into your own webpage by referring to how it is done in output/example/index.html.

Chrome OS Version

To build it yourself, run the following in your terminal:

npm install
npm run build:chromeos

Then open chrome://extensions/ in Chrome OS, enable "Developer mode", click on "Load unpacked", and select the output/chromeos directory to install the input method. You can choose to transfer output/chromeos to your Chrome OS device, or compile directly on Chrome OS using the Linux subsystem (Crostini).

Windows via PIME

In Windows, input methods are tightly bound to the languages installed on the system. Before installing McTibetimWeb for PIME, please install the "Tibetan" language pack in Windows Settings first. This allows the Windows system to recognize the "Tibetan" language, enabling PIME to use McTibetimWeb.

First, you need to install PIME on your Windows system; please visit the PIME project page to download it. Note: During the installation process, be sure to check Node.js support, otherwise this input method cannot be used — PIME does not install Node.js support by default.

Please run the following in your Windows Command Prompt or PowerShell:

npm install
npm run build:pime

Then copy all files under the output/pime directory into the node\input_methods\mctibetim directory within the PIME installation path (usually C:\Program Files (x86)\PIME\node\input_methods\mctibetim). You will need administrator privileges. For the first-time use, execute run_register_ime.bat in this directory to register McTibetimWeb with the Windows system. Next, restart the PIME Launcher, and you will be able to select McTibetimWeb from the input method list.

If you don't see McTibetimWeb in the system list, please go to Windows system settings and verify that McTibetimWeb has been added under the "Language" settings.

Verification Commands

Common verification commands during development:

npm run ts-build
npm run test -- --runInBand
npm run eslint

If you want to generate code coverage, you can also run:

npm run test:coverage

繁體中文

McTibetimWeb 使用 TypeScript/JavaScript 技術,打造一套跨平台的藏文輸入法。可以運行於以下平台:

  • Web
  • Chrome OS
  • Windows (透過 PIME)

支援以下鍵盤配置

  • Dzongkha
  • Sambhota Keymap #1
  • Sambhota Keymap #2
  • TCC Keyboard 1
  • TCC Keyboard 2
  • Wylie

Dzongkha AltGr 注意事項

Dzongkha 鍵盤配置使用四層按鍵:NormalShiftAltGrShift+AltGr。要輸入第三層與第四層字元時,請使用右側 Alt 鍵(AltGr)搭配對應按鍵,第四層則使用 Shift+AltGr

不同平台對 AltGr 的回報方式可能不同,可能會顯示成 AltGraphRight Alt,或 Ctrl+Alt。McTibetimWeb 會依照平台提供的 AltGr 鍵盤事件來對應 Dzongkha 特殊字元;如果輸出的字元與鍵帽不符,請先確認作業系統是如何映射 AltGr

目前 Chrome OS 擴充功能版本不會處理 AltAltGr 組合鍵,所以 Dzongkha 的 AltGr 兩層按鍵暫時無法在 Chrome OS 上使用。

這套輸入法使用 TypeScript 開發,所以在 Windows、macOS、Linux 平台上都可以編譯。請先安裝 Node.js 以及 Git,然後在終端機中執行編譯命令。

大部分的 Node.js 版本應該都可以成功編譯這個專案,您也可以查看我們在 CI/CD 中使用的 Node.js 版本。

編譯

Web 版

小麥藏文輸入法提供 Web 版本,適合在連接網路與實體鍵盤,但是不方便安裝輸入法的環境下使用。例如公共電腦、學校教室、iPad 平板,以及各種有鍵盤的電子紙裝置等。由於不需要額外安裝輸入法,也適合用在教學場合。網頁版本採用簡單的色彩,避免額外的漸層、動畫,以及其他可能會對閱讀造成干擾的元素,讓使用者可以專注在輸入法的使用上,而且特地配合電子紙裝置。

編譯 web 版時,請輸入:

npm install
npm run build

用瀏覽器打開 output/example/index.html 就可以使用輸入法了。

您也可以透過參考 output/example/index.html 裡頭的方式,將小麥藏文輸入法嵌入到您的網頁中。

Chrome OS 版

如果要要自行編譯,請在終端機中執行:

npm install
npm run build:chromeos

然後在 Chrome OS 上開啟「chrome://extensions/」,並啟用「開發人員模式」,接著按下「載入已解壓縮的擴充功能」,選擇 output/chromeos 目錄,就可以安裝輸入法了。您可以選擇將 output/chromeos 傳到你的 Chrome OS 裝置上,或是直接在 Chrome OS 上使用 Linux 子系統(Crostini)編譯。

Windows (PIME)

在 Windows 的設計中,輸入法是與系統所安裝的語言緊密綁定的。在安裝小麥藏文輸入法 PIME 之前,請先在 Windows 設定中,安裝「藏文」語言包,這樣 Windows 系統才會知道有「藏文」這個語言,進而讓 PIME 能夠使用小麥藏文輸入法。

首先您要在您的 Windows 系統上安裝 PIME,請前往 PIME 的專案頁面下載。請注意,在安裝的過程中,務必要勾選 Node.js 支援,否則無法使用這個輸入法— PIME 預設是不安裝 Node.js 支援的。

請在 Windows 的命令提示字元(Command Prompt)或 PowerShell 中執行:

npm install
npm run build:pime

然後將 output/pime 目錄下的所有檔案複製到 PIME 安裝目錄下的 node\input_methods\mctibetim 目錄中(通常是 C:\Program Files (x86)\PIME\node\input_methods\mctibetim),您會需要用到系統管理員權限。第一次使用時,請在這個目錄中,執行一次 run_register_ime.bat,將小麥藏文輸入法註冊到 Windows 系統中。接著重新啟動 PIME 啟動器(PIME Launcher),就可以在輸入法清單中選擇小麥藏文輸入法了。

如果在系統清單中,沒有看到小麥藏文輸入法,請進入 Windows 的系統設定中,確認「語言」設定中已經加入了小麥藏文輸入法。

驗證指令

開發時常用的驗證指令如下:

npm run ts-build
npm run test -- --runInBand
npm run eslint

如果要產生 coverage,可以另外執行:

npm run test:coverage