Difference between revisions of "Monitor touch (event)"
From ComputerCraft Wiki
m |
Bomb Bloke (Talk | contribs) |
||
Line 2: | Line 2: | ||
{{Event | {{Event | ||
|name=monitor_touch | |name=monitor_touch | ||
− | |desc=Fired when the player right click on an advanced | + | |desc=Fired when the player right clicks on any [[Advanced Monitor]] connected to the system (either directly or via a [[Wired Modem]]). Similar to the [[mouse_click_(event)|mouse click event]], which is thrown when the user clicks on the terminal display of an advanced system. |
|return1=The side of the advanced monitor. | |return1=The side of the advanced monitor. | ||
|return2=The X-coordinate of the click (in screen-characters). | |return2=The X-coordinate of the click (in screen-characters). |
Revision as of 02:56, 13 August 2014
Event monitor_touch | |
Fired when the player right clicks on any Advanced Monitor connected to the system (either directly or via a Wired Modem). Similar to the mouse click event, which is thrown when the user clicks on the terminal display of an advanced system. | |
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). |
Examples
Example | |
Print the side of the monitor and the co-ordinates of every mouse click we receive a monitor_touch event. | |
Code |
while true do event, side, xPos, yPos = os.pullEvent("monitor_touch") print(event .. " => Side: " .. tostring(side) .. ", " .. "X: " .. tostring(xPos) .. ", " .. "Y: " .. tostring(yPos)) end |
Output | The side of the advanced monitor, followed by the X and Y position of the event. |