 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
wideeyedguy
Joined: 09 Apr 2009 Posts: 15 Location: Houston, Tx
|
Posted: Mon Nov 16, 2009 3:21 pm Post subject: Problem - Hotstrings typing on screen one at a time. |
|
|
Recently moved to a new PC, but have made zero changes to
the scripts for my hotstrings.
When entering a shortcut i.e. !s:: to initiate a hotstring,
the hotstring is entered into whatever editor or data field that
I might be working in. However, it is showing each line as if it
is being typed manually - very quickly, but not instantaneously
as on the previous PC.
I can see each line of text being entered as if by hand, one keystroke
at a time. Previously, the text strings (paragraphs) would be inserted
instantly to whatever editor I was using at the moment.
For hotstrings that contain multiple lines of text strings, I also
lose keyboard control. I can no longer use arrow keys or backspace
as an example. I have to initiate another hotstring that contains
only one line of text to regain keyboard control.
Suggestions??
Thanks,
weg |
|
| Back to top |
|
 |
hugov
Joined: 27 May 2007 Posts: 2181
|
Posted: Mon Nov 16, 2009 3:26 pm Post subject: |
|
|
Look at setkeydelay, your keyboard settings may differ from your previous PC (slower). Also look at setbatchlines, -1
For longer hotstrings try the paste method and send the clipboardIt is probably faster and more reliable.
If you want to keep the original clipboard contents see "ClipboardAll (saving and restoring everything on the clipboard)" for an example on how to do that:
http://www.autohotkey.com/docs/misc/Clipboard.htm _________________ Tut 4 Newbies
TF : Text file & string lib, TF Forum |
|
| Back to top |
|
 |
