-
Notifications
You must be signed in to change notification settings - Fork 176
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 secondaryKey option for 2d navigation #291
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I’m thinking this could be generalized by turning the key
option into an array, instead of introducing an ad-hoc ˋsecondary-key` option.
In your use case, that would lead to using something like:
$ decktape generic —key=ArrowDown —key=ArrowRight
@@ -79,6 +85,11 @@ class Generic { | |||
// TODO: detect cycle to avoid infinite navigation for frameworks | |||
// that support loopable presentations like impress.js and flowtime.js | |||
await pause(1000); | |||
|
|||
if (!this.isNextSlideDetected && (typeof this.secondaryKey !== 'undefined')) { | |||
await this.page.keyboard.press(this.secondaryKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intuitively, I’d expect the « secondary » key, e.g., the down arrow key, to be used first, and if no changes are detected, then fall through using the « primary » key, i.e., the right arrow key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, we can reverse the order.
I think this is not that easy; I tried to do this but nomnom's |
This seems sort of complicated, and still doesn't fix the bug. Maybe it makes sense to allow the Hackmd plugin on its own. |
@marwahaha I've created #292, that allows to run:
Which produces the following PDF document: test.pdf |
I think this almost works, but has the same bug I mention (first slide is repeated twice). |
superseded by #292 |
fixes #290
For example, my use case is
There is a bug however; the first slide seems to print twice. Why is this?
This happens:
key
does not advance the slides.It does not happen
key
advances the slides.My guess is that it happens when the first
key
is pressed, and nothing has changed, but perhaps the page is still loading, soisNextSlideDetected
is set totrue
. Just a hypothesis though. (For example, on my slide deck, the first slide advances with thesecondaryKey
, i.e. thekey
doesn't advance the slide.)