Git Product home page Git Product logo

Comments (2)

lotem avatar lotem commented on June 26, 2024

需要編程實現。
現有程序對數字鍵盤的處理是用來選字。

from home.

nlat avatar nlat commented on June 26, 2024

试了一下,可以用 lua 做,大致像下面这样:

-- commit_kbn.lua

local s = {}

function s.init( env )
    s.kb = { 'KP_0', 'KP_1', 'KP_2', 'KP_3', 'KP_4', 'KP_5', 'KP_6', 'KP_7', 'KP_8', 'KP_9' }
    for i, v in ipairs( s.kb ) do s.kb[v] = i - 1 end
end

function s.func( key, env )
    if key:release() or key:alt() or key:super() or key:ctrl() then return 2 end

    local context = env.engine.context
    local num = s.kb[key:repr()]
    if context:is_composing() and num then
        context:commit()
        context:commit_text( num )
        return 1
    end

    return 2
end
engine:
  processors:
    - lua_processor@*commit_kbn

非常感谢您提出的创意方案,我是一个 0 基础的小白,我学习学习怎样应用它,这对我来说很有帮助!再次感谢!

from home.

Related Issues (20)

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.