-
-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add keyboard shortcuts (LeftArrow and RightArrow) to move slides in presentation mode #2611
Conversation
Left Arrow goes back Right Arrow goes forward
Try this Pull Request!Open Julia and type: julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/disberd/Pluto.jl", rev="presentation_keyboard_shortcuts")
julia> using Pluto |
Maybe is better to add a keyboard shortcut for presentation mode and avoid the automatic full screen detection? So the user that wants to present can explicitly do so (without having to open the developer console) using a shortcut and also manually trigger fullscreen. Any thoughts on this @fonsp? |
I would agree to avoid fullscreen detection. Let's try using the official API or avoid it altogether. Also since we're adding shortcuts, may I also suggest:
|
Thanks for the feedback @pankgeorg. I will implement the additional shortcuts and remove the full screen detection. Unfortunately the fullscreen API was my first attempt but it only works reliably when full-screen is triggered programmatically (on windows F11 seems to be handled by OS so it does not trigger the event from the fullScreen API). Regaring a short-cut to manually enter presentation mode, you got any suggestion on what key combination to use? |
Looks good @disberd ! What's left to finish this PR? |
@fonsp what is your view on the activation method? In case we ditch full screen detection do you have suggestions on which key combination to use for triggering presentation mode? |
Let's merge the keyboard shortcuts and discuss the activation in a Discussion? I also think detection based on viewport height or the Fullscreen API are not working great, even though that would be very nice to use. |
@fonsp OK, I'll clean up the code in the next days to remove the automatic full-screen detection |
@fonsp this should be ready to go (removed the full screen detection and added shortcuts suggested by @pankgeorg) |
woohooo look forward to the next react PR @disberd! |
the fullscreen detection was well implemented btw (with usestate and useeffect etc), just tricky with all the platforms behaving differently |
Thanks to @fonsp for showing me the React way
When in presentation mode, using the Left and Right arrow will allow to move slides back and forward.
This functionality is not triggered when the active element is a cell input or any other element within the notebook that you might want to interact with using arrows.
Also added some experimental functionality to detect full screen and prompt for activating (or deactivating) presentation mode:
a33b92f1-63ba-461f-b1c2-ddb6b87484ae.mp4
There are some caveats to the current automatic detection of full screen:
screen.height
as a function of the zoom and there does not seem to be a nice way to make it work reliablysource_element = null
in theopen_popup
function. @fonsp is there a better way/source_element to handle this?