Fix bug in input.lua, make 0.9-ready, add utf8 editing
1) [input.lua] Pressing backspace while the cursor was at the beggining of the text removed the first character. Fixed thanks to riidom. 2) [LÖVE 0.9] Use setLine(Width|Style) instead of setLine. Split keyboard.pressed() into keyboard.pressed() and keyboard.textinput(). (see readme) 3) [utf8.lua] Add support for UTF-8 text editing. May still fail spectacurlarly with invalid UTF-8 strings.
This commit is contained in:
parent
ffd187dc17
commit
66a089a07f
6 changed files with 116 additions and 21 deletions
11
README.md
11
README.md
|
@ -135,7 +135,16 @@ Quickie is an [immediate mode gui][IMGUI] library for [LÖVE][LOVE]. Initial
|
|||
end
|
||||
|
||||
function love.keypressed(key, code)
|
||||
gui.keyboard.pressed(key, code)
|
||||
gui.keyboard.pressed(key)
|
||||
-- LÖVE 0.8: see if this code can be converted in a character
|
||||
if pcall(string.char, code) code > 0 then
|
||||
gui.keyboard.textinput(string.char(code))
|
||||
end
|
||||
end
|
||||
|
||||
-- LÖVE 0.9
|
||||
function love.textinput(str)
|
||||
gui.keyboard.textinput(str)
|
||||
end
|
||||
|
||||
# Documentation
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue