SlideShare a Scribd company logo
1 of 19
Download to read offline
PIME - 用 Python 和 JavaScript 快速
開發 Windows 中文輸入法
洪任諭 PCMan <pcman.tw@gmail.com>
2017-06-10@HKOSCon
|
講者簡介
●
Appier System Engineer
● 台大資訊工程研究所畢業
● 前台北榮總風濕免疫科醫師
● 國立陽明大學醫學系畢業
●
13 年自由軟體開發
– LXDE / LXQt 桌面環境
– PIME 輸入法平台
– 新酷音輸入法 windows port
– PCMan BBS client 全系列
– IE Tab Firefox 外掛
開發動機
●
Windows 輸入法開發門檻高
●
其他平台有不少高品質 open source 輸入法
●
與其重複 porting ,不如做個共同 framework
●
促進中文 NLP 相關研究應用
●
特殊中文輸入需求 ( 例 : 盲人點字輸入法 )
4
Windows 輸入法開發
●
Text Service Framework (TSF) 取代舊 IMM32 架構
●
必須以 C++ / COM (component object model) 實作
●
部分操作為非同步、複雜度高、文件少
●
須分別維護 32/64 bit 版本之 DLL
●
輸入法使用中無法變更 DLL ,須重開機,測試困難
●
寫錯會導致系統 crash
5
到了 Windows 8 以後 ...
惡夢的開始
6
Windows Store App
●
App 內禁用 IMM32 輸入法
●
輸入法運行在 app process 內,具權限限制 ( 類似
Linux cgroup)
●
Container 內預設無 IPC 機制 ( 建議用 Web)
●
若 app 無網路權限,不能連 web service
●
只能讀取 app 目錄、 Windows 、和 Program Files
●
輸入法只能裝在 Program Files
https://msdn.microsoft.com/en-us/library/windows/apps/hh967425.aspx
7
PIME To the Rescue!
8
PIME 特色 – What's New?
●
支援用 Python & JavaScript 開發 TSF 輸入法
●
不需要了解 Windows TSF 或 IMM32
●
完全不需寫 C++
●
Server/Client 架構,免自行處理 IPC / RPC
●
支援 Windows Vista - 10 (32 & 64 bit)
●
支援 Windows store apps
●
Native 系統輸入法選單 / 語言列整合
9
Why Python & Node.js?
●
開發簡單快速
●
使用者眾多、社群支援 ( 感謝 Taipei.py 協助 )
●
Scripting language 可邊修改邊測試
●
類似網站 backend 開發
●
標準 Web 技術,高普及率
10
PIME 架構
●
LibIME (C++)
– Thin C++ wrapper for TSF
– 隱藏 COM 實作細節 ( 輔助用 C++ 開發輸入法 )
●
PIME (python & node.js)
– Server/client 架構 + 輸入法模組
– 正確處理 Windows store app 權限設定
– 隱藏 IPC 細節
– 不須同時維護 32/64 bit 版本
11
PIME 系統架構
User input
(in apps)
PIMETextService.dll
(C++ thin client)
PIMELauncher.exe
(C++ proxy server)
Windows TSF
Python server Node.js server
Input method 1
(Python module)
Input method 2
(Python module)
Input method 3
(Node.js module)
Windows pipe
Stdio Redirect
Client
Reverse proxy
API servers
12
開發一個新輸入法
●
建立目錄
C:Program Files
(x86)PIMEpythoninput_methods<your_module>
●
提供 ime.json 描述此輸入法
●
繼承 TextService class 實做一個 python 模組
●
使用 regsvr32.exe 向系統註冊,之後輸入法選單內就會出現
●
工作管理員殺掉執行中的 python.exe (server)
●
繼續打字,此時 PIMELauncher.exe 會自動重啟 python.exe
●
打開 PIMEDebugConsole.exe 看除錯訊息
●
修改 installer 使之安裝此 module
https://github.com/EasyIME/PIME/tree/master/python/input_methods/meow
13
註冊輸入法 – ime.json
{
"name": " 我的輸入法 ", // 輸入法名稱 (UTF-8)
"version": "0.1", // 版本號
"guid": "{C5F37DA0-274E-4837-9B7C-9BB79FE85D9D}",
"locale": "zh-Hant-TW", // 語系 (RFC-4646 tag)
"fallbackLocale": "zh-TW", // 語系 (ISO 639)
"icon": "icon.ico", // 圖示
"moduleName": "my_ime", // python 模組名稱
"serviceName": "MyTextService" // python class 名稱
}
以系統管理員 (Administrator) 執行 :
Regsvr32 'C:Program Files (x86)PIMEx86PIMETextService.dll'
Regsvr32 'C:Program Files (x86)PIMEx64PIMETextService.dll'
14
Python API: 主要 classes
●
TextService
– onActivate() # 輸入法被啟用
– onDeactivate() # 輸入法被關閉
– filterKeyDown(keyEvent) # 要處理就回傳 True
– onKeyDown(keyEvent) # 處理使用者按鍵
●
KeyEvent
– isToggled(keyCode) # 檢查鍵盤 LED (caps lock 等 )
– isDown(keyCode) # 檢查按鍵有無被按下
15
TextService Class Methods
●
setCompositionString() # 組字區內容
●
setCommitString() # 送出到 app 的字串
●
setCursorPos() # 組字區游標位置
●
setCandidates() # 候選字清單
●
showCandidates() # 顯示候選字清單
●
customizeUI() # 設定字形大小 ... 等
16
已知 App Compatibility 問題
●
Internet Explorer 須關閉受保
護模式 ( 會阻擋 IPC)
●
IE 保護模式可能影響部份版
本 Office
●
Adobe Reader 須關閉安全保
護模式
●
Sandboxie 這類 sandbox
軟體內不能用
17
Challenges
●
防毒軟體阻擋 IPC ,誤判為木馬
●
Container / Sandbox 逐漸流行 (IE, Adobe
Reader, Sandboxie, …) 禁止 server/client IPC
●
其他原因造成 app 不相容 ( app 沒正確支援
TSF)
●
Crash Recovery
●
IMM32 仍廣泛使用中 ... ( 遊戲常見 )
18
Future
●
Refactor, 避免同樣 code 到處重複
●
重新設計盲人點字鍵盤支援
●
改善自訂 UI style
●
提昇穩定性
●
嘗試向下支援 IMM32 ( 部份遊戲需要 )
19
Join Now!
https://github.com/EasyIME/PIME

