1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138
|
(* Js_of_ocaml library
* http://www.ocsigen.org/js_of_ocaml/
* Copyright (C) 2010 Vincent Balat
* Laboratoire PPS - CNRS Université Paris Diderot
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, with linking exception;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*)
(** Programming mouse or keyboard events handlers using Lwt *)
open Js_of_ocaml
(**
Reminder:
Event capturing starts with the outer most element in the DOM and
works inwards to the HTML element the event took place on (capture phase)
and then out again (bubbling phase).
Examples of use:
Waiting for a click on [elt1] before continuing:
{[let%lwt _ = Lwt_js_events.click elt1 in]}
Doing some operation for each value change in input element [inp]:
{[Lwt_js_events.(async (fun () ->
clicks inp1 (fun ev _ -> ...)
))]}
Defining a thread that waits for ESC key on an element:
{[let rec esc elt =
let%lwt ev = keydown elt in
if ev##.keyCode = 27
then Lwt.return ev
else esc elt]}
Waiting for a click or escape key before continuing:
{[let%lwt () =
Lwt.pick [(let%lwt _ = esc Dom_html.document in Lwt.return ());
(let%lwt _ = click Dom_html.document in Lwt.return ())]
in ...]}
{2 Create Lwt threads for events} *)
val make_event :
(#Dom_html.event as 'a) Js.t Dom_html.Event.typ
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> 'a Js.t Lwt.t
(** [make_event ev target] creates a Lwt thread that waits
for the event [ev] to happen on [target] (once).
This thread isa cancellable using [Lwt.cancel].
If you set the optional parameter [~use_capture:true],
the event will be caught during the capture phase,
otherwise it is caught during the bubbling phase
(default).
If you set the optional parameter [~passive:true],
the user agent will ignore [preventDefault] calls
inside the event callback.
*)
val seq_loop :
(?use_capture:bool -> ?passive:bool -> 'target -> 'event Lwt.t)
-> ?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> 'target
-> ('event -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
(** [seq_loop (make_event ev) target handler] creates a looping Lwt
thread that waits for the event [ev] to happen on [target], then
execute handler, and start again waiting for the event. Events
happening during the execution of the handler are ignored. See
[async_loop] and [buffered_loop] for alternative semantics.
For example, the [clicks] function below is defined by:
[let clicks ?use_capture ?passive t = seq_loop click ?use_capture ?passive t]
The thread returned is cancellable using [Lwt.cancel].
In order for the loop thread to be canceled from within the handler,
the latter receives the former as its second parameter.
By default, cancelling the loop will not cancel the potential
currently running handler. This behaviour can be changed by
setting the [cancel_handler] parameter to true.
*)
val async_loop :
(?use_capture:bool -> ?passive:bool -> 'target -> 'event Lwt.t)
-> ?use_capture:bool
-> ?passive:bool
-> 'target
-> ('event -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
(** [async_loop] is similar to [seq_loop], but each handler runs
independently. No event is thus missed, but since several
instances of the handler can be run concurrently, it is up to the
programmer to ensure that they interact correctly.
Cancelling the loop will not cancel the potential currently running
handlers.
*)
val buffered_loop :
(?use_capture:bool -> ?passive:bool -> 'target -> 'event Lwt.t)
-> ?cancel_handler:bool
-> ?cancel_queue:bool
-> ?use_capture:bool
-> ?passive:bool
-> 'target
-> ('event -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
(** [buffered_loop] is similar to [seq_loop], but any event that
occurs during an execution of the handler is queued instead of
being ignored.
No event is thus missed, but there can be a non predictable delay
between its trigger and its treatment. It is thus a good idea to
use this loop with handlers whose running time is short, so the
memorized event still makes sense when the handler is eventually
executed. It is also up to the programmer to ensure that event
handlers terminate so the queue will eventually be emptied.
By default, cancelling the loop will not cancel the (potential)
currently running handler, but any other queued event will be
dropped. This behaviour can be customized using the two optional
parameters [cancel_handler] and [cancel_queue].
*)
val async : (unit -> unit Lwt.t) -> unit
(** [async t] records a thread to be executed later.
It is implemented by calling yield, then Lwt.async.
This is useful if you want to create a new event listener
when you are inside an event handler.
This avoids the current event to be caught by the new event handler
(if it propagates).
*)
val func_limited_loop :
(?use_capture:bool -> ?passive:bool -> 'a -> 'b Lwt.t)
-> (unit -> 'a Lwt.t)
-> ?use_capture:bool
-> ?passive:bool
-> 'a
-> ('b -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
(** [func_limited_loop event delay_fun target handler] will behave like
[Lwt_js_events.async_loop event target handler] but it will run [delay_fun]
first, and execute [handler] only when [delay_fun] is finished and
no other event occurred in the meantime.
This allows to limit the number of events caught.
Be careful, it is an asynchrone loop, so if you give too little time,
several instances of your handler could be run in same time **)
val limited_loop :
(?use_capture:bool -> ?passive:bool -> 'a -> 'b Lwt.t)
-> ?elapsed_time:float
-> ?use_capture:bool
-> ?passive:bool
-> 'a
-> ('b -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
(** Same as func_limited_loop but take time instead of function
By default elapsed_time = 0.1s = 100ms **)
(** {2 Predefined functions for some types of events} *)
val click :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.mouseEvent Js.t Lwt.t
val copy :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.clipboardEvent Js.t Lwt.t
val cut :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.clipboardEvent Js.t Lwt.t
val paste :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.clipboardEvent Js.t Lwt.t
val dblclick :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.mouseEvent Js.t Lwt.t
val mousedown :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.mouseEvent Js.t Lwt.t
val mouseup :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.mouseEvent Js.t Lwt.t
val mouseover :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.mouseEvent Js.t Lwt.t
val mousemove :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.mouseEvent Js.t Lwt.t
val mouseout :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.mouseEvent Js.t Lwt.t
val keypress :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.keyboardEvent Js.t Lwt.t
val keydown :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.keyboardEvent Js.t Lwt.t
val keyup :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.keyboardEvent Js.t Lwt.t
val input :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val timeupdate :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val change :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val dragstart :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.dragEvent Js.t Lwt.t
val dragend :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.dragEvent Js.t Lwt.t
val dragenter :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.dragEvent Js.t Lwt.t
val dragover :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.dragEvent Js.t Lwt.t
val dragleave :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.dragEvent Js.t Lwt.t
val drag :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.dragEvent Js.t Lwt.t
val drop :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.dragEvent Js.t Lwt.t
val focus :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.focusEvent Js.t Lwt.t
val blur :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.focusEvent Js.t Lwt.t
val scroll :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val submit :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.submitEvent Js.t Lwt.t
val select :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val mousewheel :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.mouseEvent Js.t * (int * int)) Lwt.t
(** This function returns the event,
together with the numbers of ticks the mouse wheel moved.
Positive means down or right.
This interface is compatible with all (recent) browsers. *)
val touchstart :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.touchEvent Js.t Lwt.t
val touchmove :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.touchEvent Js.t Lwt.t
val touchend :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.touchEvent Js.t Lwt.t
val touchcancel :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.touchEvent Js.t Lwt.t
val lostpointercapture :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.pointerEvent Js.t Lwt.t
val gotpointercapture :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.pointerEvent Js.t Lwt.t
val pointerenter :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.pointerEvent Js.t Lwt.t
val pointercancel :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.pointerEvent Js.t Lwt.t
val pointerdown :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.pointerEvent Js.t Lwt.t
val pointerleave :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.pointerEvent Js.t Lwt.t
val pointermove :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.pointerEvent Js.t Lwt.t
val pointerout :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.pointerEvent Js.t Lwt.t
val pointerover :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.pointerEvent Js.t Lwt.t
val pointerup :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.pointerEvent Js.t Lwt.t
val transitionend : #Dom_html.eventTarget Js.t -> unit Lwt.t
(** Returns when a CSS transition terminates on the element. *)
val transitionends :
?cancel_handler:bool
-> #Dom_html.eventTarget Js.t
-> (unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val load :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.imageElement Js.t
-> Dom_html.event Js.t Lwt.t
val error :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.imageElement Js.t
-> Dom_html.event Js.t Lwt.t
val abort :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.imageElement Js.t
-> Dom_html.event Js.t Lwt.t
val canplay :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val canplaythrough :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val durationchange :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val emptied :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val ended :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val loadeddata :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val loadedmetadata :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val loadstart :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val pause :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val play :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val playing :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val ratechange :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val seeked :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val seeking :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val stalled :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val suspend :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val volumechange :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val waiting :
?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> Dom_html.event Js.t Lwt.t
val clicks :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.mouseEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val copies :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.clipboardEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val cuts :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.clipboardEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val pastes :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.clipboardEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val dblclicks :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.mouseEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val mousedowns :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.mouseEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val mouseups :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.mouseEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val mouseovers :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.mouseEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val mousemoves :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.mouseEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val mouseouts :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.mouseEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val keypresses :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.keyboardEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val keydowns :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.keyboardEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val keyups :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.keyboardEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val inputs :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val timeupdates :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val changes :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val dragstarts :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.dragEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val dragends :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.dragEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val dragenters :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.dragEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val dragovers :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.dragEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val dragleaves :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.dragEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val drags :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.dragEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val drops :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.dragEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val mousewheels :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.mouseEvent Js.t * (int * int) -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val touchstarts :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.touchEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val touchmoves :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.touchEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val touchends :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.touchEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val touchcancels :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.touchEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val focuses :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.focusEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val blurs :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.focusEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val scrolls :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val submits :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.submitEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val selects :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val loads :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.imageElement Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val errors :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.imageElement Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val aborts :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.imageElement Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val canplays :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val canplaythroughs :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val durationchanges :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val emptieds :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val endeds :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val loadeddatas :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val loadedmetadatas :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val loadstarts :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val pauses :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val plays :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val playings :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val ratechanges :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val seekeds :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val seekings :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val stalleds :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val suspends :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val volumechanges :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val waitings :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val lostpointercaptures :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.pointerEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val gotpointercaptures :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.pointerEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val pointerenters :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.pointerEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val pointercancels :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.pointerEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val pointerdowns :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.pointerEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val pointerleaves :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.pointerEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val pointermoves :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.pointerEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val pointerouts :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.pointerEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val pointerovers :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.pointerEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val pointerups :
?cancel_handler:bool
-> ?use_capture:bool
-> ?passive:bool
-> #Dom_html.eventTarget Js.t
-> (Dom_html.pointerEvent Js.t -> unit Lwt.t -> unit Lwt.t)
-> unit Lwt.t
val request_animation_frame : unit -> unit Lwt.t
(** Returns when a repaint of the window by the browser starts.
(see JS method [window.requestAnimationFrame]) *)
val onload : unit -> Dom_html.event Js.t Lwt.t
(** Returns when the page is loaded *)
val domContentLoaded : unit -> unit Lwt.t
val onunload : unit -> Dom_html.event Js.t Lwt.t
val onbeforeunload : unit -> Dom_html.event Js.t Lwt.t
val onresize : unit -> Dom_html.event Js.t Lwt.t
val onorientationchange : unit -> Dom_html.event Js.t Lwt.t
val onpopstate : unit -> Dom_html.popStateEvent Js.t Lwt.t
val onhashchange : unit -> Dom_html.hashChangeEvent Js.t Lwt.t
val onorientationchange_or_onresize : unit -> Dom_html.event Js.t Lwt.t
val onresizes : (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t) -> unit Lwt.t
val onorientationchanges : (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t) -> unit Lwt.t
val onpopstates : (Dom_html.popStateEvent Js.t -> unit Lwt.t -> unit Lwt.t) -> unit Lwt.t
val onhashchanges :
(Dom_html.hashChangeEvent Js.t -> unit Lwt.t -> unit Lwt.t) -> unit Lwt.t
val onorientationchanges_or_onresizes :
(Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t) -> unit Lwt.t
val limited_onresizes :
?elapsed_time:float -> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t) -> unit Lwt.t
val limited_onorientationchanges :
?elapsed_time:float -> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t) -> unit Lwt.t
val limited_onorientationchanges_or_onresizes :
?elapsed_time:float -> (Dom_html.event Js.t -> unit Lwt.t -> unit Lwt.t) -> unit Lwt.t
|