Any news on customizable pen buttons?

Discussion in 'Microsoft Surface Pro 3' started by vxm, May 5, 2015.

  1. vxm

    vxm Active Member

    Joined:
    Jan 31, 2015
    Messages:
    136
    Likes Received:
    63
    Trophy Points:
    28
    Location:
    Warsaw, PL
    My Device:
    SPro3
    Anyone has info/rumors to share when to expect any official resolution to that nuisance?

    It's silly that 2 buttons are only useful in OneNote, third being made exclusively for it. I'm ok with this functionality, but let's be honest- OneNote is not my tool of trade or the most frequently used app. It's sad I can't configure those buttons for other software- sometimes one button works as eraser, but more often than not it only makes something silly happen and that's about it. For me it's the biggest issue with SP3, I accept heat, fan getting noisy, aggressive throttling or that palm rejection isn't perfect, but pen that has 2/3rd of it's buttons completely useless? Meh.

    I know that there are solutions like radial menu to that, but honestly, I think you shouldn't depend on 3rd party solutions with device like this (pen itself isn't cheap, even comparing to Wacom styli + device itself is considered premium).

    I searched, but other than MS buying N-Trig I haven't found anything related- buying n-trig might mean that developement of new features will get faster or it might actually slow it due to changes in company.
     
  2. sharpuser

    sharpuser Super Moderator Staff Member

    Joined:
    Aug 20, 2013
    Messages:
    2,851
    Likes Received:
    1,030
    Trophy Points:
    113
    Location:
    Pacific Northwest & China
    My Device:
    Surface Book
    [crickets]
     
  3. Larry Berk

    Larry Berk New Member

    Joined:
    Jan 26, 2015
    Messages:
    3
    Likes Received:
    1
    Trophy Points:
    1
    Sure wish I could use it with Evernote.
     
  4. JoshB

    JoshB Member

    Joined:
    Sep 2, 2014
    Messages:
    79
    Likes Received:
    22
    Trophy Points:
    8
    My Device:
    SPro3
  5. kozak79

    kozak79 Active Member

    Joined:
    Nov 15, 2013
    Messages:
    296
    Likes Received:
    60
    Trophy Points:
    28
    JoshB likes this.
  6. agt499

    agt499 Member

    Joined:
    Jul 17, 2014
    Messages:
    151
    Likes Received:
    21
    Trophy Points:
    18
    Yes, Autohotkey is a very reliable way to do this for the top/purple button.
    I have mine mapped to the commands Send {Browser_Forward} and Send {Browser_Back}, which will run a powerpoint presentation forward with single-click and back with a double. It also works in a browser, which I've used for a (carefully pre-planned) client demo.
    AHK is also powerful enough to make the button do different things in different programs.
    (I'm a lefty with appalling handwriting and sketching, so this turns out to be a better use of my pen)
     
  7. vxm

    vxm Active Member

    Joined:
    Jan 31, 2015
    Messages:
    136
    Likes Received:
    63
    Trophy Points:
    28
    Location:
    Warsaw, PL
    My Device:
    SPro3
    I know radial menu, I've been using it both on TPY and SP3. It doesn't change the fact that this is third party solution.
     
  8. herrkjeldsen

    herrkjeldsen New Member

    Joined:
    Feb 18, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I'd love to hear some new on this also :) I've also used radial menu to replace the side buttons, but while it is a fantastic effort, I have frequent release lags after a side button click. And as vxm points out, it is silly that it should be a third party solution.
     
  9. Randy31416

    Randy31416 New Member

    Joined:
    Oct 16, 2014
    Messages:
    17
    Likes Received:
    6
    Trophy Points:
    3
    See the link http://ahkscript.org/boards/viewtopic.php?f=6&t=7589 for an AutoHotkey script that allows the state of the two barrel buttons to be detected when the pen is tapped against the Surface. This allows the barrel buttons be programmed to suit, within limits. (Windows still, somewhere, traps a long press with the bottom button pressed and turns it into a right click.) Likely, though, only experienced AutoHotkey programmers should work with this script.
     
    herrkjeldsen likes this.
  10. herrkjeldsen

    herrkjeldsen New Member

    Joined:
    Feb 18, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi Randy! Thanks for the link :) Very tidy and helpful script sample!
    I think you are right about the experienced programmers bit though. After having spent a few hours on trying to set it up correctly, I'm still unable to make it release the middle mouse button properly.

    I got as far as this, but of course, I am a complete autohotkey newbie:
    Code:
        #SingleInstance Force
        #UseHook
        SurfacePenBegin()
        Return
    
    
    ; trap pen taps with the bottom button pressed
      #If SurfacePenState = "tap down with bottom side button pressed (seen in AutoHotkey as LButton event)"
        ^!+LButton::
        ^!LButton::
        ^+LButton::
        !+LButton::
        ^LButton::
        !LButton::
        +LButton::
        LButton::
          SendLevel, 5
          Click, Middle
          SendLevel, 0
          Return
        #If
      #If (SurfacePenState = "tap up with bottom side button pressed (seen in AutoHotkey as LButton up event)")
        ^!+LButton::
        ^!LButton::
        ^+LButton::
        !+LButton::
        ^LButton::
        !LButton::
        +LButton::
        LButton::
          SendLevel, 5
          Click, Up Middle
          SendLevel, 0
          Return
        #If
    
    ; initialize to trap input messages
      SurfacePenBegin( )
      {
        Global SurfacePenState
        SurfacePenState := ""
        AHKHID_Register(1, 2, A_ScriptHwnd, RIDEV_INPUTSINK := 0x00000100)
        OnMessage(WM_INPUT := 0xFF, "SurfacePenEvent")
      }
    
    ; trap wm_input messages and analyze them
      SurfacePenEvent( wParam, lParam, msg, hwnd )
      {
        Global SurfacePenState
        Critical
        AnyType := AHKHID_GetInputInfo(lParam, II_DEVTYPE := 0)
        AnyFlag := AHKHID_GetInputInfo(lParam, II_MSE_FLAGS := (08 + A_PtrSize * 2) | 0x0100)
        AnyButt := AHKHID_GetInputInfo(lParam, II_MSE_BUTTONFLAGS := ((12 + A_PtrSize * 2) | 0x0100))
        AnyData := AHKHID_GetInputInfo(lParam, II_MSE_EXTRAINFO := 28 + A_PtrSize * 2)
        SurfacePenState := ""
        If (AnyType = 0 And AnyFlag <> 0 And AnyButt <> 0)
        {
          If (AnyButt = 1 And (AnyData & 3) = 3)
            SurfacePenState := "tap down with bottom side button pressed (seen in AutoHotkey as LButton event)"
          If (AnyButt = 2 And (AnyData & 3) = 3)
            SurfacePenState := "tap up with bottom side button pressed (seen in AutoHotkey as LButton up event)"
          OutputDebug, SurfacePenEvent [%SurfacePenState%]
        }
      }
    
    
    #Include AHKHID.ahk
    
    All I really need is a functioning middle mouse button on my pen, so I wish Microsoft would just implement this as part of the surface settings app.
     
  11. Randy31416

    Randy31416 New Member

    Joined:
    Oct 16, 2014
    Messages:
    17
    Likes Received:
    6
    Trophy Points:
    3
    In my use of the script sample, all of the hotkey definitions are placed early in the script (above any middle-button hotkeys) and all of hte middle-button actions I am actually doing also are triggered by hotkeys within this script. I don't know if in general this will drive other programs that use middle-button presses (I can't think of a program I have that natively uses the middle button so I can't check this out here).

    I too crave native Microsoft support, and eagerly download firmware fixes that talk about the pen, but no support shows up . . . .
     
    herrkjeldsen likes this.
  12. derpmcturd

    derpmcturd New Member

    Joined:
    Feb 4, 2016
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    My Device:
    Surface Book
    OMG I want to do EXACTLY that but i have no idea how to use AHK. I've downloaded it and all the technical mumbojumbo scrambles my brain. Can you tell me how you did it? Changing the Pen's lower button to "Go Back" and the top to "Go Forward" would be absolutely PERFECT! Please help. Thank You
     

Share This Page

Search tags for this page
ahk onmessage win10 tablet mode
,
microsoft surface pen with two side buttons
,
remap surface pen
,
remap surface pro 3 pen buttons windows 10
,
surface pen 2 button remapping
,
surface pen side buttons ahk
,
surface pen with photoshop
,

surface pro 4 pen buttons

,
surface pro 4 pen customize
,
what does side button on surface pen do