More Related Content

What's hot

Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systemsvampugani
 
CS9222 Advanced Operating System
CS9222 Advanced Operating SystemCS9222 Advanced Operating System
CS9222 Advanced Operating SystemKathirvel Ayyaswamy
 
Multithreading computer architecture
 Multithreading computer architecture  Multithreading computer architecture
Multithreading computer architecture Haris456
 
Unix operating system architecture with file structure
Unix operating system architecture with file structure Unix operating system architecture with file structure
Unix operating system architecture with file structure amol_chavan
 
High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...
High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...
High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...EUDAT
 
Intel Trusted eXecution Technology
Intel Trusted eXecution TechnologyIntel Trusted eXecution Technology
Intel Trusted eXecution TechnologyBibhu Biswal
 
Design issues of dos
Design issues of dosDesign issues of dos
Design issues of dosvanamali_vanu
 
Transport Layer Services : Multiplexing And Demultiplexing
Transport Layer Services : Multiplexing And DemultiplexingTransport Layer Services : Multiplexing And Demultiplexing
Transport Layer Services : Multiplexing And DemultiplexingKeyur Vadodariya
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed systemSunita Sahu
 
Advanced Operating System- Introduction
Advanced Operating System- IntroductionAdvanced Operating System- Introduction
Advanced Operating System- IntroductionDebasis Das
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented CommunicationDilum Bandara
 
Synchronization linux
Synchronization linuxSynchronization linux
Synchronization linuxSusant Sahani
 
Unix
UnixUnix
UnixErm78
 
Analysis of unix and windows
Analysis of unix and windowsAnalysis of unix and windows
Analysis of unix and windowsPartnered Health
 
Introduction to Distributed System
Introduction to Distributed SystemIntroduction to Distributed System
Introduction to Distributed SystemSunita Sahu
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 

What's hot (20)

Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
 
