Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- read = function(mask, table)
- local oread = read
- local ret = ""
- x, y = term.getCursorPos()
- mx, my = term.getSize()
- local f1 = function()
- ret = oread(mask, table)
- end
- local f2 = function()
- while true do
- local e, d = os.pullEvent("mouse_scroll")
- if d == 1 then os.queueEvent("key", keys.up) end
- if d == -1 then os.queueEvent("key", keys.down) end
- end
- end
- local f3 = function()
- while true do
- local e, k = os.pullEvent()
- if k == keys.backspace and e == "key" then
- x = x - 1
- else
- x = x + 1
- end
- if x > mx then
- x = 1
- y = y + 1
- term.setCursorPos(1, y)
- end
- end
- end
- parallel.waitForAny(f1, f2, f3)
- return ret
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement