added custom keymappings for VT100
/ mirror_to_github (push) Successful in 18s Details
/ test (push) Successful in 4s Details

This commit is contained in:
Leon van Kammen 2024-11-21 11:28:31 +00:00
parent d93401e572
commit 88c4b21818
2 changed files with 8 additions and 1 deletions

View File

@ -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 )

View File

@ -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.