Skip to content

Instantly share code, notes, and snippets.

@seandenigris
Last active June 24, 2021 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seandenigris/57538b4d608336cd5f3830002eb39e3c to your computer and use it in GitHub Desktop.
Save seandenigris/57538b4d608336cd5f3830002eb39e3c to your computer and use it in GitHub Desktop.
GToolkit: Slideshow Shortcuts
shortcutBuilder := [ :world :key :action |
BlShortcutWithAction new
repeatable: false;
combination: (BlSingleKeyCombination new key: key);
action: [
| showElements |
showElements := world root allChildrenBreadthFirstSelect: [ :c | c isKindOf: GtSlideShowElement ].
showElements do: action ] ].
GtWorld allInstances do: [ :w |
w root addShortcut: (shortcutBuilder value: w value: BlKeyboardKey pageDown value: [ :e | e slideShow nextStep ]).
w root addShortcut: (shortcutBuilder value: w value: BlKeyboardKey pageUp value: [ :e | e slideShow previousStep ]) ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment