package lambda-term

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file lTerm_mouse.ml

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
(*
 * lTerm_mouse.ml
 * --------------
 * Copyright : (c) 2011, Jeremie Dimino <jeremie@dimino.org>
 * Licence   : BSD3
 *
 * This file is a part of Lambda-Term.
 *)

type button =
  | Button1
  | Button2
  | Button3
  | Button4
  | Button5
  | Button6
  | Button7
  | Button8
  | Button9

type t = {
  control : bool;
  meta : bool;
  shift : bool;
  button : button;
  row : int;
  col : int;
}

let compare = compare

let control m = m.control
let meta m = m.meta
let button m = m.button
let row m = m.row
let col m = m.col
let coord m = { LTerm_geom.row = row m; col = col m }

let string_of_button = function
  | Button1 -> "Button1"
  | Button2 -> "Button2"
  | Button3 -> "Button3"
  | Button4 -> "Button4"
  | Button5 -> "Button5"
  | Button6 -> "Button6"
  | Button7 -> "Button7"
  | Button8 -> "Button8"
  | Button9 -> "Button9"

let to_string m =
  Printf.sprintf
    "{ control = %B; meta = %B; shift = %B; button = %s; row = %d; col = %d }"
    m.control m.meta m.shift (string_of_button m.button) m.row m.col
OCaml

Innovation. Community. Security.