Module Event.Pointer

Events from mice, touchpads, etc.

type ty = [
  1. | `Pointer_motion of [ `Pointer_motion ] t
  2. | `Pointer_motion_absolute of [ `Pointer_motion_absolute ] t
  3. | `Pointer_button of [ `Pointer_button ] t
  4. | `Pointer_axis of [ `Pointer_axis ] t
    (*

    Deprecated; use the scroll events below instead.

    *)
  5. | `Pointer_scroll_wheel of [ `Pointer_scroll_wheel ] t
  6. | `Pointer_scroll_finger of [ `Pointer_scroll_finger ] t
  7. | `Pointer_scroll_continuous of [ `Pointer_scroll_continuous ] t
]
type any = [
  1. | `Pointer_motion
  2. | `Pointer_motion_absolute
  3. | `Pointer_button
  4. | `Pointer_axis
  5. | `Pointer_scroll_wheel
  6. | `Pointer_scroll_finger
  7. | `Pointer_scroll_continuous
]
val get_button : [ `Pointer_button ] t -> Keycode.t
val get_button_state : [ `Pointer_button ] t -> [ `Released | `Pressed ]
val get_seat_button_count : [ `Pointer_button ] t -> int
val get_dx : [ `Pointer_motion ] t -> float
val get_dy : [ `Pointer_motion ] t -> float
val get_dx_unaccelerated : [ `Pointer_motion ] t -> float
val get_dy_unaccelerated : [ `Pointer_motion ] t -> float
val get_absolute_x : [ `Pointer_motion_absolute ] t -> float
val get_absolute_y : [ `Pointer_motion_absolute ] t -> float
val get_absolute_x_transformed : [ `Pointer_motion_absolute ] t -> width:int -> float
val get_absolute_y_transformed : [ `Pointer_motion_absolute ] t -> height:int -> float
val get_time : [< any ] t -> Timestamp.t
val has_axis : [< `Pointer_scroll_wheel | `Pointer_scroll_finger | `Pointer_scroll_continuous ] t -> [ `Scroll_vertical | `Scroll_horizontal ] -> bool
val get_scroll_value : [< `Pointer_scroll_wheel | `Pointer_scroll_finger | `Pointer_scroll_continuous ] t -> [ `Scroll_vertical | `Scroll_horizontal ] -> float option

For scroll wheels, using get_scroll_value_v120 is preferred.

val get_scroll_value_v120 : [ `Pointer_scroll_wheel ] t -> [ `Scroll_vertical | `Scroll_horizontal ] -> float option

High-resolution scroll events, normalized to the -120..+120 range.

e.g. +/- 120 represents one logical click of the wheel.