a high efficiency Chinese/English input method on playdate
这是一个可以在 Playdate 上以较高效率输入中文与英文的输入法。
支持功能:中文双拼单字输入、emoji 与快捷短语、英文与数字键盘、输入光标滚动。
提供了一个便签应用作为使用示例,你可以在 release 中下载后 sideload 体验。你也可以把输入法嵌入到你的游戏或应用中进行使用。
This is an input method that can input Chinese and English with high efficiency on Playdate.
Supported functions: Chinese double-pin single word input, emoji and shortcut phrases, English and numeric keyboard, input cursor scrolling.
A Notes application is provided as a usage example. You can download it in release and sideload on your Playdate to experience. You can also embed the input method into your game or application.
Code
按钮中点击 Download ZIP
sync-tool
pip install -r requirements.txt
,安装所需依赖python sync.py
打开工具tips:
\n
source
to your project directory;import 'ime'
-- initialization IME
local zh_ime = IME()
--Start calling the IME method
--IME:startRunning(header_hint, ui_lang, text_area_custom, keyboard_init)
-- header_hint: Title hint, string
-- ui_lang: You can specify the prompt title and UI language during input(zh/en)
-- text_area_custom: Character-by-character table
-- keyboard_init: Specified init keyboard as "zh", "en", "num"
zh_ime:startRunning("Input your text", "en", {"s","a","m","p","l","e"}, "en")
--zh_ime:startRunning("请输入笔记", "zh", {"示","例","文","本"}, "zh")
function playdate.update()
gfx.sprite.update()
-- Put it in update to continue receiving user input
if zh_ime:isRunning() then -- Ends when the user submits/exits the input method
-- text_input: user's input content, return as split table
text_input = zh_ime:update()
else
print("user input:"..concatenateStrings(text_input))
print("is user discard:"..zh_ime:isUserDiscard()) -- Check whether the user submitted the content normally or discarded it
end
end