Hello, what I'm trying to get is this: I load my script and F1 turns into ctrl+/, F12 turns into ctrl+,. After I once press ctrl+Home, my F1 turns into Q, and F12 turns into E.
When I rut the script I get an error about F1 beeing Duplicate hotkey
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Menu, Tray, Icon, shell32.dll, 283 ;changes the taskbar icon to something
SendMode Input
#InstallKeybdHook
#UseHook On
#SingleInstance force ;only one instance of this script may run at a time!
#MaxHotkeysPerInterval 2000
#HotkeyModifierTimeout 60 ; https://autohotkey.com/docs/commands/_HotkeyModifierTimeout.htm
#KeyHistory 200 ; https://autohotkey.com/docs/commands/_KeyHistory.htm ; useful for debugging.
#MenuMaskKey vk07 ;https://autohotkey.com/boards/viewtopic.php?f=76&t=57683
#WinActivateForce ;https://autohotkey.com/docs/commands/_WinActivateForce.htm ;prevent taskbar flashing.
^End::Suspend, Toggle ;PAUSE THE SCRIPT CTRL+END
toggle := 0
return
^Home::
toggle := !toggle
if (toggle = 0){
F1::
^/
return
F12::
^,
return
} ; END OF PROFILE 1
else{
F1::q
F12::e
} ; END OF PROFILE 2
return
[Mod edit: Provisional topic name added]
Duplicate hotkey error
Re:
You want #IfWinActive or #If when making hotkeys conditional
Edit: https://www.autohotkey.com/docs/commands/_IfWinActive.htm and https://www.autohotkey.com/docs/commands/_If.htm
Edit: https://www.autohotkey.com/docs/commands/_IfWinActive.htm and https://www.autohotkey.com/docs/commands/_If.htm
Please excuse my spelling I am dyslexic.
Who is online
Users browsing this forum: 20170201225639, Bing [Bot], effel, grossermanitu, HiSoKa, mikeyww and 47 guests