mouse: Fix the "is button X pressed" properties.
Apparently it never worked. Fix #3352
This commit is contained in:
parent
fedc7dc69d
commit
5e5f587bea
|
@ -341,9 +341,9 @@ function mouse.remove_client_mousebinding(button)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, b in ipairs {"left", "right", "middle"} do
|
for k, b in ipairs {"left", "middle", "right"} do
|
||||||
mouse.object["is_".. b .."_mouse_button_pressed"] = function()
|
mouse.object["is_".. b .."_mouse_button_pressed"] = function()
|
||||||
return capi.mouse.coords().buttons[1]
|
return capi.mouse.coords().buttons[k]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -367,6 +367,10 @@ end)
|
||||||
capi.mouse.set_index_miss_handler(function(_,key)
|
capi.mouse.set_index_miss_handler(function(_,key)
|
||||||
if mouse.object["get_"..key] then
|
if mouse.object["get_"..key] then
|
||||||
return mouse.object["get_"..key]()
|
return mouse.object["get_"..key]()
|
||||||
|
elseif mouse.object[key] and key:sub(1, 3) == "is_" then
|
||||||
|
return mouse.object[key]()
|
||||||
|
elseif mouse.object[key] then
|
||||||
|
return mouse.object[key]
|
||||||
else
|
else
|
||||||
return props[key]
|
return props[key]
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue