Posted 12 November 2014 - 08:34 PM
Hi, I have a problem with the Event. How do I write code please me there were two Events - mouse click and key event
sorry Google Translator
this is my code:
it is nonfunctional
sorry Google Translator
this is my code:
it is nonfunctional
while true do
local event, key = os.pullEvent("key")
if key == keys.q then
os.shutdown ()
end
local event, button, x, y = os.pullEvent("mouse_click")
xy = x..","..y
if xy == "51,1" and button == 1 then
vypnout ()
break
end
if xy == "51,1" and button == 2 then
restart ()
break
end
if x >= 1 and x <= 4 and y == 1 and button == 1 then
menu ()
break
end
if x >= 42 and x <= 51 and y == 14 and button == 1 then
mainloop ()
break
end
end
Edited on 12 November 2014 - 07:38 PM