Last active
June 24, 2021 01:32
-
-
Save seandenigris/57538b4d608336cd5f3830002eb39e3c to your computer and use it in GitHub Desktop.
GToolkit: Slideshow Shortcuts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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