monitor touch (event)

From ComputerCraft Wiki
Revision as of 10:46, 4 October 2013 by Cranium (Talk | contribs)

Jump to: navigation, search

Grid Modem.png  Event monitor_touch
Fired when the player right click on an advanced monitor connected.
Returned Object 1 The side of the advanced monitor.
Returned Object 2 The X-coordinate of the click (in screen-characters).
Returned Object 3 The Y-coordinate of the click (in screen-characters).


Grid paper.png  Example
Print the side of the monitor and the co-ordinates of every mouse click we receive a monitor_touch event.
while true do
  event, side, xPos, yPos = os.pullEvent("monitor_touch")
  print(event .. " => Side: " .. tostring(side) .. ", " ..
    "X: " .. tostring(xPos) .. ", " ..
    "Y: " .. tostring(yPos))
Output The side of the advanced monitor, followed by the X and Y position of the event.