libchewing 更新,0.6.0 釋出

新酷音的 libchewing 專案釋出了 0.6.0,上次的 release 的 0.5.1 是 2016 年了:「Release v0.6.0 · chewing/libchewing」。

This release contains many improvements and bug fixes. It's the first release since 2016. We have started a major rewrite in Rust so we expect to have more frequent releases in the following months.

Contributors to chewing/libchewing 這邊可以看到近期主要是 kanru 的貢獻,然後就如同上面引用的 release note 中提到的,目前朝著 Rust 這邊開始走。

另外一個比較大的改變 (build stage 的) 是把本來用 autotools 的部分換成 cmake 了:

Add several CMake presets for supported configurations [Kan-ru Chen]. #424

CMake minimum version changed to 3.21.0

Autotools build tools are removed. CMake is the recommended way to build libchewing.

整體看起來,這版看起來主要是把這七年多的各種 bugfix 整理起來出一個 release 了,讓各 repository 可以更新一波?

自己小修一下 fcitx5-mcbopomofo 的選詞數量

之前有提過「Linux 上 fcitx5 的小麥輸入法」,在我自己桌面都換成 Ubuntu 22.04 後都能裝了,就用了一陣子。

但選字的數量一直覺得怪怪的,本來的數量是九個,像是這樣:

看了一下 Windows 上的新酷音,介面上因為設計成 3x3 的關係,所以看起來就不會不舒服:

所以就在想,如果是一行的為什麼不是十個?翻了翻程式碼,看起來在 src/McBopomofo.cpp 這邊:

  if (keysConfig == SelectionKeys::Key_asdfghjkl) {
    selectionKeys_.emplace_back(FcitxKey_a);
    selectionKeys_.emplace_back(FcitxKey_s);
    selectionKeys_.emplace_back(FcitxKey_d);
    selectionKeys_.emplace_back(FcitxKey_f);
    selectionKeys_.emplace_back(FcitxKey_g);
    selectionKeys_.emplace_back(FcitxKey_h);
    selectionKeys_.emplace_back(FcitxKey_j);
    selectionKeys_.emplace_back(FcitxKey_k);
    selectionKeys_.emplace_back(FcitxKey_l);
  } else if (keysConfig == SelectionKeys::Key_asdfzxcvb) {
    selectionKeys_.emplace_back(FcitxKey_a);
    selectionKeys_.emplace_back(FcitxKey_s);
    selectionKeys_.emplace_back(FcitxKey_d);
    selectionKeys_.emplace_back(FcitxKey_f);
    selectionKeys_.emplace_back(FcitxKey_z);
    selectionKeys_.emplace_back(FcitxKey_x);
    selectionKeys_.emplace_back(FcitxKey_c);
    selectionKeys_.emplace_back(FcitxKey_v);
    selectionKeys_.emplace_back(FcitxKey_b);
  } else {
    selectionKeys_.emplace_back(FcitxKey_1);
    selectionKeys_.emplace_back(FcitxKey_2);
    selectionKeys_.emplace_back(FcitxKey_3);
    selectionKeys_.emplace_back(FcitxKey_4);
    selectionKeys_.emplace_back(FcitxKey_5);
    selectionKeys_.emplace_back(FcitxKey_6);
    selectionKeys_.emplace_back(FcitxKey_7);
    selectionKeys_.emplace_back(FcitxKey_8);
    selectionKeys_.emplace_back(FcitxKey_9);
  }

看起來是為了跟 asdfghjkl 九個鍵對齊設計的,但這樣覺得不舒服... 所以在 selectionKeys_.emplace_back(FcitxKey_9); 後面加上 selectionKeys_.emplace_back(FcitxKey_0);,再重新編 + 裝 + 重啟後再輸入就變成十個了:

這樣自己用是沒問題,但暫時想不到怎麼找出一個好方法併回去... 也許多一組 SelectionKeys::Key_1234567890

Linux 上 fcitx5 的小麥輸入法

Twitter 上看到小麥輸入法宣佈支援 Linuxfcitx5 的消息:

專案在 GitHub 上的「fcitx5-mcbopomofo: 小麥注音輸入法 fcitx5 模組」這邊,因為我自己的 Ubuntu 20.04 桌機還是跑 fcitx 4.x (用酷音輸入法,裝的是 fcitx-chewing 這個套件),暫時先放著好了,但幫忙宣傳一下...

也許可以找機會練習包到 Ubuntu 的 PPA 上面,等有空吧...

Mac 上的小麥輸入法大改版 (2.0,不過目前已經又出 2.0.1 了)

Twitter 上看到 zonble 的推文:

整串可以看「Thread by @zonble on Thread Reader App」這邊,在 GitHub 上面的 release note 也可以參考:「Release 2.0 · openvanilla/McBopomofo」,不過要注意如果要下載的話,記得抓 bugfix 後的版本:「Release 2.0.1 · openvanilla/McBopomofo」。

對我來說最大的進步就是詞庫這塊了,可以直接加進去學習方便不少...

密碼輸入上的 UX

