diff --git a/src/xrsh-com b/src/xrsh-com index 6a4342f..834f5c9 160000 --- a/src/xrsh-com +++ b/src/xrsh-com @@ -1 +1 @@ -Subproject commit 6a4342f1d9ce83f9ef712cbd10d35ecf844e56e5 +Subproject commit 834f5c9b22fdb729d0ab4775c86f36927b8bc2b0 diff --git a/xrsh.com b/xrsh.com index d50d398..80f6ae9 100755 Binary files a/xrsh.com and b/xrsh.com differ diff --git a/xrsh.com.txt b/xrsh.com.txt index 7e7dfce..5d325a3 100644 --- a/xrsh.com.txt +++ b/xrsh.com.txt @@ -1 +1 @@ -dfedff673458686beba2e7e6939dc0f0474d6947387c0efb0cf92b08678c98f9 xrsh.com +471cc09a6433f368246ceb4b5698d59e840420a1b36b1ddb1c923534718d0ede xrsh.com diff --git a/xrsh.js b/xrsh.js index 0736406..ec3e46d 100644 --- a/xrsh.js +++ b/xrsh.js @@ -625,6 +625,15 @@ if( typeof AFRAME != 'undefined '){ instance.addEventListener('window.onmaximize', resize ) const focus = (e) => { + + // 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'] ){ + const hand = e.detail.withEl.components['hand-tracking-controls'] + const thumb = hand.bones.find( (b) => b.name == 'thumb-tip' ) + const diff = thumb.position.distanceTo(hand.indexTipPosition) + if( diff < 0.02) return // pinching! don't trigger keyboard (focus) + } this.el.emit('focus',e.detail) }