Posted 04 January 2013 - 01:57 AM
Hello.
im trying to make a right click menu (popup) but i cant get it to work, when trying to detect if the mouse button is Right, or Left.
Does anyone know anything about right and left click detection?
i do not find any good tutorials on this, so thats because i posted this:
EDIT: i found a new issue…
when trying to leftclick at the Settings menu, it doesnt work… but it does work when clicking on the Stop menu.
newest code:
http://pastebin.com/NkHQBmwi
code:
thanks :)/>
im trying to make a right click menu (popup) but i cant get it to work, when trying to detect if the mouse button is Right, or Left.
Does anyone know anything about right and left click detection?
i do not find any good tutorials on this, so thats because i posted this:
EDIT: i found a new issue…
when trying to leftclick at the Settings menu, it doesnt work… but it does work when clicking on the Stop menu.
newest code:
http://pastebin.com/NkHQBmwi
code:
Spoiler
function tB(color)
term.setBackgroundColor(color)
end
function tT(color)
term.setTextColor(color)
end
tB(colors.lightGray)
term.clear()
local event, button, x, y = os.pullEvent("mouse_click")
if event == "mouse_click" then
if button == "mouse_right" then
print("<Doing stuff>")
end
end
thanks :)/>