added custom keymappings for VT100
This commit is contained in:
parent
d93401e572
commit
88c4b21818
|
@ -314,7 +314,11 @@ if( typeof AFRAME != 'undefined '){
|
|||
max_scroll_lines: this.rows,
|
||||
nodim: true,
|
||||
rainbow: [VT100.COLOR_MAGENTA, VT100.COLOR_CYAN ],
|
||||
xr: AFRAME.scenes[0].renderer.xr
|
||||
xr: AFRAME.scenes[0].renderer.xr,
|
||||
map: {
|
||||
'ArrowRight': { ch: false, ctrl: '\x1b\x66' }, // this triggers ash-shell forward-word
|
||||
'ArrowLeft': { ch: false, ctrl: '\x1b\x62' } // backward-word
|
||||
}
|
||||
}
|
||||
this.term.emit('initVT100',this)
|
||||
this.vt100 = new VT100( this.term.opts.vt100 )
|
||||
|
|
|
@ -266,6 +266,9 @@ VT100.handle_onkeypress_ = function VT100_handle_onkeypress(event,cb)
|
|||
return true
|
||||
break;
|
||||
}
|
||||
// custom map override
|
||||
if( vt.opts.map[ event.code ].ch ) ch = vt.opts.map[ event.code ].ch
|
||||
if( vt.opts.map[ event.code ].ctrl && event.ctrlKey ) ch = vt.opts.map[ event.code ].ctrl
|
||||
}
|
||||
|
||||
// Workaround: top the event from doing anything else.
|
||||
|
|
Loading…
Reference in New Issue