AutoHotkey Community

It is currently May 27th, 2012, 3:29 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: October 27th, 2005, 3:15 pm 
the post above is not mine ! Probably Chris one ! I effectively posted a new example in witch "Send ^c" was surronded by "BlockInput, on" and "BlockInput, off" to be sure that the clipboard content is send without any interference. That sample was demonstrating that there was no lost of physically typed keystrockes, even with a very big clipboard content, with this method (at least on my computer !!!)...
And I said too that I think it would be good to be able to record phsycally pressed keystrokes during a Send command to be able to decide what to do with them after.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2005, 5:08 pm 
Offline

Joined: October 25th, 2005, 6:11 am
Posts: 8
Look, I am a newbie to AHK, and just interested in basic scripts, not fancy windows programming, and I don't know the technical architecture of AHK or of programming an application like this in Windows, nor the philosophy behind AHK, BUT - I still think there should at least be an option to simply QUEUE UP all keystrokes entered during a script, or at least during a SEND, and send them when the script finishes. It seems to me this is the intuitive way for it to work. Maybe that's impossible architecturally, but it sure would be nice!

Just my 2 cents.

Dan
The one who started this thread.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2005, 3:34 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Improvements in this area area planned. Hopefully one of the suggested solutions will work for you in the meantime.

Nemroth wrote:
the post above is not mine ! Probably Chris one !
Yes, I killed it by accident. I think I pressed the wrong button and wound up editing your post rather than quoting it. If you happen to have a copy of your clipboard script, feel free to repost it. Sorry for the inconvenience.

Here's my original reply to your missing post:
Quote:
But I still think it can be usefull to record keystrokes, to be able to exam them (if it is possible) and to decide what do to with them : send the keystrokes or not
I think such a thing is too elaborate because the vast majority of hotstring users just want their abbreviations to expand quickly and reliably. In other words, I think that making a buffer of physical keystrokes available to the script would not be needed often (and in cases where it is, you could use the Input command).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2005, 6:14 am 
Offline

Joined: September 7th, 2004, 9:20 pm
Posts: 275
Location: France
Chris wrote:
Yes, I killed it by accident.


Never mind. I didn't kept a copy of my script, but it was so simple... To be complete for kronhead, the last version of my solution was :
Code:
:*:ccc::
ClipSaved := ClipboardAll   ; Save the entire clipboard to a variable of your choice.
clipboard  =
(Join`r`n
A line of text.
By default, the hard carriage return (Enter) between the previous line and this one will be written to the file.
   By default, the tab to the left of this line will also be written to the file.
By default, variable references such as %Var% are resolved to the variable's contents.
)
BlockInput, on
Send, ^v
BlockInput, off
Clipboard := ClipSaved   ; Restore the original clipboard. Note the use of Clipboard (not ClipboardAll).
ClipSaved =
Return

If you type "ccc", the string is send, and if you type "cccc", you don't loose the last "c", even if the text in the clipboard is very long (longer than in the example). What you type physically during the Send command is not buffered, so you may loose it, but as Windows think that the send of the clipboard content is the send of only one character, the send is done very fast. You can try my solution with a very long text in the continuation section (see this subject in the help file).
Of course the solution works with a very short text too !!!
It you do for example :
Code:
::dont::
ClipSaved := ClipboardAll   ; Save the entire clipboard to a variable of your choice.
clipboard  = don't
BlockInput, on
Send, ^v
BlockInput, off
Clipboard := ClipSaved   ; Restore the original clipboard. Note the use of Clipboard (not ClipboardAll).
ClipSaved =
Return
and you type "dont go to the ...", you will have "don't go to the ..."
Hope it helps

@ Chris :
Chris wrote:
I think that making a buffer of physical keystrokes available to the script would not be needed often (and in cases where it is, you could use the Input command).
1- "would not be needed often" ? May be, I'm not conviced. I think that if the user have this possibility, he will use it to avoid the lost of characters typed by the user during a Send command, rather than block the user input and loose the physically typed characters.
2-Could you post and example of what you have in mind with the Input command, please ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2005, 1:39 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Nemroth wrote:
...if the user have this possibility, he will use it to avoid the lost of characters typed by the user during a Send command, rather than block the user input and loose the physically typed characters.

