Remap the Surface Pro 3 Purple Button

Remap the Surface Pro 3 Purple Button

One of the cool features the Surface Pro 3 offers is the pen. It let’s you draw and write and even acts as a mouse. But, what would make it really handy is the ability to remap the Surface Pro 3 pen purple button to do something other than open the Metro version of OneNote and paste a screenshot.

If you’ve wanted to do this but didn’t know how, then this article is for you.

We’ll be using a program called AutoHotKey to remap the Surface Pen’s button. This works because, effectively, the buttons on the Pen work as function keys (the mysterious F1-F12 on top of your keyboard) .

AutoHotKey program let’s us remap those keys (in this case F19 and F20) to do whatever we want after the computer starts. So if you decide that you want to start Notepad with a single click instead of OneNote, you can.

Cool, huh?

In the example below, I’m going to setup my SP3 to start Notepad on a single-click of the pen and the snipping tool on a double-click.

Let’s get started…

Remap the Surface Pro 3 Purple Button: Download AutoHotKey

First, let’s get the AutoHotKey program installed. Installation is pretty straightforward so you shouldn’t have any issues.

  • Make sure you’re logged in with Admin rights
  • Attach a mouse or type cover (this is just easier with a mouse as the procedure isn’t really touch friendly)
  • Download AutoHotKey from HERE
  • Save it to your desktop and run it

Remap the Surface Pro 3 Purple Button - AHK Setup

  • Choose Express Setup
  • After it finishes installing, choose Exit

Remap the Surface Pro 3 Purple Button - Finish

Remap the Surface Pro 3 Purple Button: Create a Script

Now, let’s make the magic happen. We’ll do this by creating a very simple script that remaps what the purple button click and double-click does (F20 and F21 respectively).

  • Open File Explorer, go to your documents, Right-click and select “New AutoHotkey Script” and name it whatever you want

Remap the Surface Pro 3 Purple Button - Make Script

  • After it’s created, right-click on this file and edit it in Notepad, then add these four lines to the bottom…

#F20:: run, notepad.exe
return
#F19:: run, SnippingTool.exe
return

Remap the Surface Pro 3 Purple Button - Notepad

  • Save the file, then double-click it to test it.

It should now launch Notepad on a single-click of the purple pen button, and the snipping tool when you double-click the button.

If it’s working how you want, the only thing left is to add it to your startup folder. this will allow these mappings to happen automatically every time you start your Surface.

  • Open Windows Explorer and check the Hidden Items box under the View menu
  • Browse to c:\Programdata\microsoft\windows\start menu\programs\startup and place your script in this location (by the way, if you’ve been wondering where the old all users startup folder went, this is it)
  • You will be prompted for administrator rights to move the file. Choose Continue to proceed

Remap the Surface Pro 3 Purple Button - Admin

That’s it. You’ve successfully remapped the SP3 pen purple button to do something other than take screenshots or open the Metro version of OneNote.

From here on out, the Pen will continue to wake the Surface and start the “note taking” mode of OneNote when it’s sleeping but, if it’s powered up, it will do your custom remapped actions instead.

Remap the Surface Pro 3 Purple Button: Removing or Changing the Remapping

Ok, now that you know how this works, I imagine you would like to set it the way you like it – I don’t suppose everyone wants Notepad and Snipping Tool.

Well, the AutoHotKey program we used to do the remapping is very flexible and can do a lot of things. If you want the buttons to do something else, check out their tutorial page for instructions on how to do just about anything you might want to with it.

So, if you want to change the remapping,  just go back into the startup area, make changes to the script you placed there and restart your Surface.

If you decide to get rid of the remapping all-together, just delete the script from startup and restart your Surface.

I hope you find this little procedure helpful for making your Surface Pro 3 even more awesome than it already was.

As usual, if you have questions or comments, please let me know.

Tim

15 Comments

  • Great tip, works like a charm!

    Wanted to point out a minor correction you may want to make in your post. You mentioned remapping the F20 and F21 function keys. That should be F20 and F19 (not F21).

  • Very nice! But is it possible to lock or unlock the screen with one click on the purple button? I didn’t find any exe files on google which can do that.

  • ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;Map pen click to advance slides in full screen powerpoint
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    #IfWinExist ahk_class screenClass
    #F20::
    Send {Space}
    return

    • Also another snippet I use for onenote with the stylus is:

      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      ;Double click stylus to activate pen palette in OneNote desktop;;;;;;;;;;;;
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      #ifwinactive, OneNote
      ;#ifwinactive ahk_class Framework::CFrame

      #F19::
      sleep 50
      send {alt} ;activate menu hotkeys
      sleep 50 ;wait for menu to activate, you may need to tweak this
      send dp ;select draw=>pens. this can be changed to whatever menu hotkeys you want. 2{alt} will undo your last action, wf will toggle between windowed and full screen.

      ;send {alt}d ;to select Draw tab
      ;send p ;to select pen
      return
      #IfWinActive

      • So the 1st script does what the comment says and when Powerpoint is in fullscreen mode a click on the pen will advance the slide.

        The 2nd snippet will open up the pen selection tool.. handy to select different colours…

        Enjoy

      • I am trying to run this script but it isn’t selecting the pen that I want it to. Is this script meant to be used exactly as it is written here or are there parts that I need to change? Do I need to be holding down a button while pushing in the eraser? I just want to be able to switch back and forth between the pen and the highlighter in Onenote.

  • hello is it possible to set the side buttons of surface pro 4 pen to action ctrl z or undo in some sketch programs

  • Hi, Tim.
    I’m using New Surface Pen and hopping your tip is my last salvation.
    The thing is I want my side button works like eraser, not top button.
    I guess code F20 is deep press of top button. How could you detact that code?
    and is there any way to remap the side button to eraser?

Leave a Comment