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: 165
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 1632 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 60 times

freypy
Prole
Posts: 2
Joined: Sun Sep 08, 2013 6:08 am

Re: Chinese IME candidate list display

Post by freypy » Sun Sep 23, 2018 11:21 am

GREAT WORK!
厉害,虽然我现在不关注Love2d了,但以前也很苦恼对IME支持很不好。
特意登录顶你一下。

Post Reply

Who is online

Users browsing this forum: bludburn, Exabot [Bot], Google [Bot] and 2 guests