node-ncurses
node-ncurses copied to clipboard
The inputChar event does not work
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?
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?
onKey() is never EVER called
Can you show the rest of your code? What platform and node version are you on?
Actually, I think I got it working. By the way, the project i'm working on is writing a text-editor in node!