diff --git a/com/isoterminal.js b/com/isoterminal.js index 930df54..62ba49f 100644 --- a/com/isoterminal.js +++ b/com/isoterminal.js @@ -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 ) diff --git a/com/isoterminal/VT100.js b/com/isoterminal/VT100.js index a16c5d2..57884c9 100644 --- a/com/isoterminal/VT100.js +++ b/com/isoterminal/VT100.js @@ -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.