package mosaic
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=9e4e90d17f9b2af1b07071fe425bc2c519c849c4f1d1ab73cde512be2d874849
sha512=06e9c4a741590942e81a27738d0b5c0413fafec8cf3b7dae047ad69f155e7b718aa4223818dc161b7d028efffcfd3365905e264d6fd31d453910ddfa91dcf9b9
doc/mosaic.mlx/Mosaic_mlx/Sub/index.html
Module Mosaic_mlx.SubSource
Ongoing event interests declared by the application.
The app.subscriptions function is called after every update and returns a subscription value describing which events the application wants to receive. Subscriptions are re-evaluated on each cycle, so they may depend on the current model. Compose multiple subscriptions with Sub.batch.
type 'msg t = | None(*No subscription. Equivalent to
*)batch [].| Batch of 'msg t list(*Activate all subscriptions in the list.
*)| Every of float * unit -> 'msg(*
*)Every (interval, f)firesf ()repeatedly at approximatelyinterval-second intervals.| On_tick of dt:float -> 'msg(*
*)On_tick ffiresf ~dton every render frame, wheredtis the elapsed time in seconds since the previous frame.| On_key of Event.key -> 'msg option(*
*)On_key fdelivers key events only to the currently focused element.freturnsNoneto ignore an event.| On_key_all of Event.key -> 'msg option(*
*)On_key_all fdelivers all key events regardless of focus.freturnsNoneto ignore an event.| On_mouse of Event.mouse -> 'msg option(*
*)On_mouse fdelivers mouse events only to the currently focused element.| On_mouse_all of Event.mouse -> 'msg option(*
*)On_mouse_all fdelivers all mouse events regardless of focus.| On_paste of Event.paste -> 'msg option(*
*)On_paste fdelivers paste events only to the currently focused element.| On_paste_all of Event.paste -> 'msg option(*
*)On_paste_all fdelivers all paste events regardless of focus.| On_resize of width:int -> height:int -> 'msg(*
*)On_resize ffiresf ~width ~heightwhenever the terminal is resized.| On_focus of 'msg(*
*)On_focus msgdispatchesmsgwhen the terminal window gains focus.| On_blur of 'msg(*
*)On_blur msgdispatchesmsgwhen the terminal window loses focus.
The type for subscriptions.
batch subs is a subscription that activates every subscription in subs.
every interval f fires f () at approximately interval-second intervals for as long as the subscription is active.
on_tick f fires f ~dt on every rendered frame. dt is the elapsed time in seconds since the previous frame. Use this for animations that must advance at the display frame rate.
on_key f delivers key events to f for the currently focused element. f returns None to ignore an event without dispatching. See also on_key_all.
on_key_all f is like on_key but delivers all key events regardless of which element has focus.
on_mouse f delivers mouse events to f for the currently focused element. See also on_mouse_all.
on_mouse_all f is like on_mouse but delivers all mouse events regardless of focus.
on_paste f delivers paste events to f for the currently focused element. See also on_paste_all.
on_paste_all f is like on_paste but delivers all paste events regardless of focus.
on_resize f fires f ~width ~height whenever the terminal is resized, reporting the new dimensions in columns and rows.
on_focus msg dispatches msg when the terminal window gains focus.