keyboard focus: blur/focus toggle
This commit is contained in:
parent
b3fdd67ee3
commit
2b3c41fa6e
2 changed files with 8 additions and 1 deletions
|
|
@ -390,6 +390,14 @@ if( typeof AFRAME != 'undefined '){
|
||||||
|
|
||||||
const focus = (e) => {
|
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
|
// calculate distance between thumb and indexfinger to detect pinch
|
||||||
// which should prevent focus-event (annoying to have keyboard popping up during pinch)
|
// which should prevent focus-event (annoying to have keyboard popping up during pinch)
|
||||||
if( e.detail?.withEl?.components['hand-tracking-controls'] ){
|
if( e.detail?.withEl?.components['hand-tracking-controls'] ){
|
||||||
|
|
|
||||||
|
|
@ -1259,7 +1259,6 @@ Term.prototype.blurHandler = function (ev)
|
||||||
|
|
||||||
Term.prototype.pasteHandler = function (ev)
|
Term.prototype.pasteHandler = function (ev)
|
||||||
{
|
{
|
||||||
debugger
|
|
||||||
var c, str;
|
var c, str;
|
||||||
if (!this.textarea_has_focus) {
|
if (!this.textarea_has_focus) {
|
||||||
c = ev.clipboardData;
|
c = ev.clipboardData;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue