 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
ArchCarrier
Joined: 03 Jun 2008 Posts: 27
|
Posted: Tue Sep 09, 2008 7:19 am Post subject: How to toggle between 2 sets of hotkeys? |
|
|
I have defined many hotkeys for marking up HTML (for example: shift-ctrl-i puts the selection in <em>-tags, and so on). Now I want to use these same hotkeys for marking up LaTeX files, ideally by pressing a toggle key to switch between the two sets of hotkeys.
My first guess was to include one of the sets (in .ahk files) depending on the state of a toggle variable, but the help file says that #Include can't be used in conditional clauses. What would be the best way to do this instead? |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Tue Sep 09, 2008 8:17 am Post subject: |
|
|
Refer AHK Doc for #IfWinExist command which allows context sensitive Hotkeys.
Here is a working template to understand from:
| Code: | Gui -Caption +Owner
Gui, Show, x0 y0 w0 h0 NA, Hotkey-Setting-A
Return
#IfWinExist Hotkey-Setting ahk_class AutoHotkeyGUI
#A:: Gui, Show, NA, Hotkey-Setting-A
#B:: Gui, Show, NA, Hotkey-Setting-B
#C:: Gui, Show, NA, Hotkey-Setting-C
#IfWinExist
#IfWinExist Hotkey-Setting-A ahk_class AutoHotkeyGUI
F1::MsgBox Hotkey-Setting-A F1
F2::MsgBox Hotkey-Setting-A F2
F3::MsgBox Hotkey-Setting-A F3
#IfWinExist
#IfWinExist Hotkey-Setting-B ahk_class AutoHotkeyGUI
F1::MsgBox Hotkey-Setting-B F1
F2::MsgBox Hotkey-Setting-B F2
F3::MsgBox Hotkey-Setting-B F3
#IfWinExist
#IfWinExist Hotkey-Setting-C ahk_class AutoHotkeyGUI
F1::MsgBox Hotkey-Setting-C F1
F2::MsgBox Hotkey-Setting-C F2
F3::MsgBox Hotkey-Setting-C F3
#IfWinExist |
 _________________ URLGet - Internet Explorer based Downloader |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|