1999-12-16 00:37:38 -08:00
|
|
|
let cCAMLtoTKmodifier : modifier -> string = function
|
2000-02-16 03:51:37 -08:00
|
|
|
| `Control -> "Control-"
|
1999-12-16 00:37:38 -08:00
|
|
|
| `Shift -> "Shift-"
|
|
|
|
| `Lock -> "Lock-"
|
|
|
|
| `Button1 -> "Button1-"
|
|
|
|
| `Button2 -> "Button2-"
|
|
|
|
| `Button3 -> "Button3-"
|
|
|
|
| `Button4 -> "Button4-"
|
|
|
|
| `Button5 -> "Button5-"
|
|
|
|
| `Double -> "Double-"
|
|
|
|
| `Triple -> "Triple-"
|
|
|
|
| `Mod1 -> "Mod1-"
|
|
|
|
| `Mod2 -> "Mod2-"
|
|
|
|
| `Mod3 -> "Mod3-"
|
|
|
|
| `Mod4 -> "Mod4-"
|
|
|
|
| `Mod5 -> "Mod5-"
|
|
|
|
| `Meta -> "Meta-"
|
|
|
|
| `Alt -> "Alt-"
|
|
|
|
|
|
|
|
let cCAMLtoTKevent (ev : event) =
|
|
|
|
let rec convert = function
|
2000-02-16 03:51:37 -08:00
|
|
|
| `ButtonPress -> "ButtonPress"
|
1999-11-30 06:59:39 -08:00
|
|
|
| `ButtonPressDetail n -> "ButtonPress-"^string_of_int n
|
|
|
|
| `ButtonRelease -> "ButtonRelease"
|
|
|
|
| `ButtonReleaseDetail n -> "ButtonRelease-"^string_of_int n
|
|
|
|
| `Circulate -> "Circulate"
|
2000-10-16 00:14:26 -07:00
|
|
|
| `Colormap -> "Colormap"
|
1999-11-30 06:59:39 -08:00
|
|
|
| `Configure -> "Configure"
|
|
|
|
| `Destroy -> "Destroy"
|
|
|
|
| `Enter -> "Enter"
|
|
|
|
| `Expose -> "Expose"
|
|
|
|
| `FocusIn -> "FocusIn"
|
|
|
|
| `FocusOut -> "FocusOut"
|
|
|
|
| `Gravity -> "Gravity"
|
|
|
|
| `KeyPress -> "KeyPress"
|
|
|
|
| `KeyPressDetail s -> "KeyPress-"^s
|
|
|
|
| `KeyRelease -> "KeyRelease"
|
|
|
|
| `KeyReleaseDetail s -> "KeyRelease-"^s
|
|
|
|
| `Leave -> "Leave"
|
|
|
|
| `Map -> "Map"
|
|
|
|
| `Motion -> "Motion"
|
|
|
|
| `Property -> "Property"
|
|
|
|
| `Reparent -> "Reparent"
|
|
|
|
| `Unmap -> "Unmap"
|
1999-12-16 00:37:38 -08:00
|
|
|
| `Visibility -> "Visibility"
|
|
|
|
| `Modified(ml, ev) ->
|
2000-04-11 20:43:25 -07:00
|
|
|
String.concat ~sep:"" (List.map ~f:cCAMLtoTKmodifier ml)
|
1999-12-16 00:37:38 -08:00
|
|
|
^ convert ev
|
|
|
|
in "<" ^ convert ev ^ ">"
|
1999-11-30 06:59:39 -08:00
|
|
|
|
1999-12-16 00:37:38 -08:00
|
|
|
let cCAMLtoTKeventSequence (l : event list) =
|
2000-04-11 20:43:25 -07:00
|
|
|
TkToken(String.concat ~sep:"" (List.map ~f:cCAMLtoTKevent l))
|
1999-11-30 06:59:39 -08:00
|
|
|
|
|
|
|
|