CS9222 Advanced Operating System
CS9222 Advanced Operating SystemCS9222 Advanced Operating System
CS9222 Advanced Operating System
 
Multithreading computer architecture
 Multithreading computer architecture  Multithreading computer architecture
Multithreading computer architecture
 
Unix operating system architecture with file structure
Unix operating system architecture with file structure Unix operating system architecture with file structure
Unix operating system architecture with file structure
 
High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...
High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...
High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...
 
Intel Trusted eXecution Technology
Intel Trusted eXecution TechnologyIntel Trusted eXecution Technology
Intel Trusted eXecution Technology
 
Design issues of dos
Design issues of dosDesign issues of dos
Design issues of dos
 
Transport Layer Services : Multiplexing And Demultiplexing
Transport Layer Services : Multiplexing And DemultiplexingTransport Layer Services : Multiplexing And Demultiplexing
Transport Layer Services : Multiplexing And Demultiplexing
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 
Advanced Operating System- Introduction
Advanced Operating System- IntroductionAdvanced Operating System- Introduction
Advanced Operating System- Introduction
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented Communication
 
IPV4 Frame Format
IPV4 Frame FormatIPV4 Frame Format
IPV4 Frame Format
 
Synchronization linux
Synchronization linuxSynchronization linux
Synchronization linux
 
Unix
UnixUnix
Unix
 
Radial Basis Function
Radial Basis FunctionRadial Basis Function
Radial Basis Function
 
Distributed Operating System_4
Distributed Operating System_4Distributed Operating System_4
Distributed Operating System_4
 
Analysis of unix and windows
Analysis of unix and windowsAnalysis of unix and windows
Analysis of unix and windows
 
Ip address
Ip addressIp address
Ip address
 
Introduction to Distributed System
Introduction to Distributed SystemIntroduction to Distributed System
Introduction to Distributed System
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 

Similar to PIME - 用 Python 和 JavaScript 快速開發 Windows 的中文輸入法

COSCUP 2019 國際開放原始碼專案經營 - 從失敗中學習
COSCUP 2019 國際開放原始碼專案經營 - 從失敗中學習COSCUP 2019 國際開放原始碼專案經營 - 從失敗中學習
COSCUP 2019 國際開放原始碼專案經營 - 從失敗中學習Jen Yee Hong
 
Python meetup 1
Python meetup 1Python meetup 1
Python meetup 1Vic Yang
 
Foundation of software development 1
Foundation of software development 1Foundation of software development 1
Foundation of software development 1netdbncku
 
[DevOpsDays] 硬體產業的DevOps導入與實踐 - 以工控產業為例
[DevOpsDays] 硬體產業的DevOps導入與實踐 - 以工控產業為例[DevOpsDays] 硬體產業的DevOps導入與實踐 - 以工控產業為例
[DevOpsDays] 硬體產業的DevOps導入與實踐 - 以工控產業為例TIM WANG
 
MPI use c language
MPI use c languageMPI use c language
MPI use c languageZongYing Lyu
 
基于Erlang的
基于Erlang的基于Erlang的
基于Erlang的hnoutman
 
2016-04-07-清大-國際化開源專案技術實務與經驗分享
2016-04-07-清大-國際化開源專案技術實務與經驗分享2016-04-07-清大-國際化開源專案技術實務與經驗分享
2016-04-07-清大-國際化開源專案技術實務與經驗分享Jen Yee Hong
 
Windows Mobile 多媒體應用程式開發
Windows Mobile 多媒體應用程式開發Windows Mobile 多媒體應用程式開發
Windows Mobile 多媒體應用程式開發Chui-Wen Chiu
 
Windows Mobile 多媒體應用程式開發
Windows Mobile 多媒體應用程式開發Windows Mobile 多媒體應用程式開發
Windows Mobile 多媒體應用程式開發建興 王
 
大话Php之性能
大话Php之性能大话Php之性能
大话Php之性能liqiang xu
 
Yupoo! (花瓣网/又拍云) 架构中的消息与任务系统
Yupoo! (花瓣网/又拍云) 架构中的消息与任务系统Yupoo! (花瓣网/又拍云) 架构中的消息与任务系统
Yupoo! (花瓣网/又拍云) 架构中的消息与任务系统Dahui Feng
 
