mirror of
https://github.com/stevenilsen123/mac-keyboard-behavior-in-windows.git
synced 2025-12-13 13:34:24 +03:00
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:
committed by
Stephen Nilsen
parent
9fb63ed817
commit
b81ef61b46
@@ -20,7 +20,7 @@ This [AutoHotKey script](./mac.ahk) seeks to deliver all the **superior** MacOS
|
||||
2. Create a new `mac.ahk` file in the location of your choice. I recommend `%userprofile%/Documents/AutoHotKey/mac.ahk`.
|
||||
3. Open your newly created file in a text editor such as Notepad.
|
||||
4. Copy the contents of this [mac.ahk](./mac.ahk) into the file you created and save changes.
|
||||
5. Run the file by double-clicking it in Windows Explorer (click Yes when asked to grant admin rights to the script; this is required).
|
||||
5. Run the file by double-clicking it in Windows Explorer.
|
||||
|
||||
---
|
||||
## Buy me a coffee (optional) ☕
|
||||
|
||||
63
mac.ahk
63
mac.ahk
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user