Update mouseEvents.md
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
Here we will talk about mouse events and how you can manipulate them. There are 2 possible mouse events you can add to almost every visual object.
|
Here we will talk about mouse events and how you can use them. You can register custom mouse events to all visual objects
|
||||||
|
|
||||||
# onClick
|
# onClick
|
||||||
`onClick(self, button, x, y)`<br>
|
`onClick(self, event, button, x, y)`<br>
|
||||||
The computercraft event which triggers this method is `mouse_click` and `monitor_touch`.
|
The computercraft event which triggers this method is `mouse_click` and `monitor_touch`.
|
||||||
Any visual object can register onClick events.
|
Any visual object can register onClick events.
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ button:onClick(buttonOnClick())
|
|||||||
```
|
```
|
||||||
|
|
||||||
# onClickUp
|
# onClickUp
|
||||||
`onClickUp(self, button, x, y)`<br>
|
`onClickUp(self, event, button, x, y)`<br>
|
||||||
The computercraft event which triggers this method is `mouse_up`.
|
The computercraft event which triggers this method is `mouse_up`.
|
||||||
Any visual object can register onClickUp events.
|
Any visual object can register onClickUp events.
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ button:onClickUp(buttonOnRelease)
|
|||||||
```
|
```
|
||||||
|
|
||||||
# onScroll
|
# onScroll
|
||||||
`onScroll(self, direction, x, y)`<br>
|
`onScroll(self, event, direction, x, y)`<br>
|
||||||
The computercraft event which triggers this method is `mouse_scroll`.
|
The computercraft event which triggers this method is `mouse_scroll`.
|
||||||
Any visual object can register onScroll events.
|
Any visual object can register onScroll events.
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ button:onScroll(buttonOnScroll)
|
|||||||
```
|
```
|
||||||
|
|
||||||
# onDrag
|
# onDrag
|
||||||
`onDrag(self, button, x, y)`<br>
|
`onDrag(self, event, button, x, y)`<br>
|
||||||
The computercraft event which triggers this method is `mouse_drag`.
|
The computercraft event which triggers this method is `mouse_drag`.
|
||||||
Any visual object can register onDrag events.
|
Any visual object can register onDrag events.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user