Compare commits

...

2 Commits

Author SHA1 Message Date
Leon van Kammen 8375e5f1b5 better auto-position window
/ mirror_to_github (push) Successful in 18s Details
/ test (push) Successful in 3s Details
2024-10-28 12:25:14 +00:00
Leon van Kammen 5aeb860aef enter-workaround quest 2 2024-10-28 12:25:03 +00:00
2 changed files with 14 additions and 6 deletions

View File

@ -1340,6 +1340,15 @@ VT100.prototype.setupTouchInputFallback = function(){
this.form.appendChild(this.input)
this.scr_.parentElement.appendChild(this.form)
this.input.addEventListener('blur', () => {
if( this.input.value != '' ){
ch = '\n'
this.key_buf_.push(ch);
setTimeout(VT100.go_getch_, 0);
this.input.value = ''
}
})
this.input.addEventListener("keydown", VT100.handle_onkeypress_, false);
this.input.handler = (e) => {

View File

@ -70,7 +70,7 @@ AFRAME.registerComponent('window', {
if( els.length < 2 ) return
let current = els[ els.length-1 ]
let last = els[ els.length-2 ]
AFRAME.utils.positionObjectNextToNeighbor( current.object3D , last.object3D, els.length )
AFRAME.utils.positionObjectNextToNeighbor( current.object3D , last.object3D, 0.02 )
}
},
@ -79,11 +79,10 @@ AFRAME.registerComponent('window', {
}
})
AFRAME.utils.positionObjectNextToNeighbor = function positionObjectNextToNeighbor(object, lastNeighbor = null, neighbours, margin = 0.45, degree = 20) {
AFRAME.utils.positionObjectNextToNeighbor = function positionObjectNextToNeighbor(object, lastNeighbor = null, margin ){
// *FIXME* this could be more sophisticated :)
object.position.x = lastNeighbor.position.x + ((neighbours-1) * margin)
object.position.y = lastNeighbor.position.y
object.position.z = lastNeighbor.position.z
//object.rotation.y += THREE.MathUtils.degToRad( (neighbours-1) * degree);
object.position.x = lastNeighbor.position.x + margin
object.position.y = lastNeighbor.position.y - margin
object.position.z = lastNeighbor.position.z + margin
}