cmd新增复制和剪切
This commit is contained in:
@@ -455,6 +455,23 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
local combKey={}
|
||||||
|
function combKey.x()
|
||||||
|
love.system.setClipboardText(inputBox.value)
|
||||||
|
inputBox.value=""
|
||||||
|
SFX.play("reach")
|
||||||
|
end
|
||||||
|
function combKey.c()
|
||||||
|
love.system.setClipboardText(inputBox.value)
|
||||||
|
SFX.play("reach")
|
||||||
|
end
|
||||||
|
function combKey.v()
|
||||||
|
inputBox.value=inputBox.value..love.system.getClipboardText()
|
||||||
|
SFX.play("reach")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--Environment for user's function
|
--Environment for user's function
|
||||||
local noLog=false
|
local noLog=false
|
||||||
local function log_user(str)
|
local function log_user(str)
|
||||||
@@ -583,8 +600,6 @@ function scene.keyDown(k)
|
|||||||
inputBox.value=""
|
inputBox.value=""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif k=="escape"then
|
|
||||||
WIDGET.sel=inputBox
|
|
||||||
elseif k=="tab"then
|
elseif k=="tab"then
|
||||||
local str=inputBox.value
|
local str=inputBox.value
|
||||||
if str~=""and not str:find("%s")then
|
if str~=""and not str:find("%s")then
|
||||||
@@ -605,8 +620,10 @@ function scene.keyDown(k)
|
|||||||
inputBox.value=res[1]
|
inputBox.value=res[1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif k=="v"and kb.isDown("lctrl","rctrl")then
|
elseif combKey[k]and kb.isDown("lctrl","rctrl")then
|
||||||
inputBox.value=inputBox.value..love.system.getClipboardText()
|
combKey[k]()
|
||||||
|
elseif k=="escape"then
|
||||||
|
WIDGET.sel=inputBox
|
||||||
else
|
else
|
||||||
WIDGET.keyPressed(k)
|
WIDGET.keyPressed(k)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user