summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chickadee.scm4
-rw-r--r--doc/api.texi14
2 files changed, 18 insertions, 0 deletions
diff --git a/chickadee.scm b/chickadee.scm
index a8251f3..989056b 100644
--- a/chickadee.scm
+++ b/chickadee.scm
@@ -258,6 +258,7 @@ border is disabled, otherwise it is enabled.")
(mouse-press (const #t))
(mouse-release (const #t))
(mouse-move (const #t))
+ (mouse-wheel (const #t))
(controller-add (const #t))
(controller-remove (const #t))
(controller-press (const #t))
@@ -325,6 +326,9 @@ border is disabled, otherwise it is enabled.")
(mouse-motion-event-x-rel event)
(- (mouse-motion-event-y-rel event))
(mouse-motion-event-buttons event)))
+ ((mouse-wheel-event? event)
+ (mouse-wheel (mouse-wheel-event-x event)
+ (mouse-wheel-event-y event)))
((and (controller-device-event? event)
(eq? (controller-device-event-action event) 'added))
(controller-add (add-controller
diff --git a/doc/api.texi b/doc/api.texi
index 8a06690..96ac394 100644
--- a/doc/api.texi
+++ b/doc/api.texi
@@ -172,6 +172,20 @@ mouse was moved.
@end enumerate
@item
+@var{mouse-wheel}: Called with two arguments when the mouse wheel is
+scrolled:
+
+@enumerate
+
+@item
+@var{x}: The scroll amount along the X axis.
+
+@item
+@var{y}: The scroll amount along the Y axis.
+
+@end enumerate
+
+@item
@var{controller-add}: Called with a single argument, an SDL game
controller object, when a game controller is connected.