Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to process arrow keys in CLI-based application, in Haskell? [duplicate]

I'm writing simple console Pomodoro timer (as my Haskell learning exercise): pomodoro-cli

Until that time menu was based on the prompt line. But now I want to replace it with arrow-based menu, like in Yeoman: http://yeoman.io/codelab/install-generators.html

How can I do it in Haskell? I read about System.Console.Terminfo.Keys and other System.Console packages, but not found solution for my question.

like image 501
azaviruha Avatar asked Apr 03 '15 08:04

azaviruha


1 Answers

One way to do that would be to use bindings to ncurses library. Infact ncurses shows you an example of handing the key character "Q" in their sample program.

Another nice Haskell solution is vty-ui which has got a nice documentation to it.

like image 139
Sibi Avatar answered Nov 01 '22 05:11

Sibi