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

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

25 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

Leave a Reply to guru gauranga das Cancel reply

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