Various fixes:

#1 Bad insertion position behavior on Windows key hold
  * This was already fixed in a previous release
 #6 Cmd + Tab (hold) does not allow to use Left and Right arrow keys
 #8 Requires Administrator rights
This commit is contained in:
Stephen Nilsen
2023-03-22 11:23:29 -05:00
committed by Stephen Nilsen
parent 9fb63ed817
commit b81ef61b46
2 changed files with 41 additions and 24 deletions

63
mac.ahk
View File

@@ -7,21 +7,6 @@
; ! Ctrl (because of remapkey). For example, `Send, ^!a` would press Ctrl+Alt+A, and Send, ^{Home} would send Ctrl+Home. Note: ^A produces a different effect in some programs than ^a. This is because ^A presses Ctrl+Shift+A and ^a presses Ctrl+A. If in doubt, use lowercase.Sends Ctrl. For example, Send, ^!a would press Ctrl+Alt+A, and Send, ^{Home} would send Ctrl+Home. Note: ^A produces a different effect in some programs than ^a. This is because ^A presses Ctrl+Shift+A and ^a presses Ctrl+A. If in doubt, use lowercase.
; & An ampersand may be used between any two keys or mouse buttons to combine them into a custom hotkey.
; Relauch as admin if not already running as admin
full_command_line := DllCall("GetCommandLine", "str")
if (!(A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)")))
{
try
{
if (A_IsCompiled)
Run *RunAs "%A_ScriptFullPath%" /restart
else
Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
}
ExitApp
}
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
@@ -39,14 +24,46 @@ Ctrl & Tab::AltTab
^q::Send, !{f4}
; Insertion point movement
^Left::Send, {Home}
^Right::Send, {End}
^Up::Send, ^{Home}
^Down::Send, ^{End}
+^Left::Send, +{Home}
+^Right::Send, +{End}
+^Up::Send, +^{Home}
+^Down::Send, +^{End}
^Left::
Suspend, On
Send, {Home}
Suspend, Off
return
^Right::
Suspend, On
Send, {End}
Suspend, Off
return
^Up::
Suspend, On
Send, ^{Home}
Suspend, Off
return
^Down::
Suspend, On
Send, ^{End}
Suspend, Off
return
+^Left::
Suspend, On
Send, +{Home}
Suspend, Off
return
+^Right::
Suspend, On
Send, +{End}
Suspend, Off
return
+^Up::
Suspend, On
Send, +^{Home}
Suspend, Off
return
+^Down::
Suspend, On
Send, +^{End}
Suspend, Off
return
#Left::
Suspend, On
Send, ^{Left}