new build
Some checks failed
/ mirror_to_github (push) Failing after 2m22s
/ test (push) Successful in 18s

This commit is contained in:
Leon van Kammen 2025-06-25 18:54:04 +02:00
parent 6f8dfc7bc3
commit 310d7304a4
4 changed files with 21 additions and 21 deletions

@ -1 +1 @@
Subproject commit b3fdd67ee392a0b09eba9b12f74dc9017ef1825d
Subproject commit 2b3c41fa6e4fa3a41edaee5ed325601a92c51bd8

BIN
xrsh.com

Binary file not shown.

View file

@ -1 +1 @@
3d862b0113ad90d79f24897d3616c90156f53eb4fbde4a9f409e88635dd84151 xrsh.com
4bea9e66bcb7e6b084fcafb16a06c28fea99a74b3edd41b7930ab2d78292c6e7 xrsh.com

38
xrsh.js
View file

@ -628,6 +628,14 @@ if( typeof AFRAME != 'undefined '){
const focus = (e) => {
if( event.target == document.activeElement ){
// if we're already focused, the keyboard is already triggerend
// therefore we blur() the element for correctness
// which allows the WebXR keyboard dissappear if implemented at all
// [Meta Quest 2 does not do this]
event.target.blur()
}
// calculate distance between thumb and indexfinger to detect pinch
// which should prevent focus-event (annoying to have keyboard popping up during pinch)
if( e.detail?.withEl?.components['hand-tracking-controls'] ){
@ -677,9 +685,10 @@ if( typeof AFRAME != 'undefined '){
this.el.addEventListener('exec', (e) => this.term.exec( e.detail ) )
this.el.addEventListener('hook', (e) => this.term.hook( e.detail[0], e.detail[1] ) )
this.el.addEventListener('send', (e) => this.term.send( e.detail[0], e.detail[1] || 0 ) )
this.el.addEventListener('create_file', async (e) => await this.term.worker.create_file( e.detail[0], this.term.convert.toUint8Array(e.detail[1]) ) )
this.el.addEventListener('update_file', async (e) => await this.term.worker.update_file( e.detail[0], this.term.convert.toUint8Array(e.detail[1]) ) )
this.el.addEventListener('append_file', async (e) => await this.term.worker.append_file( e.detail[0], this.term.convert.toUint8Array(e.detail[1]) ) )
this.el.addEventListener('create_file', async (e) => await this.term.worker.create_file( e.detail[0], e.detail[1] ) )
this.el.addEventListener('create_file_from_url', async (e) => await this.term.worker.create_file_from_url( e.detail[0], e.detail[1] ) )
this.el.addEventListener('update_file', async (e) => await this.term.worker.update_file( e.detail[0], e.detail[1] ) )
this.el.addEventListener('append_file', async (e) => await this.term.worker.append_file( e.detail[0], e.detail[1] ) )
this.el.addEventListener('read_file', async (e) => {
const buf = await this.term.worker.read_file( e.detail[0] )
const str = new TextDecoder().decode(buf)
@ -2176,15 +2185,14 @@ function ISOTerminal(instance,opts){
ISOTerminal.prototype.emit = function(event,data,sender){
data = data || false
// *TODO* wrap certain events into this.preventFrameDrop( () => { .. }) to boost performance
const evObj = new CustomEvent(event, {detail: data} )
this.preventFrameDrop( () => {
// forward event to worker/instance/AFRAME element or component-function
// this feels complex, but actually keeps event- and function-names more concise in codebase
this.dispatchEvent( evObj )
if( sender != "instance" && this.instance ) this.instance.dispatchEvent(evObj)
if( sender != "worker" && this.worker ) this.worker.postMessage({event,data}, PromiseWorker.prototype.getTransferable(data) )
if( sender !== undefined && typeof this[event] == 'function' ) this[event].apply(this, data && data.push ? data : [data] )
})
// forward event to worker/instance/AFRAME element or component-function
// this feels complex, but actually keeps event- and function-names more concise in codebase
this.dispatchEvent( evObj )
if( sender != "instance" && this.instance ) this.instance.dispatchEvent(evObj)
if( sender != "worker" && this.worker ) this.worker.postMessage({event,data}, PromiseWorker.prototype.getTransferable(data) )
if( sender !== undefined && typeof this[event] == 'function' ) this[event].apply(this, data && data.push ? data : [data] )
}
ISOTerminal.addEventListener = (event,cb) => {
@ -3775,7 +3783,6 @@ Term.prototype.blurHandler = function (ev)
Term.prototype.pasteHandler = function (ev)
{
debugger
var c, str;
if (!this.textarea_has_focus) {
c = ev.clipboardData;
@ -4207,16 +4214,9 @@ ISOTerminal.prototype.TermInit = function(){
// patch Term-class
Term.prototype.move_textarea = function(){} /* *TODO* *FIXME* does not work in winbox */
Term.prototype.pasteHandler = function(original){
return function (ev){
original.apply(this,[ev])
}
}( Term.prototype.pasteHandler )
Term.prototype.keyDownHandler = function(original){
return function (e){
if ((e.ctrlKey || e.metaKey) && e.key === 'v') {
debugger
return true; // bubble up to pasteHandler (see pastedrop.js)
}
original.apply(this,[e])