Skip to content

Commit 3937aca

Browse files
Add files via upload
1 parent c57e06a commit 3937aca

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

plus.ahk

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
; Caution This will block above multi-word selection, Right click to stop
4444
; TO DO perhaps improve above to only work whilst mouse held down
4545
; however, that might be tricky for tablet usage.
46+
; + Reassign Right Click to Alt for commands on tablets without two tap exit
4647
; - (Work in Progress not included) Modify toolbar icon actions per forum
4748
; - (Work in Progress not included) Add extra toolbar icons
4849
; - (Work in Progress not included) OCR with TTS
@@ -80,6 +81,7 @@ IniRead, RunArg4, plus.ini, RunAppS, RunArg4 , https://duckduckgo.com/?q=
8081
IniRead, ModWinS, plus.ini, ToggleS, ModWinS , false ; failsafe for a bad entry is false
8182
IniRead, ModSlct, plus.ini, ToggleS, ModSlct , false ; failsafe is Double Click one word
8283
IniRead, ModLeft, plus.ini, ToggleS, ModLeft , false ; failsafe for swap Left to Right
84+
IniRead, AltExit, plus.ini, ToggleS, AltExit , false ; failsafe for swap Right to Alt
8385

8486
; Try to confine actions to SumatraPDF note this does not always confine mouse
8587
;Hotkey, "IfWinActive", "ahk_exe SumatraPDF.exe"
@@ -126,20 +128,40 @@ If MouseWin != SUMATRA_PDF_CANVAS1
126128
{
127129
if ModSlct = true ; note initially false by default, change to = true in plus.ini
128130
{
129-
; msgbox ModSlctTrue %MouseWin% %ModSlct%; for debugging only
131+
msgbox ModSlctTrue %MouseWin% %ModSlct%; for debugging only
130132
Click down
131133
}
132134
if ModLeft = true ; note initially false by default, change to = true in plus.ini
133135
{
134-
; msgbox ModLeftTrue %MouseWin% %ModLeft% ; for debugging only
136+
msgbox ModLeftTrue %MouseWin% %ModLeft% ; for debugging only
135137
Click {esc}
136138
Click down Right
137139
}
138140
}
139-
; msgbox Still in canvas
141+
; msgbox Still in canvas %MouseWin%
140142
return
141143
msgbox Left Button Error, I should never be here
142144

145+
; Some tablet users complain they can not double tap to exit full-screen mode !
146+
; and my touch pad does not have that function enabled so we need another means
147+
; the best option is Mod Right Mouse context to call ALT which has all commands
148+
~RButton::
149+
MouseGetPos,,,, MouseWin
150+
;confine actions to Canvas
151+
If MouseWin != SUMATRA_PDF_CANVAS1
152+
return ; Outside SumatraPDF Canvas
153+
else
154+
{
155+
if AltExit = true ; note initially false by default, change to = true in plus.ini
156+
{
157+
Click, Right, Up ; attempts to reset state is it needed if we esc ?
158+
SendInput {Esc}
159+
SendInput {Alt}
160+
}
161+
}
162+
; msgbox Still in canvas %MouseWin%
163+
return
164+
msgbox Right Button Error, I should never be here
143165

144166
; lets hook Alt + i to get current filename details (reserved for future use)
145167
!i::

0 commit comments

Comments
 (0)