1
0
Fork 0
mirror of https://github.com/Reuh/ubiquitousse.git synced 2025-10-27 09:09:30 +00:00

input: fix mouse[N]

This commit is contained in:
Étienne Fildadut 2022-09-20 14:46:49 +09:00
parent 336f4f01a5
commit 0c765b315e
14 changed files with 28 additions and 23 deletions

View file

@ -57,10 +57,10 @@ signal.event:bind("textinput", function(text)
end)
signal.event:bind("mousepressed", function(x, y, button, istouch, presses)
update(("mouse.%s"):format(button), 1)
update(("mouse[%s]"):format(button), 1)
end)
signal.event:bind("mousereleased", function(x, y, button, istouch, presses)
update(("mouse.%s"):format(button), 0)
update(("mouse[%s]"):format(button), 0)
end)
signal.event:bind("mousemoved", function(x, y, dx, dy, istouch)

View file

@ -791,9 +791,9 @@ input_mt.__index = input_mt
-- X can be any text.
-- @field text.X
--- Mouse input: 1 if the mouse button is down, 0 otherwise.
--- Mouse input: `mouse[N]` is 1 if the mouse button is down, 0 otherwise.
-- N is either 1 for the primary mouse button, 2 for secondary or 3 for middle button.
-- @field mouse.N
-- @field mouse `mouse[N]`
--- Mouse input: X position of the mouse cursor in the game window.
-- @field mouse.x