|
|
@ -81,7 +81,7 @@ if Device.isTouchDevice() then
|
|
|
|
if x > 0 and y > 0 then
|
|
|
|
if x > 0 and y > 0 then
|
|
|
|
self.charpos = self.text_widget:moveCursor(x, y)
|
|
|
|
self.charpos = self.text_widget:moveCursor(x, y)
|
|
|
|
if Device:hasClipboard() and Device.input.hasClipboardText() then
|
|
|
|
if Device:hasClipboard() and Device.input.hasClipboardText() then
|
|
|
|
self:addChar(Device.input.getClipboardText())
|
|
|
|
self:addChars(Device.input.getClipboardText())
|
|
|
|
end
|
|
|
|
end
|
|
|
|
UIManager:setDirty(self.parent, function()
|
|
|
|
UIManager:setDirty(self.parent, function()
|
|
|
|
return "ui", self.dimen
|
|
|
|
return "ui", self.dimen
|
|
|
@ -247,13 +247,13 @@ function InputText:getKeyboardDimen()
|
|
|
|
return self.keyboard.dimen
|
|
|
|
return self.keyboard.dimen
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function InputText:addChar(char)
|
|
|
|
function InputText:addChars(char)
|
|
|
|
if self.enter_callback and char == '\n' then
|
|
|
|
if self.enter_callback and char == '\n' then
|
|
|
|
UIManager:scheduleIn(0.3, function() self.enter_callback() end)
|
|
|
|
UIManager:scheduleIn(0.3, function() self.enter_callback() end)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
table.insert(self.charlist, self.charpos, char)
|
|
|
|
table.insert(self.charlist, self.charpos, char)
|
|
|
|
self.charpos = self.charpos + string.len(char)
|
|
|
|
self.charpos = self.charpos + #util.splitToChars(char)
|
|
|
|
self:initTextBox(table.concat(self.charlist), true)
|
|
|
|
self:initTextBox(table.concat(self.charlist), true)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|