Stream Deck + AutoHotkey + PowerPoint = You’re Welcome

I am not a streamer… yet. I work on business plans and PowerPoint presentations all day. Maybe someone would watch me drag clipart around on Twitch?

But, I do own an Elgato Stream Deck. I am always discovering more ways to use it: home automation, muting the right audio source, and loading programs with a touch of a button. A Stream Deck is a grid of physical buttons that have a little display behind them. The buttons can do whatever you want whenever you press them. The displays can show you icons, animations, and statuses.

Elgato Stream Deck Mini

I have spent a fair amount of time learning how to customize my Stream Deck and incorporate it into my daily work.

Vicious Cycle

The one thing that I do every day is give PowerPoint presentations on Microsoft Teams. Frequently during a presentation, I am getting messages in the chat. When I click over into Teams to check on what the chatter is, I lose focus on PowerPoint. Then, I try to advance the slides. PowerPoint doesn’t move. I look stupid. I question my worth. I am spiraling. And then I realize! I click back on PowerPoint and save the day. Slides are now moving forward. Then, someone sends a message, I click on Teams to check out what I am saying wrong and try to advance the slides and nothing.

A Solution

I have found a solution. Admittedly, it’s complicated. If you use Windows, this solution might work for you too. I dedicate two buttons on the Stream Deck to move the slides forward and backward (for those times I have to go back a slide). This works because the Stream Deck can be customized to send a keyboard command to your PC, then AutoHotkey can map the command to a little script. The script brings PowerPoint into focus and sends a keyboard command to PowerPoint. So, no matter where you have clicked during a presentation, your slides move forward and backward and you don’t have to question your self-worth!

AutoHotkey

Install AutoHotkey on your Windows PC. AHK will run in the background waiting for keyboard commands that match the rules that you have created. For help, check out the documentation and the Hello World video on YouTube. I know, it will be daunting, but a community of people for the last decade have been creating videos, examples, and tutorials. You just have to stick with it for a while. You just might be inspired to automate other computing tasks. My goal is to map F13 and F14 (yes there are function keys beyond F12) to Page Up and Page Down. Page Up and Page Down are keyboard shortcuts for PowerPoint. I am using the nowhere to be found F13 and F14 keys so I don’t accidentally press those keys on my keyboard. I want the Stream Deck to have control over the PowerPoint slides.

  1. Right-click on your desktop
  2. Find “New” in the menu
  3. Click “AutoHotkey Script” inside the “New” menu
  4. Name it PowerPoint.ahk
  5. Right-click on PowerPoint.ahk and click “Edit Script”
  6. Enter and save the code below:
F13::
    if WinExist("PowerPoint Slide Show")
    {
        WinActivate ;
        Send {PgDn}
        return
    }

    return 

F14::
    if WinExist("PowerPoint Slide Show")
    {
        WinActivate ;
        Send {PgUp}
        return
    }

    return

Stream Deck

On the Stream Deck app, drag over a “Hotkey” to one of your buttons. In the Hotkey field, click the down arrow, select F-Keys, and F13. Do this for F14 as well. For the icons, I just used icons found on Wikipedia pages.

Selecting the F13 F-Key in Stream Deck
My PowerPoint Config for Stream Deck

Demo Time

I have to say that this really makes giving a PowerPoint easier. I hope you find it useful. Let me know if you try it our modify this project to solve something else.

Update – March 2021

I received a bunch of email after I posted my Stream Deck project to control PowerPoint. Some were happy to see the clues to make their AutoHotkey scripts work properly and others were wondering how to do this without a Stream Deck. Stream Deck controllers are really awesome and have been in high demand over the past year. I have a solution for you. I discovered a $10 PowerPoint presenter device by KNORVAY/NORWII where the buttons are programmable to control PowerPoint with AutoHotkey. Check out the full tutorial here.

Controlling PowerPoint with the KNORVAY N27 Presenter

Update – November 2021

A person on YouTube asked me about using this solution for jumping to a particular slide of a PowerPoint presentation that is running in the background. The keyboard shortcut for jumping to a specific slide number is to type the slide number and then enter. If you have a slide that you want a Stream Deck button to jump to, all you have to do is add another function key in your PowerPoint AutoHotkey script.

