mscdex / node-ncurses

An ncurses binding for node.js
MIT License
386 stars 25 forks source link

Interfacing with the mouse #19

Open cbou opened 12 years ago

cbou commented 12 years ago

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.

mscdex commented 12 years ago

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 :-)

cbou commented 12 years ago

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 commented 12 years ago

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 ?