Skip to content

Commit

Permalink
okie dokie
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorin-Oakenpants authored Oct 14, 2024
1 parent 99dbee7 commit c5475f6
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions tests/pointerevent.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@
<td class="mono" style="text-align: left; vertical-align: top;">
<div class="s6">OVERALL HASH <span class="no_color" id="hash"></span></div><br></div>
<div class="s4"><u>POINTER</u> <span class="no_color" id="pointerhash"></span></div><br><div class="no_color spaces" id="results"></div>
<div class="s4"><u>TOUCH</u><span class="no_color" id="touchhash"></span></div><br><div class="no_color" id="touch"></div>
<hr><br>
<div class="s4"><u>TOUCH</u> <span class="no_color" id="touchhash"></span></div><br><div class="no_color spaces" id="touch"></div><hr><br>
<div class="s6 spaces"> maxTouchPoints <span class="no_color" id="maxTouchPoints"></span></div></div><br>
<div class="s6 spaces">touch properties <span class="no_color" id="touch_properties"></span></div><br>
<div class="s6 spaces"> touch keys <span class="no_color" id="touch_keys"></span></div><br><hr><br>
Expand All @@ -79,7 +78,7 @@
// https://bugzilla.mozilla.org/show_bug.cgi?id=1363508

let padlen = 18
let oData = {} // pointer
let oData = {'pointerdown': {}, 'pointerover': {}}
let oTouch = {} // touch! doh!!
let oHash = {
'pointer': '',
Expand All @@ -94,7 +93,7 @@
function finish() {
if (0 == Object.keys(oData['pointerdown']).length) {return}
if (0 == Object.keys(oData['pointerover']).length) {return}
if (oHash['touch_keys'] !== 'none' && 0 == Object.keys(oData['touchstart']).length) {return}
if (oHash['touch_keys'] !== 'none' && 0 == Object.keys(oTouch).length) {return}
// yay
let hash = mini(oHash)
dom.hash = hash
Expand All @@ -103,7 +102,6 @@
console.log('touch\n', oTouch)
}


function runtouch(event, type) {
// return if we already captured it
if (0 !== Object.keys(oTouch).length) {return}
Expand Down Expand Up @@ -134,15 +132,14 @@
}
oTemp[k] = value
})
// merge
// screen matches client
let matchX = false, matchY = false
let A = oTemp['clientX'], B = oTemp['screenX']
if ('number' == A && 'number' == B) {matchX = A == B}
if ('number' == typeof A && 'number' == typeof B) {matchX = A === B}
oTouch['client_screenX'] = matchX
oDisplay.push(s6 + ('client|screen X').padStart(padlen) +": "+ sc + A +' | '+ B +' '+ (matchX ? '[valid match]' : '[!match]'))

let C = oTemp['clientY'], D = oTemp['screenY']
if ('number' == C && 'number' == D) {matchY = C == D}
if ('number' == typeof C && 'number' == typeof D) {matchY = C === D}
oTouch['client_screenY'] = matchY
oDisplay.push(s6 + ('client|screen Y').padStart(padlen) +": "+ sc + C +' | '+ D +' '+ (matchY ? '[valid match]' : '[!match]'))

Expand All @@ -154,10 +151,11 @@
})
dom.touch.innerHTML = oDisplay.join("<br>") + '<br><br>'
let hash = mini(oTouch)
oHash['touch'] = hash
dom.touchhash = hash
finish()
} catch(e) {
dom.touch.innerHTML = e+''
dom.touch.innerHTML = e+'<br>'
}
}

Expand Down

0 comments on commit c5475f6

Please sign in to comment.