F15::
    if WinExist("PowerPoint Slide Show")
    {
        WinActivate ;
        Send {Text} 12 ; This represents slide number 12
        Send {Enter} ;
        return
    }

    return

Update – July 2023 – New AutoHotkey v2 Config File

I got a new laptop and had to reinstall my PowerPoint control setup. I noticed that AutoHotkey has changed their configuration files a lot and have defaulted to AutoHotkey v2 and deprecated v1.

I re-wrote the config file for AutoHotkey v2 and updated the code on the GitHub repo: https://github.com/nothans/autohotkey-config-for-powerpoint

34 comments

  1. Hi Mr Scharler,

    I’m extremely happy that I came across your AutoHotKey explanation for how to combine AutoHotKey, PPT and Streamdeck. Coincidentally I am setting up a streaming rig for my church and need to advance PPT slides while PPT is being used as a source in OBS Studio.

    My task is distilling a somewhat complicated 2 camera, BlackMagic switcher and audio mixer setup into a package that can be operated by a novice (with the help of a small child, perhaps) and advancing the PPT slides from within OBS caused me some lost sleep. I quickly realized that which program had focus would be a hurdle.

    I think the AHK routine should save my day.

    Thanks for pointing the way.
    Tom Ingledew

    1. Hi Tom,

      Thanks for the comment. I am glad this might help you out. Let me know how it goes and godspeed.

      Hans

    2. OBS has hotkeys which work even when obs is non-focussed..

      obs ppt:
      Grab ppt window with window capture/desktop capture/ browser capture.
      Set up 3 scenes in obs:
      1. Full ppt
      2. Full you(camera)
      3. Ppt with you as overlay

      Set up hot keys in obs for all 3 above scenes in point 2
      Go to advanced settings in obs and select never disable hotkeys.
      Now keep just operate your ppt , and control obs scene switching with hotkeys.

  2. Hello there,

    Thanks you very much for your tutorial that got me started to learn Autohotkey Scripting.

    I bumped into an issue with your script that I solved.

    As a French user of Windows 10, all windows names are translated in French.

    Your script is based on the PowerPoint window name in English: “PowerPoint Slide Show”

    The French translation is “Diaporama PowerPoint”.
    I replaced it in your script and it works fine.

    Then I thought, what about other languages… What about having your script to react to a process existence instead of a window name?

    As a process name is remaining the same accross all language versions of windows it should be valid.

    Here is the new script, tested with French and English versions of Windows 10:

    #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
    ; #Warn ; Enable warnings to assist with detecting common errors.
    SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
    SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
    F13::
    Process, Exist, POWERPNT.EXE
    {
    WinActivate ;
    Send {PgUp}
    return
    }

    return

    F14::
    Process, Exist, POWERPNT.EXE
    {
    WinActivate ;
    Send {PgDn}
    return
    }

    return

    Hope it will help other users who are using windows with another language than English.

    Regards

    Cyril

  3. Thank you for this comment and I appreciate your addition to the project. This will help others out as well. Cheers.

  4. Hello,

    thanks for the tutorial.
    Do you, or someone else, know, what “PowerPont Slide Show” must be named with a german client ?

    Greetings

    1. In earlier comment from Cyril, they mention some alternative code for other languages. My code is looking for a window named, “PowerPoint Slide Show”. I found that window title by pressing Alt+Tab and finding my presentation window. What ever shows up for your presentation is what you would you would use. I hope that helps. Thanks for the comment!

      1. I tried that before asking, but it looks like i missspeeled it multiple time without noticing. now it is working perfectly, thank you for your answer!
        It is “PowerPoint-Bildschirmpräsentation” in german

  5. Hi Hans,
    Thank you for sharing this tip with us. Unfortunately, it doesn’t seem to work for me when an other program is in focus. Any ide how to fix this issue ?

    Many thanks !

    1. Can you try something like this? Let me know if this helps.

      If WinExist(“PowerPoint Slide Show”)
      {
      WinActivate ;
      Send {PgDn}
      return
      }
      Else
      {
      ControlSend,mdiClass1,+{F5},ahk_exe POWERPNT.EXE
      return
      }

      1. Hi Hans,
        Thank you for taking the time to respond.
        Actually your first script works perfectly fine, I just needed to run the script once I edited it in French with “Diaporama PowerPoint”.

        Man this is such a treat to have that option, thanks a lot !!!

  6. Hello, Thank you for sharing this solution!! Exactly what I was looking for. Do you have a script to just bring Power Point to the front? Would removing the Send {PgDn} do the trick?

  7. Hi Hans thank you for this helpful tip. Just wondering if it’s possible to have the script run automatically on machine startup? Currently to make it work i have to right click the AHK logo and click on run script.
    Thanks again

    1. Hi Craig. Glad that you found this useful. You can definitely get this script to run on start up!

      – Find the script file, select it, and press Ctrl+C.

      – Press Win+R to open the Run dialog, then enter shell:startup and click OK or Enter. This will open the Startup folder for the current user. To instead open the folder for all users, enter shell:common startup (however, in that case you must be an administrator to proceed).

      -Right click inside the window, and click “Paste Shortcut”. The shortcut to the script should now be in the Startup folder.

      1. Hi Hans
        Just wondering if you can help again or put me in the right direction. The solution you provided works perfectly with Powerpoint, but a church i do work for has decided that using google slides and/or Canva is their preferred way to build presentations. This again causes issues with needing the slideshow to be the active window. Is there a way that you know of to enable web based slideshows to be controlled when no the active window?
        Many thanks

      2. Hi Hans
        Sorry if I am repeating myself but I previously replied to my own message so you may not have seen it. Just wondering if you have an idea of how or if this solution can be applied to be used with Google Slides or Canva? I have a church that I help out with that prefers to use these platforms for presentations rather than Powerpoint.
        Many thanks

        1. Hi Craig,

          I don’t use Google Slides personally, but I had a look at your question as it might be something that some of my clients may ask for.

          If I were you I would use the modified script I gave 8n an earlier reply and install the plugin mention on this page.
          https://artofpresentations.com/do-presentation-clickers-work-with-google-slides/
          Then I would try to replace the PowerPoint process in the script by the Google Chrome process, and make sure the shortcuts are the right ones.

          I don’t have much time at the moment to experiment on this.
          If I find the time in the coming months, I will let you know.

          Cyril

          1. Thank you Cyril for your input. I would try your suggestion about replacing the PowerPoint Process with the Google Chrome Process but I would not have a clue what the correct wording for the process would be. I will keep looking online to try and find out.
            Cheers

    1. I did try and was not able to get this to work reliably. Looks like Slides operates within the browser and it doesn’t seem possible to isolate the slide presentation. I will keep cracking. If you come up with something, please let me know.

      1. This code will activate chrome and then go to next slide. I recommend the AHK forums if you ever need help the people there are wizards when it comes to this stuff 😆

        F9:: ;set elgato button as hotkey F9 in streamdeck software or change to any key you want
        {
        WinActivate ahk_exe chrome.exe ;activates google chrome window
        sleep 20
        Send {Down} ; sends shortcut for next slide which is down arrow
        return
        }

        1. Thanks for sharing! I will give this code a try. I have tried something similar and remember an issue with multiple tabs and multiple instances of Chrome.exe running.

  8. Hi! This is great. If I want to add more shortcuts beyond F24, do you have any suggestions for how to change the script?

  9. Hi Hans, Thanks for the explanations above. I am using a Stream Deck to navigate in PowerPoint. I have a very specific quest: as I have PPT’s with hundreds of pages, I would like to jump directly into a particular page/section. I have it working with simply jumping to a particular page number (so action: + ). However, if I insert in the PowerPoint new pages, then I have to update all the numbers of the pages after the insertion. Tedious work. Is there an option to jump to -let’s say- a tag, like a section name or finding a tag on a page?

    1. Great question. I spent some time researching how to jump to sections. It looks like PowerPoint does not support that. I will keep digging though. If you figure anything out, please share! Thanks.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.