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

not getting monitor_touch events

Started by jhultgre, 30 April 2013 - 11:04 PM
jhultgre #1
Posted 01 May 2013 - 01:04 AM
I wrote a simple program to try to get started with advanced monitors but I'm not getting any monitor_touch events.
Spoiler

monitor = peripheral.wrap("right")
monitor.write("Hello World!")
while true do
  local event, p1, p2, p3 = os.pullEvent()
  print (event..": "..tostring(p1)..", "..tostring(p2)..", "..tostring(p3))
end

I'm getting key and mouseclick events on the computer but no monitor_touch events when I try clicking on the monitor. Does anyone have any idea whats wrong?
Lyqyd #2
Posted 01 May 2013 - 11:00 AM
Split into new topic.

Are you right-clicking on the monitor?
jhultgre #3
Posted 01 May 2013 - 11:48 AM
I tried right clicking, left clicking, middle clicking, and even shift clicking with all of those but I didn't see any events come up from the monitor.
Lyqyd #4
Posted 01 May 2013 - 01:09 PM
Which version of ComputerCraft are you on?
jhultgre #5
Posted 02 May 2013 - 04:00 AM
I just tried it again and it works. No idea whats different. I'm using ftb ultimate 1.0.2 by the way
GreatOak #6
Posted 08 May 2013 - 06:14 PM

m = peripheral.wrap("top")
term.redirect(m)
term.clear()
term.setCursorPos(1,1)
print("Hello World")
while true do
  local event, side, x, y = os.pullEvent("monitor_touch")
  print("X: "..tostring(x)..", Y: "..tostring(y))
  sleep(1)
  term.restore()
end
This should work because it works for me in FTB Ultimate Version 1.0.2.