Giter VIP home page Giter VIP logo

playdate-chinese-ime's Introduction

header.jpg

Chinese/English IME for 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.

CustomSkin.jpg

如何使用 notes 与电脑端的同步编辑工具?

sync-tool-screenshot.png

  1. 安装 python
  2. 在 GitHub 顶部 Code 按钮中点击 Download ZIP
  3. 解压后,进入目录 sync-tool
  4. 在目录下执行命令:pip install -r requirements.txt,安装所需依赖
  5. 在目录下执行 python sync.py 打开工具

tips:

  • 在 excel 中编辑时,需要换行地方可以写 \n

How to embed IME into your app

  1. Duplicate files under source to your project directory;
  2. Code snippet reference:
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

Known issues

  • 可能性能不佳

Features wish to add

  • 实现一个简单的排版引擎来处理文本换行;
  • 通过 menu 切换文本编辑与光标编辑模式,支持光标移动修改;
  • 支持滚动编辑与显示;
  • 支持限制输入字数;
  • 添加默认的进出入动画;
  • 优化提升性能;

Thanks

playdate-chinese-ime's People

Contributors

a11might avatar antonoko avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.