 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Pasukun
Joined: 16 Dec 2004 Posts: 84
|
Posted: Thu Aug 11, 2005 6:07 am Post subject: |
|
|
You know.. I had almost exact situation, but not for the hotstrings, but to toggle on and off some of the fuctions in my script.
So I decided to use a variable that can be used to act as a switch.
I Don't know if this meet your need, but here is what I would do.
| Code: |
SetKeyDelay, 0
CHK = T
!n:: ;Won't be affected by suspend hotkey.
Run, Notepad
return
!`:: ;This is my suspend hotkey.
If CHK = T
{
CHK = F
return
}
CHK = T
return
::btw::
If CHK = T
{
Send, by the way%A_EndChar%
return
}
Send, btw%A_EndChar%
return
|
_________________
"the things we touch have no permanence. my master would say: there is nothing we can hold onto in this world.. only by letting go can we truly possess what is real..."
Last edited by Pasukun on Thu Aug 11, 2005 6:27 am; edited 1 time in total |
|
| Back to top |
|
 |
Dragonscloud
Joined: 16 Jul 2005 Posts: 97
|
Posted: Thu Aug 11, 2005 6:20 am Post subject: |
|
|
Thanks for sharing your method. Your method would come in handy for suspending single externally-defined hotstrings/hotkeys while letting the rest run as normal.
| Tekl wrote: | Hi,
I did it like you, but instead of renaming I write ";" into the hotstrings-file. Your way is simpler and faster. Thanks for sharing.
Tekl |
_________________ “yields falsehood when preceded by its quotation” yields falsehood when preceded by its quotation. |
|
| Back to top |
|
 |
Dragonscloud
Joined: 16 Jul 2005 Posts: 97
|
Posted: Thu Aug 11, 2005 6:46 am Post subject: |
|
|
Thank you!
While I prefer my method for my current project, I'll be using your method for other scripts. Your approach has two distinct advantages over mine:
a: No need for an external file.
b: No annoying Reload commands.
I think that this function would be a good addition to the help file.
| Laszlo wrote: | The following trick works if you change your hotstring definitions only a little, though they are not single line any more. Alt-Z disables/enables hotstrings, which bother to check. | Code: | AutoTrim Off
!z::HotStringToggle := !HotStringToggle
::btw::
Hot("by the way")
Return
Hot(x)
{
Global HotStringToggle
IfEqual HotStringToggle,1, StringTrimLeft x,A_ThisHotkey,2
Send %x%%A_EndChar%
} |
|
_________________ “yields falsehood when preceded by its quotation” yields falsehood when preceded by its quotation. |
|
| 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
|