Chinese IME candidate list display

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
Alexar
Party member
Posts: 159
Joined: Thu Feb 05, 2015 1:57 am
Location: Chengdu,China

Chinese IME candidate list display

Post by Alexar » Sun Jul 15, 2018 9:29 am

I've just figured out how to enable the candidate list display for windows Chinese IME. This problem disturbed me for long time.
I've sent an issue to megasource repo in bitbucket.
here is what we get
GIF2.gif
GIF2.gif (143.22 KiB) Viewed 363 times
replace the sdl2.dll in the love folder. and voila.
oh, to set the caret position for the candidate list, you have to use user32.dll for windows.

Code: Select all

local ffi = require("ffi")
ffi.cdef [[
long CreateCaret(long hwnd,long map,long width,long height);
long GetForegroundWindow(void);
long SetCaretPos(long x,long y);
long SetFocus(long hwnd);]]
u32=ffi.load("User32")
local gamehwnd=u32.GetForegroundWindow()
u32.SetFocus(gamehwnd)
u32.CreateCaret(gamehwnd,0,4,20)
--u32.SetCaretPos(x,y)
SDL2.zip
built with vs2017 x64
(424.56 KiB) Downloaded 25 times

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests