Skip to Content

Tag: Autohotkey

  • A Modular Hotkey System (AutoHotKey)

    For my StrangeLoop workshop I had to do a lot of powerpoint work. To streamline this, I made over 20 AutoHotKey shortcuts to run various ribbon commands. To avoid polluting my keyboard I built them all into a general-purpose system. All shortcuts started by clicking the thumb mouse button and then quickly pressing 1-2 keys in sequence.

    #IfWinActive ahk_exe POWERPNT.EXE
    pp_func()
    {
        pp_cmd := Map("a2", {cmd: "{alt}adu.2", info: "Set animation time to .2 seconds"}
    
        , "fh", {cmd: "{alt}hgoh", info: "Flip horizontal"} ; etc etc
        )
    
    
    pp_input := "?"
    pp_info := ""
    for pkey, pval in pp_cmd {
        pp_input .=  "," . pkey
        pp_info .= Format("{1:-20}{2:-1}`n",pkey,pval.info)
    }
    
    ih := InputHook("L2 C T1",, pp_input)
    ih.Start()
    if (ih.Wait() == "Match") {
        if (ih.Match == "?") {
            MsgBox(pp_info)
        }
        else {
                Send(pp_cmd[ih.Match].cmd)
            }
        }
    }
    
    ; Mouse thumb button, you can change this to something else
    XButton1::pp_func()
    #IfWinActive
    

    Pressing ? will show all of the commands along with descriptions.

    How it Works