wideeyedguy
Joined: 09 Apr 2009 Posts: 15 Location: Houston, Tx
|
Posted: Tue Nov 17, 2009 1:06 pm Post subject: |
|
|
Thanks for the reply.
I am using SendMode Input which makes Send synonomous with SendInput. Both ignore SetKeyDelay according to Help.
SetBatchLines didn't change anything.
I'm reading up on your ClipBoard approach, but still am wondering
what changed to cause this problem. Keep in mind, I'm losing keyboard
control after the hotstring inserts the text.
Here is one of the hotstrings I'm using.
| Code: |
!c:: ;Inserts Contact Log info
TodayMinus := A_Now
EnvAdd, TodayMinus, -3, days(
FormatTime, TodayMinus, %TodayMinus%, M/d/yy
SendInput %TodayMinus% -dg- reviewed client issues & involvement`n
SendInput Client gave me authority to negotiate.`n`n
TodayMinus := A_Now
EnvAdd, TodayMinus, -6, days
FormatTime, TodayMinus, %TodayMinus%, M/d/yy
SendInput %TodayMinus% -dg- em'd client non-participation advisory`n
SendInput %TodayMinus% -dg- emailed client request for new OIR`n
SendInput %TodayMinus% -dg- contact attempt w/client`n
Return
|
Then, here is a short one that I now have to use to regain keyboard control.
| Code: |
!d:: ;Inserts Supplement date
FormatTime, DateString,,M/d/yy
Send %DateString% -dg- report finished and submitted for supplementation.`n
Return
|
Thanks,
weg |
|
| Back to top |
|
 |
hugov
Joined: 27 May 2007 Posts: 2181
|
Posted: Tue Nov 17, 2009 1:44 pm Post subject: |
|
|
Try one of the other sends so you can use setkeydelay (also you at your keyboard settings in the OS)
Not sure what you mean by focus, but you can store the and restore the current window and or control before and after sending the text (still think sending clipboard is the fastest and most reliable way IMHO)
Re focus, look at WinGet, ControlGetFocus, ControlFocus it may help,
here is a snippet from one of my scripts where I use functions but
there is no need for that actually.
| Code: | CursorIn := GetActiveControl()
ActiveWindow := GetActiveWindow()
WinActivate AHK_ID%ActiveWindow%
ControlFocus, %CursorIn%, AHK_ID%ActiveWindow%
GetActiveControl()
{
WinGet, Active_Window_ID, ID, A
ControlGetFocus, ActiveControl, A,
Return, ActiveControl
}
GetActiveWindow()
{
WinGet, Active_Window_ID, ID, A
return, Active_Window_ID
} |
_________________ Tut 4 Newbies
TF : Text file & string lib, TF Forum |
|
| Back to top |
|
 |
wideeyedguy
Joined: 09 Apr 2009 Posts: 15 Location: Houston, Tx
|
Posted: Tue Nov 17, 2009 2:30 pm Post subject: |
|
|
HugoV,
Where did I make a reference to 'focus'?
I'm missing what you're saying.
". . . but you can store the ? and restore the current window and or control before . . ."
Thank you. |
|
| Back to top |
|
 |
hugov
Joined: 27 May 2007 Posts: 2181
|
Posted: Tue Nov 17, 2009 7:06 pm Post subject: |
|
|
| wideeyedguy wrote: | Where did I make a reference to 'focus'?
I'm missing what you're saying. | That is how I read it / understand it, the text is send but if you type afterwards nothing happens is that correct? In that case I asume either your window has lost focus or the focus on the control is lost (edit1 in notepad for example is the area where you type). | wideeyedguy wrote: | | ". . . but you can store the ? and restore the current window and or control before . . ."Thank you. | By explicitly retreiving the control and or window that has focus / is active you can make sure it still has focus AFTER the text has been sent.
Did you check your keyboard settings in the OS? Please answer this question, 3rd time I ask not going to again
And again, try pasting the clipboard it WILL be faster, more reliable etc. _________________ Tut 4 Newbies
TF : Text file & string lib, TF Forum |
|
| Back to top |
|
 |
wideeyedguy
Joined: 09 Apr 2009 Posts: 15 Location: Houston, Tx
|
Posted: Thu Nov 19, 2009 6:50 pm Post subject: |
|
|
I appreciate your patience.
How do I "check" my keyboard settings in the OS?
Perhaps if we step aside from the issue of the textstrings
and focus on why I'm losing keyboard functionality then I
can put up with the slowness of the textstrings.
weg |
|
| Back to top |
|
 |
hugov
Joined: 27 May 2007 Posts: 2181
|
|
| Back to top |
|
 |
a_h_k
Joined: 02 Feb 2008 Posts: 344
|
Posted: Mon Nov 30, 2009 8:49 am Post subject: |
|
|
| wideeyedguy wrote: | | Code: | !c::
TodayMinus := A_Now
EnvAdd, TodayMinus, -3, days( <-- is this a typo?
FormatTime, TodayMinus, %TodayMinus%, M/d/yy
SendInput %TodayMinus% -dg- reviewed client issues & involvement`n
SendInput Client gave me authority to negotiate.`n`n
TodayMinus := A_Now
EnvAdd, TodayMinus, -6, days
FormatTime, TodayMinus, %TodayMinus%, M/d/yy
SendInput %TodayMinus% -dg- em'd client non-participation advisory`n
SendInput %TodayMinus% -dg- emailed client request for new OIR`n
SendInput %TodayMinus% -dg- contact attempt w/client`n
Return
|
|
|
|
| Back to top |
|
 |
wideeyedguy
Joined: 09 Apr 2009 Posts: 15 Location: Houston, Tx
|
Posted: Mon Nov 30, 2009 12:46 pm Post subject: |
|
|
a_h_k,
Appears it was a typo, but has zero effect on the script
or the issue I'm having.
Any ideas to solve my problem?
Thanks,
weg |
|
| Back to top |
|
 |
hugov
Joined: 27 May 2007 Posts: 2181
|
Posted: Mon Nov 30, 2009 12:57 pm Post subject: |
|
|
Have you looked at the delay in the OS and Bios? Pasting the text may be the only solution left unless you experiment with ControlSend ... (would be hard to loose focus using that I suppose) _________________ Tut 4 Newbies
TF : Text file & string lib, TF Forum |
|
| Back to top |
|
 |
wideeyedguy
Joined: 09 Apr 2009 Posts: 15 Location: Houston, Tx
|
Posted: Mon Nov 30, 2009 4:51 pm Post subject: |
|
|
Keyboard rate is set to fast, from what I can see for those settings.
I've been experimenting with the ClipBoard paste method
and am not "gettin' it". I'm sure this is due to my limited understanding
of variables/expressions. Trying to read and understand.
What would a couple of the lines from the snippet I gave here
look like converted over to the ClipBoard method?
weg |
|
| Back to top |
|
 |
hugov
Joined: 27 May 2007 Posts: 2181
|
Posted: Mon Nov 30, 2009 8:42 pm Post subject: |
|
|
Try this | Code: | !c::
ClipboardSave:=ClipboardAll
TodayMinus3 := A_Now
TodayMinus6 := A_Now
EnvAdd, TodayMinus3, -3, days
EnvAdd, TodayMinus6, -6, days
FormatTime, TodayMinus3, %TodayMinus3%, M/d/yy
FormatTime, TodayMinus6, %TodayMinus6%, M/d/yy
;MsgBox % TodayMinus3
;MsgBox % TodayMinus6
Clipboard=
(join`n
%TodayMinus3% -dg- reviewed client issues & involvement
Client gave me authority to negotiate.
%TodayMinus6% -dg- em'd client non-participation advisory
%TodayMinus6% -dg- emailed client request for new OIR
%TodayMinus6% -dg- contact attempt w/client
)
;MsgBox % Clipboard
Send ^v
Clipboard:=ClipboardSave
ClipboardSave=
Return |
Edit: perhaps your repeat is too fast? Have you tried other send methods? (if you don't answer questions it only makes it harder to help you) _________________ Tut 4 Newbies
TF : Text file & string lib, TF Forum |
|
| Back to top |
|
 |
wideeyedguy
Joined: 09 Apr 2009 Posts: 15 Location: Houston, Tx
|
Posted: Mon Nov 30, 2009 11:03 pm Post subject: |
|
|
As you can see from the two snippets I pasted as examples,
I have used 'SendInput' and 'Send'.
Since the Help notes state that SendInput Mode makes Send synonomous with SendInput, I didn't see much to be gained by using Send, even though I had in some of the single-string Hotstrings.
According to Help, both ignore SetKeyDelay, so wasn't sure how your suggestion could be implemented. Help states that SendInput is the fastest method of sending keystrokes - "nearly instantaneous".
Perhaps I've overlooked another Send command that you're referring to in your questions. And, not certain when I would use SetKeyDelay if they ignore that setting.
Changing the keyboard settings, via Control Panel, is having zero effect on keystroke delivery to the screen or preventing loss of keyboard action as described in the original post.
Your Clipboard snippet is beautiful and is how I will modify each of my hotstrings. Also helps me to see how I should sequence the variables and setting statements. I will update you if I still have the keyboard problem after updating all of my strings and putting to use.
Disappointing to not deduce the cause of the original problem, but at least I have a new method to produce the intended result.
weg |
|
| Back to top |
|
 |
hugov
Joined: 27 May 2007 Posts: 2181
|
|
| 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
|