You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bitmap 3D PFP: detect-it-style input classification + first-input refinement
Replaces the single-shot pointer:coarse / ontouchstart probe (which
broke for iPad+Pencil, Surface, Android desktop mode) with the
detect-it library's documented heuristic, inlined as a few lines:
hasTouch = navigator.maxTouchPoints > 0 || 'ontouchstart' in window
hasFinePointer = matchMedia('(pointer: fine)').matches
anyHover = matchMedia('(any-hover: hover)').matches
anyFinePointer = matchMedia('(any-pointer: fine)').matches
hybrid = hasTouch && (hasFinePointer || anyHover || anyFinePointer)
touchOnly = hasTouch
mouseOnly = neither
Initial overlay state at PFP entry maps to:
mouseOnly -> no touch UI (Space + mouse only)
touchOnly -> touch UI shown
hybrid -> touch UI shown (last-input refinement flips it)
First-input refinement: a pointerdown listener reads
PointerEvent.pointerType ('mouse' | 'touch' | 'pen') and updates
lastInput. The keydown handler also flips lastInput to 'kbm'. The
showTouchUi flag follows lastInput, so a hybrid user typing on the
keyboard hides the jump button; touching the canvas brings it back.
Canvas click no longer requests pointer lock when lastInput is 'touch'
-- iOS Safari rejects pointer lock anyway, and intercepting the tap
would steal the touch-look gesture from the user's first interaction.
Pattern lifted from Unity/Unreal "control schemes with automatic
switching based on the last input used" + detect-it (rafgraph/detect-it)
+ MDN's PointerEvent.pointerType guidance. References in the prior
research agent output.
Copy file name to clipboardExpand all lines: frontend/src/app/components/_ordpool/digital-artifact-viewer/bitmap-viewer/bitmap-3d-renderer.component.ts
0 commit comments