From b8e3b7802a63b3db9e0aa2e4a21cd0c2771f3e79 Mon Sep 17 00:00:00 2001 From: Sergey Plis Date: Mon, 26 Aug 2024 14:03:39 -0400 Subject: [PATCH] OHBM talk --- OHBM2024.html | 57 +++++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/OHBM2024.html b/OHBM2024.html index f11f1ee0..dab97ee8 100644 --- a/OHBM2024.html +++ b/OHBM2024.html @@ -756,14 +756,23 @@

Questions?

openSlideNumber: true, openButton: false, }, - keyboard: { - 32: 'next', // Space bar - next fragment - 33: 'prev', // Page Up - previous fragment - 34: 'next', // Page Down - next fragment - 37: 'left', // Left arrow - previous slide - 39: 'right', // Right arrow - next slide - }, + keyboard: { + 32: 'next', // Space - next fragment + 33: 'prev', // Page Up - previous fragment + 34: 'next', // Page Down - next fragment + 37: 'left', // Left arrow - previous slide + 39: 'right', // Right arrow - next slide + 70: 'fullscreen', // 'f' key - fullscreen + }, + // Add mouseWheel option to handle clicker events + mouseWheel: true, + + // Customize mouse button behavior + navigationMode: 'default', + + // Override click behavior + previewLinks: false, // Enable the slide number display slideNumber: true, @@ -828,24 +837,24 @@

Questions?

Reveal.prev(); } }); - -window.addEventListener("mousedown", handleClick, false); -window.addEventListener("contextmenu", function(e) { e.preventDefault(); }, false); - -function handleClick(e) { - let zoneSize = 110; - let x = e.clientX; // get mouse X position - let y = e.clientY; // get mouse Y position - let wx = window.innerWidth; // get window width - let hy = window.innerHeight; // get window height - if (x>(wx-zoneSize) && y>(hy-zoneSize)) { - } else { - // only if not in normal controls zone - e.preventDefault(); - if(e.button === 0) Reveal.next(); - if(e.button === 2) Reveal.prev(); +// Custom configuration for mouse buttons +Reveal.configure({ + keyboard: { + // Left mouse click (keyCode 1) - next + 1: 'next', + // Right mouse click (keyCode 3) - previous + 3: function() { + Reveal.prev(); + return false; // Prevent context menu + } } -} +}); + +// Prevent context menu on right-click +document.addEventListener('contextmenu', function(e) { + e.preventDefault(); + }); + Reveal.configure({ fragments: true }); // set false when developing to see everything at once Reveal.configure({ slideNumber: true }); //Reveal.configure({ history: true });