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

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=='c1' then playRep(1)
elseif key=='c2' then playRep(2)
elseif key=='return' then
elseif key=='return' or key=='kpenter' then
if repeater.focus then
repeater.focus=false
end

View File

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

View File

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

View File

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

View File

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

View File

@@ -82,7 +82,7 @@ function scene.keyDown(key)
if fetchTimer<=7 then
_fetchRoom()
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()
if R and not TASK.getLock('fetchRoom') then
if R.info.version==VERSION.room then

View File

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

View File

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