wheelScroll小模块支持指定按键
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
local floatWheel=0
|
local floatWheel=0
|
||||||
return function(y)
|
return function(y,key1,key2)
|
||||||
if y>0 then
|
if y>0 then
|
||||||
if floatWheel<0 then floatWheel=0 end
|
if floatWheel<0 then floatWheel=0 end
|
||||||
floatWheel=floatWheel+y^1.2
|
floatWheel=floatWheel+y^1.2
|
||||||
@@ -8,11 +8,11 @@ return function(y)
|
|||||||
floatWheel=floatWheel-(-y)^1.2
|
floatWheel=floatWheel-(-y)^1.2
|
||||||
end
|
end
|
||||||
while floatWheel>=1 do
|
while floatWheel>=1 do
|
||||||
love.keypressed("up")
|
love.keypressed(key1 or"up")
|
||||||
floatWheel=floatWheel-1
|
floatWheel=floatWheel-1
|
||||||
end
|
end
|
||||||
while floatWheel<=-1 do
|
while floatWheel<=-1 do
|
||||||
love.keypressed("down")
|
love.keypressed(key2 or"down")
|
||||||
floatWheel=floatWheel+1
|
floatWheel=floatWheel+1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user