diff --git a/collects/scribblings/slideshow/guide.scrbl b/collects/scribblings/slideshow/guide.scrbl index f4d5ed3f66..bcdfc6a75e 100644 --- a/collects/scribblings/slideshow/guide.scrbl +++ b/collects/scribblings/slideshow/guide.scrbl @@ -63,6 +63,8 @@ Alt-q (or Meta-q) to end the slides. Here are more controls: (list "Left arrow, Backspace, Delete, or b" "previous slide") (list "g" "last slide") (list "1" "first slide") + (list "s" "next slide with a different title/name") + (list "a" "previous slide starting different title/name") (list "Alt-g, Cmd-g, or Meta-g" "select a slide") (list "Alt-p, Cmd-p, or Meta-p" "show/hide slide number") (list "Alt-c, Cmd-c, or Meta-c" "show/hide commentary") diff --git a/collects/slideshow/initial-ones.rkt b/collects/slideshow/initial-ones.rkt index 64d585b963..6f8657f4c7 100644 --- a/collects/slideshow/initial-ones.rkt +++ b/collects/slideshow/initial-ones.rkt @@ -57,8 +57,8 @@ (("Esc") "if confirmed, end show") ((,sym:rightarrow ", Space," ,(tt "f") "," ,(tt "n") ", or click") "next slide") ((,sym:leftarrow ", Backspace, Delete, or" ,(tt "b")) "previous slide") - ((,(tt "g")) "last slide") - ((,(tt "1")) "first slide") + ((,(tt "1") "/" ,(tt "g")) "first/last slide") + ((,(tt "a") "/" ,(tt "s")) "previous/next slide name") ((,(meta "g")) "select a slide") ((,(meta "p")) "show/hide slide number") ((,(meta "c")) "show/hide commentary") diff --git a/collects/slideshow/viewer.rkt b/collects/slideshow/viewer.rkt index e78546df86..4944896d5b 100644 --- a/collects/slideshow/viewer.rkt +++ b/collects/slideshow/viewer.rkt @@ -229,6 +229,10 @@ [(#\b #\backspace #\rubout prior) (prev) #t] + [(#\s) + (next-title add1 #f)] + [(#\a) + (next-title sub1 #t)] [(#\g) (stop-transition) (send f set-blank-cursor #f) @@ -355,6 +359,27 @@ (stop-transition) (change-slide 1))) + (define/public (next-title d1 far-end?) + ;; skip to next slide that has a different title + (stop-transition) + (define current-title (sliderec-title (talk-list-ref current-page))) + (change-slide + (- (let loop ([pos (d1 current-page)]) + (cond + [(negative? pos) 0] + [(= pos slide-count) (sub1 slide-count)] + [(equal? current-title (sliderec-title (talk-list-ref pos))) (loop (d1 pos))] + [far-end? + (define new-title (sliderec-title (talk-list-ref pos))) + (let loop ([prev-pos pos] [pos (d1 pos)]) + (cond + [(negative? pos) 0] + [(= pos slide-count) (sub1 slide-count)] + [(equal? new-title (sliderec-title (talk-list-ref pos))) (loop pos (d1 pos))] + [else prev-pos]))] + [else pos])) + current-page))) + (define/public (slide-changed pos) (when (or (= pos current-page) (and (or config:use-prefetch?