-
Notifications
You must be signed in to change notification settings - Fork 690
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
[Feature] Add keyboard shortcuts for next _slide_ / previous _slide_ #1310
Labels
Feature Request
Request for or introduction of new functionality
Comments
mathieucaroff
added
the
Feature Request
Request for or introduction of new functionality
label
Dec 22, 2023
Agree, see slidevjs/slidev#126 for why. |
The workaround I used: diff --git a/src/App.tsx b/src/App.tsx
index 6c61dcf..781508c 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,3 +1,4 @@
+import * as React from 'react';
import { styled, css } from '@pigment-css/react';
import { Template } from './Template';
import { Backdrop } from './Backdrop';
@@ -14,7 +15,10 @@ import {
Notes,
UnorderedList,
ListItem,
+ DeckContext,
+ useMousetrap,
} from 'spectacle';
import { rawTheme } from '../rawTheme';
// Slides
@@ -77,9 +81,24 @@ const transition = {
},
};
+function KeyboardShortcut() {
+ const deckContext = React.useContext(DeckContext);
+
+ useMousetrap(
+ {
+ pageup: deckContext.stepBackward,
+ pagedown: deckContext.stepForward,
+ },
+ [],
+ );
+
+ return null;
+}
+
export default function Presentation() {
return (
<Deck theme={spectacleTheme} transition={transition} template={<Template />}>
+ <KeyboardShortcut />
<Slide>
<Slide1 />
<Notes>
@@ -604,7 +623,7 @@ https://github.com/styled-components/styled-components/issues/4025
8m45s
</Notes>
</Slide> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current shortcuts (left) and (right) only switch to the next or previous Step, which can be e.g. a text fading in.
Description
When there are a lot of steps in slides, navigating the deck can be quite slow.
Proposal
Add a pair of keyboard shortcuts for switching to the next or previous slide. I would suggest to pick one among:
Links / References
Further ideas
The text was updated successfully, but these errors were encountered: