I'm using the following AHK script to replace left ctrl and windows keys on my keyboard.
Code: Select all
; If the script is not elevated, relaunch as administrator and kill current instance:
full_command_line := DllCall("GetCommandLine", "str")
if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
{
try ; leads to having the script re-launching itself as administrator
{
if A_IsCompiled
Run *RunAs "%A_ScriptFullPath%" /restart
else
Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
}
ExitApp
}
LWin::LCtrl
LCtrl::LWin
RWin::RAlt
MButton::#Tab
WheelLeft::#^Left
WheelRight::#^Right
I suspect this clipboard might be invoking the now-remapped keys to do this. Perhaps it would help to make an exclusion here somehow, that if the action is coming from windows clipboard, then don't apply this mapping?
But how to do this?