一堆场景同时允许回车键和小键盘回车键

This commit is contained in:
MrZ_26
2022-10-26 10:57:45 +08:00
parent a578d537cd
commit 354d4f80bf
8 changed files with 8 additions and 8 deletions

View File

@@ -323,7 +323,7 @@ function scene.keyDown(key,isRep)
elseif key=='1' or key=='2' then (kb.isDown('lshift','lctrl','lalt') and playRep or setFocus)(key=='1' and 1 or 2) elseif key=='1' or key=='2' then (kb.isDown('lshift','lctrl','lalt') and playRep or setFocus)(key=='1' and 1 or 2)
elseif key=='c1' then playRep(1) elseif key=='c1' then playRep(1)
elseif key=='c2' then playRep(2) elseif key=='c2' then playRep(2)
elseif key=='return' then elseif key=='return' or key=='kpenter' then
if repeater.focus then if repeater.focus then
repeater.focus=false repeater.focus=false
end end

View File

@@ -107,7 +107,7 @@ function scene.keyDown(key)
val=val..key val=val..key
end end
end end
elseif key=='return' then elseif key=='return' or key=='kpenter' then
scene.keyDown('calculate') scene.keyDown('calculate')
elseif key=='calculate' then elseif key=='calculate' then
val=val:gsub("e$","") val=val:gsub("e$","")

View File

@@ -27,7 +27,7 @@ end
function scene.keyDown(key,rep) function scene.keyDown(key,rep)
if key=='escape' and not rep then if key=='escape' and not rep then
SCN.back() SCN.back()
elseif key=='return' then elseif key=='return' or key=='kpenter' then
if #scene.widgetList.code:getText():upper()==0 then if #scene.widgetList.code:getText():upper()==0 then
_getCode() _getCode()
else else

View File

@@ -130,7 +130,7 @@ function scene.touchClick(x,y)
end end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=='return' then if key=='return' or key=='kpenter' then
if mapCam.sel then if mapCam.sel then
if visibleModes[mapCam.sel]==2 then if visibleModes[mapCam.sel]==2 then
MES.new('info',text.unlockHint) MES.new('info',text.unlockHint)

View File

@@ -133,7 +133,7 @@ function scene.keyDown(key,isRep)
else else
_quit() _quit()
end end
elseif key=='return' then elseif key=='return' or key=='kpenter' then
local mes=STRING.trim(inputBox:getText()) local mes=STRING.trim(inputBox:getText())
if not inputBox.hide and #mes>0 then if not inputBox.hide and #mes>0 then
if mes:sub(1,1)=='/' then if mes:sub(1,1)=='/' then

View File

@@ -82,7 +82,7 @@ function scene.keyDown(key)
if fetchTimer<=7 then if fetchTimer<=7 then
_fetchRoom() _fetchRoom()
end end
elseif roomList:getLen()>0 and (key=='join' or key=='return' and love.keyboard.isDown('lctrl','rctrl')) then elseif roomList:getLen()>0 and (key=='join' or (key=='return' or key=='kpenter') and love.keyboard.isDown('lctrl','rctrl')) then
local R=roomList:getSel() local R=roomList:getSel()
if R and not TASK.getLock('fetchRoom') then if R and not TASK.getLock('fetchRoom') then
if R.info.version==VERSION.room then if R.info.version==VERSION.room then

View File

@@ -72,7 +72,7 @@ function scene.sceneInit()
end end
function scene.keyDown(key) function scene.keyDown(key)
if key=='return' then if key=='return' or key=='kpenter' then
local rep=listBox:getSel() local rep=listBox:getSel()
if rep then if rep then
_playRep(rep.fileName) _playRep(rep.fileName)

View File

@@ -23,7 +23,7 @@ end
function scene.keyDown(key,rep) function scene.keyDown(key,rep)
if key=='escape' and not rep then if key=='escape' and not rep then
SCN.back() SCN.back()
elseif key=='return' then elseif key=='return' or key=='kpenter' then
if #scene.widgetList.code:getText()==0 then if #scene.widgetList.code:getText()==0 then
NET.getCode(USER.email) NET.getCode(USER.email)
else else