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

The inputChar event does not work

Open alexispurslane opened this issue 12 years ago • 4 comments

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?

alexispurslane avatar Oct 10 '13 13:10 alexispurslane

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?

mscdex avatar Oct 10 '13 13:10 mscdex

onKey() is never EVER called

alexispurslane avatar Oct 10 '13 13:10 alexispurslane

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

mscdex avatar Oct 10 '13 14:10 mscdex

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

alexispurslane avatar Oct 10 '13 14:10 alexispurslane