Module OgamlGraphics.Mouse

Getting real-time mouse information

This module allows real-time access to the mouse, to check if a button is currently pressed for example.


Accessing position

val position : unit -> OgamlMath.Vector2i.t
Returns the position of the cursor relatively to the screen.
See : OgamlMath.Vector2i
val relative_position : Window.t -> OgamlMath.Vector2i.t
Returns the position of the cursor relatively to a window.
See : OgamlGraphics.Window
See : OgamlMath.Vector2i

Setting position

val set_position : OgamlMath.Vector2i.t -> unit
Sets the position of the cursor relatively to the screen
See : OgamlMath.Vector2i
val set_relative_position : Window.t -> OgamlMath.Vector2i.t -> unit
Sets the position of the cursor relatively to a window
See : OgamlGraphics.Window
See : OgamlMath.Vector2i

Accessing button information

val is_pressed : OgamlCore.Button.t -> bool
Check whether a given mouse button is currently held down
See : OgamlCore.Button