is it possible to have a cross-platform way to handle backspace and arrows keys within a C or OCaml program?
Actually an OCaml solution would be appreciated but many standard unix functions are wrapped directly to corresponding API calls so there's should be no problem in porting a C solution.
What I'm going to achieve is to catch the arrow keys to override its behaviour inside the shell (by repropting last line or operations like these). I think that this thing falls before the actual program and it's not handled by code itself so I don't know if it's possible.
The program is compiled either on Linux, OS X and Windows (on cygwin) so I would like to do it for all platforms..