I think narrowed this down. I am able to successfully bind some of the keypad keys
// override keypad add
t.keyboard.bindings.addBinding("107", function() {
return '\x1bkp+';
});
what doesn't work are the keys that give me the warning message No Definition found for keyCode: 12
an example is the clear key. when num lock is off, pressing the 5 key on the keypad is supposed to send a clear which our application recognizes.
I get the warning message: No Definition found for Keycode:12 however even though its just a warning, it is not firing VTKeyStroke
my handler (shown below) is invoked for all the other keys but not keypad 5 and I get the warning.
io.onVTKeystroke = function(str) {
handleKey(str);
};
I added a binding for it
// override keypad clear ( keypad 5)
t.keyboard.bindings.addBinding("12", function() {
return '\x1bkpclear';
});
looking at the code, the warning message is displayed if the key is not found in the keydefs array.
hterm.Keyboard.prototype.onKeyDown_ = function(e) {
if (e.keyCode == 18)
this.altKeyPressed = this.altKeyPressed | (1 << (e.location - 1));
if (e.keyCode == 27)
this.preventChromeAppNonCtrlShiftDefault_(e);
var keyDef = this.keyMap.keyDefs[e.keyCode];
if (!keyDef) {
console.warn('No definition for keyCode: ' + e.keyCode);
return;
}
I noticed a return statement after the warning. Since the keydef information is referenced afterward I can see why it returns, so I figured I needed to add
12 to the keydefs array which is where I am now and that's my only question. I having a little trouble getting there from the doc file. I read it several times.
I need to add [12, '[KP5]', DEFAULT, DEFAULT, DEFAULT, DEFAULT] ); and possibly other keyhs to keydefs.
how to do that is my only question
thanks,
Warren