开发者

Ruby - Function keys listener with Interruptions

开发者 https://www.devze.com 2023-03-31 08:56 出处:网络
I would like to add some listeners on F1..F4 keys for example in order to make a loop program interactive with users....

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

精彩评论

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