整理代码,关闭大量小程序的按键自动重复
This commit is contained in:
@@ -231,6 +231,10 @@ function scene.sceneInit()
|
||||
tapControl=false
|
||||
startTime=0
|
||||
reset()
|
||||
love.keyboard.setKeyRepeat(false)
|
||||
end
|
||||
function scene.sceneBack()
|
||||
love.keyboard.setKeyRepeat(true)
|
||||
end
|
||||
|
||||
function scene.mouseDown(x,y,k)
|
||||
|
||||
@@ -18,6 +18,10 @@ function scene.sceneInit()
|
||||
ex,ey=626,260
|
||||
BG.set("matrix")
|
||||
BGM.play("way")
|
||||
love.keyboard.setKeyRepeat(false)
|
||||
end
|
||||
function scene.sceneBack()
|
||||
love.keyboard.setKeyRepeat(true)
|
||||
end
|
||||
|
||||
function scene.keyDown(key)
|
||||
|
||||
@@ -64,6 +64,10 @@ function scene.sceneInit()
|
||||
gc.setLineJoin("bevel")
|
||||
BGM.play("push")
|
||||
BG.set("none")
|
||||
love.keyboard.setKeyRepeat(false)
|
||||
end
|
||||
function scene.sceneBack()
|
||||
love.keyboard.setKeyRepeat(true)
|
||||
end
|
||||
|
||||
function scene.touchDown(x)
|
||||
|
||||
@@ -34,6 +34,10 @@ function scene.sceneInit()
|
||||
state="menu"
|
||||
BGM.play("new era")
|
||||
BG.set("space")
|
||||
love.keyboard.setKeyRepeat(false)
|
||||
end
|
||||
function scene.sceneBack()
|
||||
love.keyboard.setKeyRepeat(true)
|
||||
end
|
||||
|
||||
function scene.keyDown(key)
|
||||
@@ -239,7 +243,7 @@ function scene.draw()
|
||||
end
|
||||
|
||||
scene.widgetList={
|
||||
WIDGET.newButton{name="back",x=1140,y=60,w=170,h=80,font=40,code=pressKey("escape")},
|
||||
WIDGET.newButton{name="back",x=1140,y=60,w=170,h=80,font=40,code=pressKey"escape"},
|
||||
}
|
||||
|
||||
return scene
|
||||
@@ -87,6 +87,10 @@ function scene.sceneInit()
|
||||
reset()
|
||||
BG.set("grey")
|
||||
BGM.play("way")
|
||||
love.keyboard.setKeyRepeat(false)
|
||||
end
|
||||
function scene.sceneBack()
|
||||
love.keyboard.setKeyRepeat(true)
|
||||
end
|
||||
|
||||
local function touch(n)
|
||||
|
||||
@@ -17,6 +17,10 @@ end
|
||||
function scene.sceneInit()
|
||||
reset()
|
||||
BG.set("none")
|
||||
love.keyboard.setKeyRepeat(false)
|
||||
end
|
||||
function scene.sceneBack()
|
||||
love.keyboard.setKeyRepeat(true)
|
||||
end
|
||||
|
||||
function scene.keyDown(key)
|
||||
|
||||
@@ -13,9 +13,9 @@ function scene.sceneInit()
|
||||
lastKey=nil
|
||||
speed=0
|
||||
keyTime={}for i=1,40 do keyTime[i]=-1e99 end
|
||||
love.keyboard.setKeyRepeat(false)
|
||||
BG.set("grey")
|
||||
BGM.play("push")
|
||||
love.keyboard.setKeyRepeat(false)
|
||||
end
|
||||
function scene.sceneBack()
|
||||
love.keyboard.setKeyRepeat(true)
|
||||
|
||||
@@ -323,7 +323,7 @@ function scene.draw()
|
||||
end
|
||||
scene.widgetList={
|
||||
textBox,
|
||||
WIDGET.newKey{name="ready",x=640,y=440,w=200,h=80,color="yellow",font=40,code=pressKey("space"),hide=function()return playing or not hideChatBox or PLAYERS[1].ready end},
|
||||
WIDGET.newKey{name="ready",x=640,y=440,w=200,h=80,color="yellow",font=40,code=pressKey"space",hide=function()return playing or not hideChatBox or PLAYERS[1].ready end},
|
||||
WIDGET.newKey{name="hideChat",fText="...",x=380,y=35,w=60,font=35,code=switchChat},
|
||||
WIDGET.newKey{name="quit",fText="X",x=900,y=35,w=60,font=40,code=pressKey"escape"},
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ end
|
||||
|
||||
scene.widgetList={
|
||||
WIDGET.newKey{name="fresh", x=240,y=620,w=140,h=140,font=40,code=fresh,hide=function()return TIME()-lastfreshTime<1.26 end},
|
||||
WIDGET.newKey{name="new", x=440,y=620,w=140,h=140,font=25,code=pressKey("n")},
|
||||
WIDGET.newKey{name="new", x=440,y=620,w=140,h=140,font=25,code=pressKey"n"},
|
||||
WIDGET.newKey{name="join", x=640,y=620,w=140,h=140,font=40,code=pressKey"return",hide=function()return not rooms end},
|
||||
WIDGET.newKey{name="up", x=840,y=585,w=140,h=70,font=40,code=pressKey"up",hide=function()return not rooms end},
|
||||
WIDGET.newKey{name="down", x=840,y=655,w=140,h=70,font=40,code=pressKey"down",hide=function()return not rooms end},
|
||||
|
||||
Reference in New Issue
Block a user