node-ncurses icon indicating copy to clipboard operation
node-ncurses copied to clipboard

Interfacing with the mouse

Open cbou opened this issue 13 years ago • 3 comments

It's possible to detect click on the shell with ncurses.

http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/mouse.html

Is there any problem with the integration of the feature in node-ncurses ?

I just ask for advices and tipps, maybe I could try to do it.

cbou avatar Aug 04 '12 06:08 cbou

Yeah, mouse support has been in the TODO for a long time now.

As far as I know it should be possible to implement, it's just a matter of taking the time to do it and making sure it's well tested. Pull requests are welcome :-)

mscdex avatar Aug 04 '12 07:08 mscdex

Thanks for your answer, maybe I will take time to try it. I think it could be done in the same way than inputChar.

cbou avatar Aug 04 '12 07:08 cbou

I tried something here: https://github.com/cbou/node-ncurses/commit/e1bb2dcde577122ef37c71b5dcd5c4a1b50a5188

I'm not a cpp pro so it's maybe bad.

But it works, I commit a new example too.

It's not ready for push because there is a small problem. If the click is too fast, it won't be detect. Longer click like 500ms - 1sec will be.

Any suggestions or improvements ?

cbou avatar Aug 04 '12 13:08 cbou