add ime support
This commit is contained in:
parent
3171286c1f
commit
4638fb1ea5
7 changed files with 162 additions and 40 deletions
|
@ -52,10 +52,10 @@ return function(core, input, ...)
|
|||
opt.state = core:registerHitbox(opt.id, x,y,w,h)
|
||||
opt.hasKeyboardFocus = core:grabKeyboardFocus(opt.id)
|
||||
|
||||
if opt.hasKeyboardFocus then
|
||||
if (input.candidate_text.text == "") and opt.hasKeyboardFocus then
|
||||
local keycode,char = core:getPressedKey()
|
||||
-- text input
|
||||
if char ~= "" then
|
||||
if char and char ~= "" then
|
||||
local a,b = split(input.text, input.cursor)
|
||||
input.text = table.concat{a, char, b}
|
||||
input.cursor = input.cursor + utf8.len(char)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue