Module Input.Event

Events (e.g. keypresses) reported to the application from libinput.

type +_ t

An event notification related to a device.

Use get to get the next event from libinput.

See https://wayland.freedesktop.org/libinput/doc/latest/api/group__base.html

val get : [ `Udev | `Path ] Context.t -> [ `Unclassified ] t option

get context retrieves the next event from libinput's internal event queue.

Events are added to the queue by Context.dispatch. Use get_type to examine the event.

val destroy : _ t -> unit

destroy t frees the C event and marks the OCaml wrapper as destroyed.

This will be called automatically when the event gets GC'd anyway, but you may prefer to free the event manually earlier.

val pp : _ t Fmt.t
val get_context : _ t -> [ `Udev | `Path ] Context.t
val get_device : _ t -> Device.t
module Device : sig ... end

Events about devices being added and removed.

module Keyboard : sig ... end

Events from keyboard devices.

module Pointer : sig ... end

Events from mice, touchpads, etc.

module Touch : sig ... end

Events from touch screens (but not graphics tablets or touchpads).

module Tablet_tool : sig ... end

Events from graphics tablet tools (e.g. pens).

module Tablet_pad : sig ... end

Events from graphics tablet controls.

module Gesture : sig ... end

Gestures (e.g. pinch-to-zoom on a touchpad).

module Switch : sig ... end

Simple on/off switches.

type ty = [
  1. | Device.ty
  2. | Keyboard.ty
  3. | Pointer.ty
  4. | Touch.ty
  5. | Tablet_tool.ty
  6. | Tablet_pad.ty
  7. | Gesture.ty
  8. | Switch.ty
  9. | `Unknown of [ `Unknown ] t
]
val get_type : _ t -> ty

get_type t classifies an event by its type, and provides access to type-specific details.

val pp_ty : [< ty ] Fmt.t