Baidu LSP and DISQL for Log Analysis
Baidu LSP and DISQL for Log AnalysisBaidu LSP and DISQL for Log Analysis
Baidu LSP and DISQL for Log AnalysisXiaoming Chen
 
用PY实现"Go元编程"
用PY实现"Go元编程"用PY实现"Go元编程"
用PY实现"Go元编程"Weng Wei
 
Learning python logging module
Learning python logging moduleLearning python logging module
Learning python logging moduledotecho
 
[嵌入式系統] 嵌入式系統進階
[嵌入式系統] 嵌入式系統進階[嵌入式系統] 嵌入式系統進階
[嵌入式系統] 嵌入式系統進階Simen Li
 
Elixir 好用的編輯器
Elixir 好用的編輯器Elixir 好用的編輯器
Elixir 好用的編輯器bobo52310
 

Similar to PIME - 用 Python 和 JavaScript 快速開發 Windows 的中文輸入法 (20)

COSCUP 2019 國際開放原始碼專案經營 - 從失敗中學習
COSCUP 2019 國際開放原始碼專案經營 - 從失敗中學習COSCUP 2019 國際開放原始碼專案經營 - 從失敗中學習
COSCUP 2019 國際開放原始碼專案經營 - 從失敗中學習
 
Python meetup 1
Python meetup 1Python meetup 1
Python meetup 1
 
Foundation of software development 1
Foundation of software development 1Foundation of software development 1
Foundation of software development 1
 
[DevOpsDays] 硬體產業的DevOps導入與實踐 - 以工控產業為例
[DevOpsDays] 硬體產業的DevOps導入與實踐 - 以工控產業為例[DevOpsDays] 硬體產業的DevOps導入與實踐 - 以工控產業為例
[DevOpsDays] 硬體產業的DevOps導入與實踐 - 以工控產業為例
 
MPI use c language
MPI use c languageMPI use c language
MPI use c language
 
基于Erlang的
基于Erlang的基于Erlang的
基于Erlang的
 
建置Python開發環境
建置Python開發環境建置Python開發環境
建置Python開發環境
 
專題-2017Linux Driver 實現
專題-2017Linux Driver 實現專題-2017Linux Driver 實現
專題-2017Linux Driver 實現
 
2016-04-07-清大-國際化開源專案技術實務與經驗分享
2016-04-07-清大-國際化開源專案技術實務與經驗分享2016-04-07-清大-國際化開源專案技術實務與經驗分享
2016-04-07-清大-國際化開源專案技術實務與經驗分享
 
Jobforcompal
JobforcompalJobforcompal
Jobforcompal
 
Windows Mobile 多媒體應用程式開發
Windows Mobile 多媒體應用程式開發Windows Mobile 多媒體應用程式開發
Windows Mobile 多媒體應用程式開發
 
Windows Mobile 多媒體應用程式開發
Windows Mobile 多媒體應用程式開發Windows Mobile 多媒體應用程式開發
Windows Mobile 多媒體應用程式開發
 
大话Php之性能
大话Php之性能大话Php之性能
大话Php之性能
 
Yupoo! (花瓣网/又拍云) 架构中的消息与任务系统
Yupoo! (花瓣网/又拍云) 架构中的消息与任务系统Yupoo! (花瓣网/又拍云) 架构中的消息与任务系统
Yupoo! (花瓣网/又拍云) 架构中的消息与任务系统
 
Baidu LSP and DISQL for Log Analysis
Baidu LSP and DISQL for Log AnalysisBaidu LSP and DISQL for Log Analysis
Baidu LSP and DISQL for Log Analysis
 
Xpp
XppXpp
Xpp
 
用PY实现"Go元编程"
用PY实现"Go元编程"用PY实现"Go元编程"
用PY实现"Go元编程"
 
Learning python logging module
Learning python logging moduleLearning python logging module
Learning python logging module
 
[嵌入式系統] 嵌入式系統進階
[嵌入式系統] 嵌入式系統進階[嵌入式系統] 嵌入式系統進階
[嵌入式系統] 嵌入式系統進階
 
Elixir 好用的編輯器
Elixir 好用的編輯器Elixir 好用的編輯器
Elixir 好用的編輯器
 

