mscdex / node-ncurses

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

The inputChar event does not work #40

Open alexispurslane opened 10 years ago

alexispurslane commented 10 years ago

I have this code:

 36 win.on('inputChar', (onKey))

and then for onKey:

  6 function onKey (_, charCode, __) {
  7     if (charCode == nc.keys.ENTER) {
  8         if (cX > 2) {
  9             cX++;
 10             nc.refresh();
 11         }
 12     }
 13 }

yet, it does NOTHING, but also has no error. help?

mscdex commented 10 years ago

By "does not work" do you mean onKey is not called at all or just that the code inside your if-statement is not being executed?

alexispurslane commented 10 years ago

onKey() is never EVER called

mscdex commented 10 years ago

Can you show the rest of your code? What platform and node version are you on?

alexispurslane commented 10 years ago

Actually, I think I got it working. By the way, the project i'm working on is writing a text-editor in node!