Added paste
This commit is contained in:
@@ -193,6 +193,8 @@ function Input:blur()
|
|||||||
self:updateRender()
|
self:updateRender()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- @shortDescription Handles paste events
|
||||||
|
--- @protected
|
||||||
function Input:paste(content)
|
function Input:paste(content)
|
||||||
if not self.get("focused") then return false end
|
if not self.get("focused") then return false end
|
||||||
local text = self.get("text")
|
local text = self.get("text")
|
||||||
|
|||||||
@@ -236,11 +236,10 @@ function TextBox:mouse_click(button, x, y)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- @shortDescription Handles paste events
|
||||||
|
--- @protected
|
||||||
function TextBox:paste(text)
|
function TextBox:paste(text)
|
||||||
if not self.get("editable") or not self.get("focused") then return false end
|
if not self.get("editable") or not self.get("focused") then return false end
|
||||||
local lines = self.get("lines")
|
|
||||||
local cursorX = self.get("cursorX")
|
|
||||||
local cursorY = self.get("cursorY")
|
|
||||||
|
|
||||||
for char in text:gmatch(".") do
|
for char in text:gmatch(".") do
|
||||||
if char == "\n" then
|
if char == "\n" then
|
||||||
|
|||||||
Reference in New Issue
Block a user