Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Add left/right keyboard shortcuts to onboarding slides
Browse files Browse the repository at this point in the history
  • Loading branch information
cecilebertin committed May 1, 2017
1 parent db8e708 commit 709d5b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions addon/webextension/onboarding/slides.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ this.slides = (function() {
shooter.sendEvent("cancel-slides", "keyboard-escape");
callbacks.onEnd();
}
if ((event.key || event.code) === "ArrowRight") {
shooter.sendEvent("navigate-slide", "keyboard-arrowright");
next();
}
if ((event.key || event.code) === "ArrowLeft") {
shooter.sendEvent("navigate-slide", "keyboard-arrowleft");
prev();
}
}));

function setSlide(index) {
Expand Down
2 changes: 2 additions & 0 deletions docs/METRICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ The onboarding slides have some events:

1. Click on the next-slide button: `addon/navigate-slide/next`
1. Click on the prev-slide button: `addon/navigate-slide/prev`
1. Navigate to the next slide by hitting ArrowRight: `addon/navigate-slide/keyboard-arrowright`
1. Navigate to the previous slide by hitting ArrowLeft: `addon/navigate-slide/keyboard-arrowleft`
1. Click on one of the dots to navigate to a specific slide: `addon/navigate-slide/goto`
1. Cancel the slides by clicking on the background: `addon/cancel-slides/overlay`
1. Cancel the slides by clicking on skip: `addon/cancel-slides/skip`
Expand Down

0 comments on commit 709d5b1

Please sign in to comment.