LIRC (Linux Infrared Remote Control) is a project
that enable applications to deal with signals sent by an infrared remote controller.
But, nobody is perfect... it is written in C :-(
OCaml-Lirc is just an OCaml interface to the lirc_client C API !
Here is a simple example :
let f = function
| "quit" -> print_string "byebye..."; print_newline(); false
| s -> print_string s; print_newline(); true
in
Lirc.connect "hw" f
>ocamlc -o hw -I +lirc lirc.cma hw.ml
begin
button = PLAY
prog = hw
config = hello
end begin
button = PAUSE
prog = hw
config = world
end begin
button = STOP
prog = hw
config = quit
end