That's interesting. But rather than making it a built-in variable, I think this feature could be built into the program as a default (assuming it's feasible). For example, if the user physically types something while the Send command is sending long text, those keystrokes could be buffered and automatically sent afterward.

Due to the slight possibility of this breaking existing scripts (such as those that intentionally use a high key-delay), perhaps this behavior could be made optional somehow.

However, there might be complications when both the Send command and the user try to send keystrokes at the same time (e.g. if both the script and the user are trying to use the Shift key simultaneously). So I've made a note to research it more.

Thanks for the idea.

Quote:
2-Could you post and example of what you have in mind with the Input command, please ?
The Input command has an option to ignore keystrokes generated by AutoHotkey. With that in effect, it might be able to capture the user's physical input even during the Send command. However, it's not designed specifically for that, and due to time constraints I haven't yet tested it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2005, 5:26 pm 
Offline

Joined: September 7th, 2004, 9:20 pm
Posts: 275
Location: France
Chris wrote:
I think this feature could be built into the program as a default (assuming it's feasible). For example, if the user physically types something while the Send command is sending long text, those keystrokes could be buffered and automatically sent afterward.
I think it would be better to let the programmer decide to keep or delete the characters typed physically during a Send command, even if there were no way to exam them.
Chris wrote:
The Input command has an option to ignore keystrokes generated by AutoHotkey. With that in effect, it might be able to capture the user's physical input even during the Send command.

I didn't remember the option. But I think that the difficulty would be a speed one. the Send..ing of character can be fast, as slow to allow physically typed characters to "interrupt" the Send...ing process, but may be too fast to not allow the intercept by the Input command.... (I hope I can be understood) :?: :?: :?:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 29th, 2005, 4:05 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Hopefully something will be devised eventually that will provide an improvement in this area (hotstrings and Send). Until then, using -1 for KeyDelay and setting the priority of the script to High are pretty good solutions for those rare cases where keystrokes don't get sent fast enough.

As for the Input command, if you ever find it inadequate for some buffering task you had in mind, please let me know. But as it stands now, improvements to it are a fairly low priority.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 29th, 2005, 9:40 pm 
Offline

Joined: October 25th, 2005, 6:11 am
Posts: 8
I was the original poster - and I can certainly use it successfully with these changes. Occasional clitches are minor.

Just FYI - I switched to AHK to replace Activewords (I was trying to remember the name earlier and could NOT for the life of me - then I got an email from them today.) Activewords was big and slow, but I never had the problem of mixed keystrokes/script characters when I was using Activewords. But I am still happy I switched.

Dan


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 7th, 2005, 1:16 am 
Offline

Joined: October 21st, 2005, 12:02 am
Posts: 56
Location: Germany
Quote:
May be a new option to the BlockInput command ?
Code:
BlockInput, on, Remember var


During the BlockInput command, the keyboard input is recorded in the "var" variable and so can be send after if needed ???

I second that!

I use Autohotkey to easily input characters with a macron (horizontal line):
[code]:*z?:ää::
PrintUnicode("Ä


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 10th, 2005, 10:32 am 
Offline

Joined: September 25th, 2005, 4:31 pm
Posts: 610
For those still interested:

Buffered Send and SendRaw


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 10th, 2005, 10:02 pm 
Offline

Joined: October 21st, 2005, 12:02 am
Posts: 56
Location: Germany
Hi shimanov,

thank you!

I don't understand your script yet, but I'll give it a try! :)

Regards,

Laudrin


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2005, 12:04 am 
Offline

Joined: September 25th, 2005, 4:31 pm
Posts: 610
Finally, a response. I was beginning to think it didn't work as intended.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2005, 12:15 am 
Offline

Joined: October 21st, 2005, 12:02 am
Posts: 56
Location: Germany
At the moment, I'm writing my thesis (Staatsexamen). So there's little time for me to try out any scripts or write in the forum. Even if it's hard because there are lots of old and new interesing scripts...

From wednesday on, after I handed in my work, I will try to implement your buffered send solution in my script. Then I will give you a feedback. But I'm sure I'll have a lot of questions then. :wink:

Regards,

Laudrin


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google Feedfetcher and 14 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group