This is how I would like the Surface Pen to behave
*Single Right Click* = Right Click
*Double Right Click* = Alt Toggle
*Hold Right Click* = "Send ("")" … (I have another software that controls hold right click)
*Double Right Click AND HOLD* = Toggle Handwriting Recognition typing (Not Microsoft's input panel/box, but a full screen transparent overlay that allows a user to write anywhere on the screen and send text out) I was hoping someone knew how to design this with AHK GUI using InkEdit.
*Single Middle Click* = Ctrl Toggle
*Double Middle Click* = Shift Toggle
*Hold Middle Click* = Middle Click (Hold until release)
*Double Middle Click AND HOLD* = Middle Mouse Click + Ctrl (Hold until release)
I also want to add "Double Middle Click AND HOLD" function if possible, but I don't know how to do that...
*Single Right and Middle Click* = Snippet Tool/Screenshot
*Double Click* = ???
*Hold* = ???
*Double Click AND HOLD* = ??? (whatever is useful)
THE PROBLEM with the code I do have, and a Recap:
1. The Middle Mouse Single Click Ctrl Toggle appears to be interrupting the Hold Middle Mouse function. When I hold Middle Mouse, the Ctrl toggle activates but I only want Ctrl toggle to activate when I tap, not hold, the middle click/eraser button.
2. I prefer to use AHK to remap the pen's buttons, not a different software, but if that's not possible, that's ok.
3. Looking for a simple transparent AHK GUI that will be toggled on with double "Right Click AND HOLD" for full screen Handwriting Recognition (possibly through Inkedit???).
Sorry if I'm asking a lot (sorry...), but I've search for all of this for around a week + 1/2 to 2 weeks before making this post and I simply cannot do it at my newbie skill level.
Here is the code below
Code: Select all
#MaxThreadsPerHotkey 4
*RButton::
If !TRButton
SetTimer, TRButton,
TRButton++
Return
TRButton:
If GetKeyState(rbutton,"P") ;Press and hold
Send, ("") ;This is intentional. I have another software that uses Right Click Hold. However, I don't know if it would work if I did assign a function because of the problem with the MButton Below...
Else if TRButton = 2 ;Double Tap...Works...
send % "{Alt " ((a:=!a) ? "up" : "down") "}"
Else If TRButton = 1 ;Single Tap...Works...
MouseClick, right
else
KeyWait, RButton
TRButton =
Return
*MButton::
If !TMButton
SetTimer, TMButton, -300
TMButton++
Return
TMButton:
If GetKeyState("Mbutton","p") and TMButton != ;Press and hold...Does not work...
Send MButton
Else if TMButton = 2 ;Double Tap...Works...
send % "{Shift " ((s:=!s) ? "up" : "down") "}"
Else If TMButton = 1 ;Single Tap
send % "{Ctrl " ((c:=!c) ? "up" : "down") "}" ;It works, but it also activates when I hold the MButton, which is not what I want it to do
KeyWait, MButton
TMButton =
Return
;This is my failed attempt to map the eraser button on the surface pen without the need of another software to change the buttons 1st before AHK can affect the pen
<#F20::send % "{Ctrl " ((t:=!t) ? "up" : "down") "}"
return
<#F19::send % "{Shift " ((t:=!t) ? "up" : "down") "}"
return
<#F18::MButton
return
[Mod edit: Moved to 'Ask For Help']