Skip to content

HOME/END key issue #34

@franck34

Description

@franck34

While running this code, we can see UP/DOWN/LEFT/RIGHT return only one key code.

But HOME/END don't have same behavior (onChar event fired multiple times, now way to catch HOME/END keys ?)

Playing with EscDelay doesn't solve the problem (i've tried 0,10,1000);

Any idea ?

var nc = require('ncurses');

// If Ctrl+C, let's clean up and exit as clean as possible
process.on('SIGINT', function() {
    nc.cleanup();
    process.exit();
});

var debugLine=1;
var debugMsg = function(msg) {
    winDebug.print(msg+'');
    debugLine++;
    winDebug.cursor(debugLine,1);
    winDebug.refresh();
}

// Draw the main window
var win = new nc.Window();

// Draw debug second window
var winDebug = new nc.Window(20,20,0,0);

winDebug.frame('Debug');
winDebug.cursor(1,1);

nc.redraw();

//nc.setEscDelay(10);

var onKey = function(chr,chrCode,isKey) {
    debugMsg(chrCode+'');
}

winDebug.on('inputChar',onKey);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions