开发者

Ruby - Function keys listener with Interruptions

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