input control order change

Changes to be committed:
	modified:   src/ltui/textedit.lua
This commit is contained in:
laelnasan
2020-12-05 15:00:42 -03:00
parent 9e6516e257
commit 7e0e3809d7

View File

@@ -77,10 +77,7 @@ function textedit:on_event(e)
-- update text -- update text
if e.type == event.ev_keyboard then if e.type == event.ev_keyboard then
if e.key_code > 0x1f and e.key_code < 0x100 then if e.key_name == "Enter" and self:option("multiline") then
self:text_set(self:text() .. string.char(e.key_code))
return true
elseif e.key_name == "Enter" and self:option("multiline") then
self:text_set(self:text() .. '\n') self:text_set(self:text() .. '\n')
return true return true
elseif e.key_name == "Backspace" then elseif e.key_name == "Backspace" then
@@ -100,6 +97,9 @@ function textedit:on_event(e)
self:text_set(self:text() .. pastetext) self:text_set(self:text() .. pastetext)
end end
return true return true
elseif e.key_code > 0x1f and e.key_code < 0x100 then
self:text_set(self:text() .. string.char(e.key_code))
return true
end end
end end