Mouse scroll (event)
From ComputerCraft Wiki
Revision as of 08:27, 4 May 2013 by TheCoryKid (Talk | contribs) (The description and code example were both wrong. Fixed the return values, changed the example to reflect this, and added a second example.)
This page needs some serious TLC, stat! Please help us by cleaning it, fixing it up, or sparing it some love.
(Reason: A demonstration on the use and handling of this event would be beneficial. AfterLifeLochie 15:57, 30 November 2012 (MSK)) |
Examples
Example | |
Print the direction and the co-ordinates of every mouse scroll we receive a mouse_scroll event for. | |
Code |
while true do _, dir, x, y = os.pullEvent("mouse_scroll") print("mouse_scroll: " .. tostring(dir) .. ", " .. "X: " .. tostring(x) .. ", " .. "Y: " .. tostring(y)) end |
Output | The direction the mouse-wheel was scrolled in, followed by the X and Y position of the event. |