autohotkeyonenote

Up/Down Key not working in Onenote 2016 for Autohotkey


I mapped alt+i/k to Up/down key using Autohotkey, with the following code:

!i:: Send {up}
!k:: Send {down}

These remappings work with every application except Onenote 2016. I checked it online and found some discussions in the following links:

https://autohotkey.com/board/topic/15307-up-and-down-hotkeys-not-working-for-onenote-2007/

https://autohotkey.com/board/topic/41454-remap-key-doesnt-work-in-ms-onenote/

They suggest to use sendplay or sendraw, but these didn't work for me. Can anyone help me with this?


Solution

  • It works if you use SendPlay and run AHK script with UI Access

    This is your script with Send changed to SendPlay:

    !i::SendPlay {up}
    !k::SendPlay {down}
    

    It emulates and as you expect. Tested with OneNote 2016 on Windows 10.

    How to enable SendPlay: (which initially does nothing in Windows 10)

    1. Save the above mappings into AHK file. I used file updown.ahk with only these two lines.

    2. Right-click the above AHK file and from its context menu, select Run with UI Access (this actually does the trick)

    Troubleshooting: