Giter Site home page Giter Site logo

ingameime-common's Introduction

IngameIME-Common

Common interface of IngameIME

How to use

Example: https://github.com/Windmill-City/IngameIME-Common/blob/main/testWnd/src/IngameIMEImpl.cpp

ImgameIME-Test

Initialize

Win32

// IngameIME: Initialize
HWND hWnd;
// TextServiceFramework for Windows 8 or above
MainContext::Main.InputCtx = IngameIME::CreateInputContextWin32(hWnd, IngameIME::API::TextServiceFramework);
// Imm32 for Windows XP/Vista/7
MainContext::Main.InputCtx = IngameIME::CreateInputContextWin32(hWnd, IngameIME::API::Imm32);

PreEdit & CandidateList

This library is designed for fullscreen games, so you are responsible for rendering: PreEdit, CandidateList and Input Mode Indicator

/**
 * @brief Receive PreEdit information and render it over the TextEdit
 *
 */
inputCtx->IngameIME::PreEditCallbackHolder::setCallback(
    [](const IngameIME::CompositionState state, const IngameIME::PreEditContext* ctx)
    {
        //Render your preedit
    });

/**
 * @brief Receive the CandidateList and draw it over the TextEdit
 *
 */
inputCtx->IngameIME::CandidateListCallbackHolder::setCallback(
    [](const IngameIME::CandidateListState state, const IngameIME::CandidateListContext* ctx)
    {
        //render your candidate list
    });

/**
 * @brief Receive the converted text and insert it into the TextEdit
 *
 */
inputCtx->IngameIME::CommitCallbackHolder::setCallback([](std::string commit)
    {
        // Insert commit into your text edit
    });

/**
 * @brief Receive the input mode change event, and show an indicator over the TextEdit
 *
 */
inputCtx->IngameIME::InputModeCallbackHolder::setCallback(
    [](IngameIME::InputMode mode)
    {
        //render your input mode indicator
    });

Update PreEdit Rect

MainContext::Main.InputCtx->setPreEditRect(Rect);

Activate Input Method

MainContext::Main.InputCtx->setActivated(true/false);

Bindings

Use SWIG to generate binding files

Currently supported bindings:

  • Java

ingameime-common's People

Contributors

windmill-city avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.