More from Jen Yee Hong

2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - english2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - englishJen Yee Hong
 
Basic c++ 11/14 for python programmers
Basic c++ 11/14 for python programmersBasic c++ 11/14 for python programmers
Basic c++ 11/14 for python programmersJen Yee Hong
 
COSCUP 2016: 開源軟硬體實做全套電子鼓(python + RPi)
COSCUP 2016: 開源軟硬體實做全套電子鼓(python + RPi)COSCUP 2016: 開源軟硬體實做全套電子鼓(python + RPi)
COSCUP 2016: 開源軟硬體實做全套電子鼓(python + RPi)Jen Yee Hong
 
TPET8演講: 非典型程式教育
TPET8演講: 非典型程式教育TPET8演講: 非典型程式教育
TPET8演講: 非典型程式教育Jen Yee Hong
 

More from Jen Yee Hong (6)

2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - english2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - english
 
Basic c++ 11/14 for python programmers
Basic c++ 11/14 for python programmersBasic c++ 11/14 for python programmers
Basic c++ 11/14 for python programmers
 
COSCUP 2016: 開源軟硬體實做全套電子鼓(python + RPi)
COSCUP 2016: 開源軟硬體實做全套電子鼓(python + RPi)COSCUP 2016: 開源軟硬體實做全套電子鼓(python + RPi)
COSCUP 2016: 開源軟硬體實做全套電子鼓(python + RPi)
 
TPET8演講: 非典型程式教育
TPET8演講: 非典型程式教育TPET8演講: 非典型程式教育
TPET8演講: 非典型程式教育
 
Py drum
Py drumPy drum
Py drum
 
Gtk to qt
Gtk to qtGtk to qt
Gtk to qt
 

