2
mousebutton
JailDoctor edited this page 2021-12-07 12:45:48 +01:00

mousebutton(btn)

Torna true o false segons si està o no pulsat el botó del ratolí especificat. 1 per al botó esquerre, 2 per al del mig i 3 per al botó dret.

Exemple

function update()
    cls()
    locate(0,0)
    if mousebutton(1) then
        print("Has pulsat el boto esquerre")
    elseif mousebutton(2) then
        print("Has pulsat el boto del mig")
    elseif mousebutton(3) then
        print("Has pulsat el boto dret")
    else
        print("No has pulsat cap boto")
    end
end

Vore també