Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Building Impressive Presentations with impress.js

You're reading from  Building Impressive Presentations with impress.js

Product type Book
Published in Mar 2013
Publisher Packt
ISBN-13 9781849696487
Pages 124 pages
Edition 1st Edition
Languages
Concepts

Table of Contents (14) Chapters

Building Impressive Presentations with impress.js
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with Impressive Presentations 2. Exploring Impress Visualization Effects 3. Diving into the Core of impress.js 4. Presenting on Different Viewports 5. Creating Personal Websites 6. Troubleshooting Impress Tools and Resources Index

Assigning custom keys for custom events


We might not be familiar with the default keys used for impress presentations. In such cases, we can assign our own keys for existing functions and new keys for new functions. Let's see how we can modify the code to add new keys to existing functionalities. Let's add the letter p for previous and n for next.

document.addEventListener("keyup", function ( event ) {
    if ( event.keyCode === 9 || ( event.keyCode >= 32 && event.keyCode <= 34 ) || (event.keyCode >= 37 && event.keyCode <= 40) || event.keyCode === 78 || event.keyCode === 80  ) {
        switch( event.keyCode ) {
            case 80: // letter p
            
            // key codes for default previous keys 
                     api.prev();
                     break;
            case 78:  // letter n
            
           // key codes for default next keys
                     api.next();
                     break;
        }

Each key in the keyboard has a specific...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}