PIME - 用 Python 和 JavaScript 快速開發 Windows 的中文輸入法

  • 1. PIME - 用 Python 和 JavaScript 快速 開發 Windows 中文輸入法 洪任諭 PCMan <pcman.tw@gmail.com> 2017-06-10@HKOSCon |
  • 2. 講者簡介 ● Appier System Engineer ● 台大資訊工程研究所畢業 ● 前台北榮總風濕免疫科醫師 ● 國立陽明大學醫學系畢業 ● 13 年自由軟體開發 – LXDE / LXQt 桌面環境 – PIME 輸入法平台 – 新酷音輸入法 windows port – PCMan BBS client 全系列 – IE Tab Firefox 外掛
  • 3. 開發動機 ● Windows 輸入法開發門檻高 ● 其他平台有不少高品質 open source 輸入法 ● 與其重複 porting ,不如做個共同 framework ● 促進中文 NLP 相關研究應用 ● 特殊中文輸入需求 ( 例 : 盲人點字輸入法 )
  • 4. 4 Windows 輸入法開發 ● Text Service Framework (TSF) 取代舊 IMM32 架構 ● 必須以 C++ / COM (component object model) 實作 ● 部分操作為非同步、複雜度高、文件少 ● 須分別維護 32/64 bit 版本之 DLL ● 輸入法使用中無法變更 DLL ,須重開機,測試困難 ● 寫錯會導致系統 crash
  • 5. 5 到了 Windows 8 以後 ... 惡夢的開始
  • 6. 6 Windows Store App ● App 內禁用 IMM32 輸入法 ● 輸入法運行在 app process 內,具權限限制 ( 類似 Linux cgroup) ● Container 內預設無 IPC 機制 ( 建議用 Web) ● 若 app 無網路權限,不能連 web service ● 只能讀取 app 目錄、 Windows 、和 Program Files ● 輸入法只能裝在 Program Files https://msdn.microsoft.com/en-us/library/windows/apps/hh967425.aspx
  • 7. 7 PIME To the Rescue!
  • 8. 8 PIME 特色 – What's New? ● 支援用 Python & JavaScript 開發 TSF 輸入法 ● 不需要了解 Windows TSF 或 IMM32 ● 完全不需寫 C++ ● Server/Client 架構,免自行處理 IPC / RPC ● 支援 Windows Vista - 10 (32 & 64 bit) ● 支援 Windows store apps ● Native 系統輸入法選單 / 語言列整合
  • 9. 9 Why Python & Node.js? ● 開發簡單快速 ● 使用者眾多、社群支援 ( 感謝 Taipei.py 協助 ) ● Scripting language 可邊修改邊測試 ● 類似網站 backend 開發 ● 標準 Web 技術,高普及率
  • 10. 10 PIME 架構 ● LibIME (C++) – Thin C++ wrapper for TSF – 隱藏 COM 實作細節 ( 輔助用 C++ 開發輸入法 ) ● PIME (python & node.js) – Server/client 架構 + 輸入法模組 – 正確處理 Windows store app 權限設定 – 隱藏 IPC 細節 – 不須同時維護 32/64 bit 版本
  • 11. 11 PIME 系統架構 User input (in apps) PIMETextService.dll (C++ thin client) PIMELauncher.exe (C++ proxy server) Windows TSF Python server Node.js server Input method 1 (Python module) Input method 2 (Python module) Input method 3 (Node.js module) Windows pipe Stdio Redirect Client Reverse proxy API servers
  • 12. 12 開發一個新輸入法 ● 建立目錄 C:Program Files (x86)PIMEpythoninput_methods<your_module> ● 提供 ime.json 描述此輸入法 ● 繼承 TextService class 實做一個 python 模組 ● 使用 regsvr32.exe 向系統註冊,之後輸入法選單內就會出現 ● 工作管理員殺掉執行中的 python.exe (server) ● 繼續打字,此時 PIMELauncher.exe 會自動重啟 python.exe ● 打開 PIMEDebugConsole.exe 看除錯訊息 ● 修改 installer 使之安裝此 module https://github.com/EasyIME/PIME/tree/master/python/input_methods/meow
  • 13. 13 註冊輸入法 – ime.json { "name": " 我的輸入法 ", // 輸入法名稱 (UTF-8) "version": "0.1", // 版本號 "guid": "{C5F37DA0-274E-4837-9B7C-9BB79FE85D9D}", "locale": "zh-Hant-TW", // 語系 (RFC-4646 tag) "fallbackLocale": "zh-TW", // 語系 (ISO 639) "icon": "icon.ico", // 圖示 "moduleName": "my_ime", // python 模組名稱 "serviceName": "MyTextService" // python class 名稱 } 以系統管理員 (Administrator) 執行 : Regsvr32 'C:Program Files (x86)PIMEx86PIMETextService.dll' Regsvr32 'C:Program Files (x86)PIMEx64PIMETextService.dll'
  • 14. 14 Python API: 主要 classes ● TextService – onActivate() # 輸入法被啟用 – onDeactivate() # 輸入法被關閉 – filterKeyDown(keyEvent) # 要處理就回傳 True – onKeyDown(keyEvent) # 處理使用者按鍵 ● KeyEvent – isToggled(keyCode) # 檢查鍵盤 LED (caps lock 等 ) – isDown(keyCode) # 檢查按鍵有無被按下
  • 15. 15 TextService Class Methods ● setCompositionString() # 組字區內容 ● setCommitString() # 送出到 app 的字串 ● setCursorPos() # 組字區游標位置 ● setCandidates() # 候選字清單 ● showCandidates() # 顯示候選字清單 ● customizeUI() # 設定字形大小 ... 等
  • 16. 16 已知 App Compatibility 問題 ● Internet Explorer 須關閉受保 護模式 ( 會阻擋 IPC) ● IE 保護模式可能影響部份版 本 Office ● Adobe Reader 須關閉安全保 護模式 ● Sandboxie 這類 sandbox 軟體內不能用
  • 17. 17 Challenges ● 防毒軟體阻擋 IPC ,誤判為木馬 ● Container / Sandbox 逐漸流行 (IE, Adobe Reader, Sandboxie, …) 禁止 server/client IPC ● 其他原因造成 app 不相容 ( app 沒正確支援 TSF) ● Crash Recovery ● IMM32 仍廣泛使用中 ... ( 遊戲常見 )
  • 18. 18 Future ● Refactor, 避免同樣 code 到處重複 ● 重新設計盲人點字鍵盤支援 ● 改善自訂 UI style ● 提昇穩定性 ● 嘗試向下支援 IMM32 ( 部份遊戲需要 )