This is for anyone looking for a way around this, that includes modifiers useage (useful for pretty much any and all drawing app). It's not perfect, but I hope this can help you and everyone else looking to restore the right click function. This works on the current Book 3 models and alt pens.
SendMode Input
SetWorkingDir %A_ScriptDir%
global PEN_NOT_HOVERING := 0x0 ; Pen away from screen.
global sPen_Thread := 0
;global sPen_Timer := 0 ;OFF Timer to figure out right button hold
global sPen_RBtn := 0 ; Store right button click
; Send Alt, Ctrl and Shift keys along with the right-click if necessary
SendModifierKeys() {
static lastAlt := 0
static lastCtrl := 0
static lastShift := 0
AltState := GetKeyState("Alt")
CtrlState := GetKeyState("Ctrl")
ShiftState := GetKeyState("Shift")
if (AltState <> lastAlt) {
if (AltState) {
Send {Alt Down}
} else {
Send {Alt Up}
}
lastAlt := AltState
}
if (CtrlState <> lastCtrl) {
if (CtrlState) {
Send {Ctrl Down}
} else {
Send {Ctrl Up}
}
lastCtrl := CtrlState
}
if (ShiftState <> lastShift) {
if (ShiftState) {
Send {Shift Down}
} else {
Send {Shift Up}
}
lastShift := ShiftState
}
}
TimerThreadEnd() {
SetTimer, TimerThreadEnd, Off
sPen_Thread := 0
if (sPen_RBtn <> 0){ ; Right button pressed
SendModifierKeys() ;send modifier if pressed
Send {RButton Up} ;button released
}
}
TimerThreadOn(){
sPen_Thread := 1 ;active
SetTimer, TimerThreadEnd, 30 ; 30 milliseconds
}
#include AHKHID.ahk
WM_INPUT := 0xFF
USAGE_PAGE := 13
USAGE := 2
AHKHID_UseConstants()
AHKHID_AddRegister(1)
AHKHID_AddRegister(USAGE_PAGE, USAGE, A_ScriptHwnd, RIDEV_INPUTSINK)
AHKHID_Register()
OnMessage(WM_INPUT, "Work")
Work(wParam, lParam) {
Local type, inputInfo, inputData, raw, proc
static lastInput := PEN_NOT_HOVERING
static penIn := 0
Critical
type := AHKHID_GetInputInfo(lParam, II_DEVTYPE)
if (type = RIM_TYPEHID) {
inputData := AHKHID_GetInputData(lParam, uData)
;TimerThreadOn() ;off this triggers unwanted right clicks using eraser
raw := NumGet(uData, 0, "UInt")
proc := (raw >> 0) & 0xFFFF
if (proc <> lastInput) {
if (proc == 10242) { ;need to figure out what this number does
;sPen_RBtn := 1 ;OFF
;SendModifierKeys() ;OFF
;Send {RButton Down} ;OFF
if (lastInput = 8194) {
SendModifierKeys()
Click right
;Send {RButton Up}
}
;sPen_RBtn := 0
}
lastInput := proc
}
}
}