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 

Problem - Hotstrings typing on screen one at a time.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
wideeyedguy



Joined: 09 Apr 2009
Posts: 15
Location: Houston, Tx

PostPosted: Mon Nov 16, 2009 3:21 pm    Post subject: Problem - Hotstrings typing on screen one at a time. Reply with quote

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



Joined: 27 May 2007
Posts: 2181

PostPosted: Mon Nov 16, 2009 3:26 pm    Post subject: Reply with quote

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 clipboard
Code:
Send ^v
It 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
View user's profile Send private message Visit poster's website
wideeyedguy



Joined: 09 Apr 2009
Posts: 15
Location: Houston, Tx

PostPosted: Tue Nov 17, 2009 1:06 pm    Post subject: Reply with quote

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



Joined: 27 May 2007
Posts: 2181

PostPosted: Tue Nov 17, 2009 1:44 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
wideeyedguy



Joined: 09 Apr 2009
Posts: 15
Location: Houston, Tx

PostPosted: Tue Nov 17, 2009 2:30 pm    Post subject: Reply with quote

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



Joined: 27 May 2007
Posts: 2181

PostPosted: Tue Nov 17, 2009 7:06 pm    Post subject: Reply with quote

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 Wink

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
View user's profile Send private message Visit poster's website
wideeyedguy



Joined: 09 Apr 2009
Posts: 15
Location: Houston, Tx

PostPosted: Thu Nov 19, 2009 6:50 pm    Post subject: Reply with quote

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



Joined: 27 May 2007
Posts: 2181

PostPosted: Thu Nov 19, 2009 6:53 pm    Post subject: Reply with quote

Start -> Control panel -> keyboard, properties and look at the repeat delay and repeat rate, perhaps they are set to SLOW (there should be a slider)
http://www.theeldergeek.com/images/HT2_007/SP32-20040715-171530.gif

2nd thing you could look at would be your BIOS settings, "Typematic Delay"
http://www.pcguide.com/ref/mbsys/bios/set/adv_TypeDelay.htm

Have you tried other Send methods, how about regular send?

What OS are you using XP, Vista or Win7
_________________
Tut 4 Newbies
TF : Text file & string lib, TF Forum
Back to top
View user's profile Send private message Visit poster's website
a_h_k



Joined: 02 Feb 2008
Posts: 344

PostPosted: Mon Nov 30, 2009 8:49 am    Post subject: Reply with quote

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



Joined: 09 Apr 2009
Posts: 15
Location: Houston, Tx

PostPosted: Mon Nov 30, 2009 12:46 pm    Post subject: Reply with quote

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



Joined: 27 May 2007
Posts: 2181

PostPosted: Mon Nov 30, 2009 12:57 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
wideeyedguy



Joined: 09 Apr 2009
Posts: 15
Location: Houston, Tx

PostPosted: Mon Nov 30, 2009 4:51 pm    Post subject: Reply with quote

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



Joined: 27 May 2007
Posts: 2181

PostPosted: Mon Nov 30, 2009 8:42 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
wideeyedguy



Joined: 09 Apr 2009
Posts: 15
Location: Houston, Tx

PostPosted: Mon Nov 30, 2009 11:03 pm    Post subject: Reply with quote

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



Joined: 27 May 2007
Posts: 2181

PostPosted: Tue Dec 01, 2009 10:28 am    Post subject: Reply with quote

Look again at the http://www.autohotkey.com/docs/commands/Send.htm you will sendplay sendevent might be worth experimenting with and have a look at http://www.autohotkey.com/docs/commands/SendMode.htm as well so you can still use send and easily try another method with modifying your hotstrings/hotkeys...
_________________
Tut 4 Newbies
TF : Text file & string lib, TF Forum
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 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