AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Suspend only Hotstrings
Goto page Previous  1, 2
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Pasukun



Joined: 16 Dec 2004
Posts: 84

PostPosted: Thu Aug 11, 2005 6:07 am    Post subject: Reply with quote

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
View user's profile Send private message
Dragonscloud



Joined: 16 Jul 2005
Posts: 97

PostPosted: Thu Aug 11, 2005 6:20 am    Post subject: Reply with quote

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
View user's profile Send private message
Dragonscloud



Joined: 16 Jul 2005
Posts: 97

PostPosted: Thu Aug 11, 2005 6:46 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group