BackgroundI find that Control+A doesn't necessarily select all text in various contexts and typically notice this after typing Control+A.
Not finding anything that seemed to help, I put together a little utility tentatively named "SelectAll" in an attempt to improve the situation a bit. I have been using it for a bit now and have found that it has turned out to be useful in my particular situation. After some discussion with mouser a decision to post it was reached. (Please let me know if you know of something similar or better.)
How to Use While this program is running, if Control+A does not select all text for a field with focus, try entering Control+A twice quickly to get all of the text selected.
The invocation may be done in at least two ways:
1. An initial Control+A sequence, then letting go of both keys, and a subsequent Control+A sequence.
2. An initial Control+A sequence, then without letting go of the control key, let go of the A key and press the A key again.
(I prefer the second approach, but both seem to work as far as triggering an attempt to select all text.)
CaveatUnfortunately, it doesn't work with a number of (all?) NirSoft utilities -- and it seems likely there are other things it won't work with. I might make an exception list, but haven't decided whether it's worth it or if it makes sense just yet. Also, depending on the size of the text field, after text is selected there may be some scrolling. Anyway, perhaps the code can be improved upon or someone can come up with a better idea
CreditsThe code is basically an adaptation of an AHK Forum post (thanks to the author "jonny"):
http://www.autohotkey.com/forum/topic15537-1.html
The selection method was improved by lanux128 -- thanks to him for that
CodeSource:
/*
Name: SelectAll
Description: Select All Text via Hotkey
Control+A does not always select all text unfortunately.
This program is an attempt to improve the situation a bit.
While this program is running, if Control+A does not select all
text for a field with focus, try entering Control+A twice
quickly.
This may be done in at least two ways:
1. An initial Control+A sequence, then letting go of both keys,
and a subsequent Control+A sequence.
2. An initial Control+A sequence, then without letting go of the
control key, let go of the A key and press the A key again.
FWIW, the author finds the second form easier to execute.
Example locations of relevance (Windows XP):
-7-zip: address/path text field [1]
-Code::Block: multiple text fields
-Everything: options dialog: multiple text fields
-FileZilla: multiple text fields
-Free Download Manager: multiple text fields
-grepWin: multiple text fields
-Internet Explorer:
home page text field [1]
-IrfanView: multiple text fields
-Notepad++: Preferences dialog: multiple text fields
-ReNamer: multiple text fields
-Universal Extractor: multiple text fields
-Windows Explorer:
address/path text field [1]
file/folder name when renaming via F2 [1]
-WinMerge:
Select Files and Folders: mulitple text fields [1]
Options dialog: multiple text fields
-WinSpy++: multiple text fields
-Save / Open Dialogs: filename text field [1]
-Run Dialog: name text field [1]
-File/Folder Properties Dialog:
various text fields
-HTMLHelp (hh.exe, .chm viewing): keyword text field [2]
Where this code does not work (Windows XP):
-Windows Explorer:
file name text field in searching for files
string text field in searching for files
[1] Though initial focus selects all text
[2] Double-clicking on field selects some text
code based on http://www.autohotkey.com/forum/topic15537-1.html
*/
#NoEnv
#Persistent
; XXX: place in .ini?
delay = 400
hkmod = ^
hkletter = a
hk = %hkmod%%hkletter%
fullhk = ~%hk%
Hotkey, %fullhk%, Invoke
Return
Invoke:
; 'delay' is the maximum allowed delay (in ms) between presses.
If ((A_PriorHotKey = fullhk) && (A_TimeSincePriorHotkey < delay))
{
BlockInput, On
; thanks to lanux128 for the following
Send, {Control Down}{Home}{Control Up}{Control Down}{Shift Down}{End}{Shift Up}{Control Up}
BlockInput, Off
}
; XXX: don't know what this Sleep is for...
Sleep, 0
KeyWait, %hkletter%
Return
ExecutableMetaPosted this here as per:
https://www.donation....msg199036#msg199036Please move if necessary