Save point: use touchend-based double-tap detection for reliable skip on all scenes
This commit is contained in:
12
index.html
12
index.html
@@ -5837,9 +5837,21 @@ html[data-view="mobile"] #exfilDeskCanvas { max-height: 500px; }
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Double-click/tap to skip scene (same as Escape on desktop)
|
// Double-click/tap to skip scene (same as Escape on desktop)
|
||||||
|
if (isAndroidApp) {
|
||||||
|
let lastTapTime = 0;
|
||||||
|
document.addEventListener('touchend', (e) => {
|
||||||
|
const now = Date.now();
|
||||||
|
if (lastTapTime > 0 && now - lastTapTime < 400) {
|
||||||
|
e.preventDefault();
|
||||||
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
|
||||||
|
}
|
||||||
|
lastTapTime = now;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
document.addEventListener('dblclick', () => {
|
document.addEventListener('dblclick', () => {
|
||||||
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Keyboard shortcuts for testing
|
// Keyboard shortcuts for testing
|
||||||
document.addEventListener('keydown', (e) => {
|
document.addEventListener('keydown', (e) => {
|
||||||
|
|||||||
@@ -5837,9 +5837,21 @@ html[data-view="mobile"] #exfilDeskCanvas { max-height: 500px; }
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Double-click/tap to skip scene (same as Escape on desktop)
|
// Double-click/tap to skip scene (same as Escape on desktop)
|
||||||
|
if (isAndroidApp) {
|
||||||
|
let lastTapTime = 0;
|
||||||
|
document.addEventListener('touchend', (e) => {
|
||||||
|
const now = Date.now();
|
||||||
|
if (lastTapTime > 0 && now - lastTapTime < 400) {
|
||||||
|
e.preventDefault();
|
||||||
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
|
||||||
|
}
|
||||||
|
lastTapTime = now;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
document.addEventListener('dblclick', () => {
|
document.addEventListener('dblclick', () => {
|
||||||
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Keyboard shortcuts for testing
|
// Keyboard shortcuts for testing
|
||||||
document.addEventListener('keydown', (e) => {
|
document.addEventListener('keydown', (e) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user