This commit is contained in:
SweetSea-ButImNotSweet
2024-05-13 17:27:51 +07:00
parent 940e17eff7
commit f5584b5df7
6 changed files with 66 additions and 38 deletions

View File

@@ -117,13 +117,7 @@ end
local touches={}
local global_toggle=false
VCTRL={}
-- VCTRL.focus=nil -- Focusing buttons
---@param toggle boolean|false
---Enabling virtual control or not
function VCTRL.toggle(toggle)
global_toggle=toggle
end
VCTRL.focus=nil -- Focusing buttons
---@param ... table
---@class data
@@ -144,6 +138,19 @@ function VCTRL.new(...)
end
end
---@param toggle boolean|false
---Enabling virtual control or not
function VCTRL.toggle(toggle)
if not toggle then
-- Release all buttons to prevent ghost keys
for id, b in pairs(touches) do
b:release(id)
touches[id]=nil
end
end
global_toggle=toggle
end
function VCTRL.press(x,y,id)
if not global_toggle then return end
local obj,closestDist=false,1e99