I would like to add some listeners on F1..F4 keys for example in order to make a loop program interactive with users....
For exemple: exiting some while
loops, entering some if
loops or printing some messages...
My searches on that subject routed me to Curses module But the documentation he开发者_StackOverflow中文版re is quite poor, and I can't make it work... And I found Kernel.trap
but it only trap some inside events and I would like to add some listeners to create other events.
I didn't find any gems or gits which could help me to do that. Is it possible to do it with ruby? What's the best/versatile way?
精彩评论