From 3bca0336fa0e80b013b953cc0bb5bce341281b07 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sun, 2 May 2021 11:43:56 +0800 Subject: [PATCH] =?UTF-8?q?wheelScroll=E5=B0=8F=E6=A8=A1=E5=9D=97=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=8C=87=E5=AE=9A=E6=8C=89=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/wheelScroll.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Zframework/wheelScroll.lua b/Zframework/wheelScroll.lua index a67c5560..3eece35a 100644 --- a/Zframework/wheelScroll.lua +++ b/Zframework/wheelScroll.lua @@ -1,5 +1,5 @@ local floatWheel=0 -return function(y) +return function(y,key1,key2) if y>0 then if floatWheel<0 then floatWheel=0 end floatWheel=floatWheel+y^1.2 @@ -8,11 +8,11 @@ return function(y) floatWheel=floatWheel-(-y)^1.2 end while floatWheel>=1 do - love.keypressed("up") + love.keypressed(key1 or"up") floatWheel=floatWheel-1 end while floatWheel<=-1 do - love.keypressed("down") + love.keypressed(key2 or"down") floatWheel=floatWheel+1 end end \ No newline at end of file