This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Micheal Pearce's profile picture

Mouse clicking on monitors

Started by Micheal Pearce, 15 April 2013 - 09:25 AM
Micheal Pearce #1
Posted 15 April 2013 - 11:25 AM
how do you get input on mouse click from the monitor i know it possible because you can paint with the monitor i just can find the code to do it
Engineer #2
Posted 15 April 2013 - 11:35 AM
Mouse clicking is only possible on an advanced computer.
This snippet will wait until a click:

local event, button, x, y = os.pullEvent('mouse_click')

Event is 'mouse_click'
button is wich butten you clicked -> 1 left; 2 right; 3 scroll thingie
x and y is the postion where is clicked on the screen
Micheal Pearce #3
Posted 15 April 2013 - 11:41 AM
its also possible on Adv, monitors too because you can paint on Adv. monitors with the program paint
Mailmanq! #4
Posted 15 April 2013 - 11:42 AM
To get clicks from an advanced monitor, do

local event, side, x, y = os.pullEvent("monitor_touch")
side -left, right, top, bottom, front, or back.
x - The x position of where the touched.
y - The y position of where the touched.
theoriginalbit #5
Posted 15 April 2013 - 11:45 AM
the side in the monitor touch event is the side that the monitor is on the computer.
Micheal Pearce #6
Posted 15 April 2013 - 11:55 AM
To get clicks from an advanced monitor, do

local event, side, x, y = os.pullEvent("monitor_touch")
side -left, right, top, bottom, front, or back.
x - The x position of where the touched.
y - The y position of where the touched.
thanks