Jump to content




Touch Screen


1 reply to this topic

#1 grand_mind1

  • Members
  • 207 posts

Posted 28 January 2013 - 09:22 AM

I have tried to find information on the touch functionality of the advanced monitors, but I haven't been able to find much. Could someone please provide some information or a link to some?
Help is very much appreciated!
Thanks! :D

#2 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 28 January 2013 - 09:48 AM

You will need to use os.pullEvent() and check for the event "monitor_touch". THe parameters returned are:
which button, x and y co-ords.

mon = peripheral.wrap("right") -- wrap monitor on the side...
mX, mY = mon.getSize() -- get the sizes of the monitor

while true do
    e = { os.pullEvent() }
    if e[1] == "monitor_touch" then
        if e[3] == mX and e[4] == 1 then -- 
            -- This would be the very top right of the monitor...
        end
    end
end






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users