Hacker News 上看到「Gmail password first character is case insensitive on mobile device (support.google.com)」這篇,在講密碼輸入上的 UX。

在 Hacker News 上的討論看到這則:

This is a well-understood feature. Facebook does the same thing[0].

Quote:

Facebook actually accepts three forms of your password:

* Your original password.

* Your original password with the first letter capitalized. This is only for mobile devices, which sometimes capitalize the first character of a word.

* Your original password with the case reversed, for those with a caps lock key on.

[0]: https://www.zdnet.com/article/facebook-passwords-are-not-case-sensitive-update/

接受三種密碼,第一種是完全正確的密碼,第二種是第一個字如果是大寫時的密碼 (在行動裝置上可能的行為),第三種是大小寫全部相反的密碼,這在沒注意到 caps lock 時會發生。

強度不會削弱太多,但對於 user experience 好很多的設計。

讓手機上瀏覽器自動帶出數字鍵盤的方式

在「HTML attributes to improve your users' two factor authentication experience」這邊看到關於讓使用者輸入 2FA (通常是數字) 比較流暢的設定。

原始是上面這張這樣,目標是希望下面這張這樣,當透過 SMS 2FA 時可以提供選項直接貼上,而且也自動帶出數字鍵盤:

給出的幾個重點在於 inputmodepattern 以及 autocomplete

<input
  type="text"
  name="token"
  id="token"
  inputmode="numeric"
  pattern="[0-9]*"
  autocomplete="one-time-code"
/>

查了一下 caniuse.com 上面的支援度,pattern 基本上都支援了,autocomplete 在這邊用到的 one-time-code 基本上也沒問題,只有 inputmode 這邊支援度比較差,IE11 (基本上不會更新了)、FirefoxSafari 沒支援。

Tails 3.13 把注音輸入法的 bugfix 放進去了

在「Tails 裡的注音輸入法終於修好了...」這邊有提到 Tails 的注音輸入法爛掉很久的問題,以及對應的 bugfix 測的差不多了,不過當時一直還沒確定會不會在這個版本修正。

剛剛在「Tails 3.13 is out」這邊的公告裡看到把這個 bugfix 納入 Tails 3.13 了:

Add support for the Bopomofo input method for Chinese using the Chewing library and improve support for the Pinyin input method. (#11292)

後續要再來測操作順暢性的問題了...

Tails 裡的注音輸入法終於修好了...

Tails 是一個獨立的 Debian 作業系統,強調匿名性,裡面有很多環境的預設值是為了避免 IP 位置以及其他資訊洩漏而設計。另外因為是獨立完整的作業系統,可以找台電腦用 USB 開機直接跑起來,避免 OS 被埋木馬的問題 (當然如果硬體有問題的話還是沒辦法)。

大多數人用 Tails 的人應該還是拿來跑 Tor Browser,不過我在用的時候發現注音輸入法有問題 (大約三年前?),就跑去開了一張 bug ticket 回報:「Bopomofo input for Chinese is not working」,從裡面的討論可以看到中間有 ping 我,但是我忘記回應了... 直到最近動了起來剛好有看到,就抓了 snapshot ISO 幫忙測了一下,畢竟沒幾個用注音的人在上面可以確認 :o

目前看起來輸入法本身的問題修差不多了,而且有機會在下個版本看到 (或是下下個版本,要看會不會進這次的 merge window)。

想要測試的人,除了要抓這個版本的 snapshot ISO 外 (在 bug ticket 裡有連結),在 Tails 開機時,要記得要在 Language 的地方選擇台灣:

開進去後就可以看到注音輸入法了,用 Super + Space 可以切換輸入法:(Super 通常指的是微軟鍵,或是 Mac 右邊的 Command 鍵,因為左邊的 Command 可能被當 Host key 了)

還有一些小 bug 要另外再處理 (像是切換輸入法的 input focus 會跑掉),不過比以前完全不能用好多了...

最近很紅的密碼...

前幾天在 Twitter 看到,剛剛在 Hacker News Daily 上的整理又看到:

老外在研究的時候發現這個密碼看起來夠長 (12 個字),而且也還算安全 (有英文與數字,看起來無意義),但卻發現被大量重複使用,而不只是單一帳號在用,就很好奇發生這是什麼東西...

對於台灣人來說應該是很熟悉了,這是注音輸入法的「我的密碼」:

出自維基百科的「File:Keyboard layout Zhuyin.svg

非拼音類的輸入法應該都會產生一樣的困惑...

Firefox 的 Input 要支援 Date/Time 格式了

Hacker News Daily 上看到六月的文章,看起來是 Firefox 下一個版本要支援所以冒出來了:「Date/Time Inputs Enabled on Nightly」。

然後支援多國語系:(官方拿的範例剛好就是中文)

依照 MDN 上的說明「<input type="date">」以及 Can I Use 往站上的說明「Can I use Date and time input types」,可以看到這樣又多了一個瀏覽器啦:

Safari 被稱為新世代的 IE 真不是蓋的 XDDD