Hotkey to place blinking cursor at the end of the TC commandline input?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

Hotkey to place blinking cursor at the end of the TC commandline input?

Post by *JOUBE »

How do I actually get to the TC commandline reliably via a keyboard shortcut so that the cursor is blinking at the end of the input?

Background: Unfortunately, since the cm_AddToCmdLine "TEXT" or cm_AddTextToCmdLine "TEXT" function was not implemented in TC11 (which I can definitely understand, because external access was made possible around 2015,WM_USER+50 ... e.g. via AHK via ), see this thread Re: [Tc11.02RC3] Internal command cm_AddToCmdLine "TEXT" is missing.

1. That's why I built a system with which I can get a wide variety of texts (internal commands to which I then want to add further elements, bash script commands for use via SFTP plugin, etc.) into the Tc commandline. Then I use the mouse to place the cursor behind last char of the elements in the Tc commandline to add additional text.

2, I also very often use the following approach:
Copy filename.ext filename_additional.ext
Copy I write via keyboard directly, then I paste the filename.ext twice in the tc commandline with Ctrl-Enter (or even Ctrl-Shift-enter). Then I use the mouse to place the cursor behind the second filename.ext and then change the second filename from there.

In the two cases mentioned, a cursor is initially not visible at the end of the TCcommanline, even if I use the internal command 'cm_FocusCmdLine' in the first case (after filling the commandline via Autohotkey), which of course is not possible in the second case anyway.

The cursor must therefore reliably be at the end of what has already been entered in the command line and must not change anything about what has been entered so far and must also be visible blinking, how I can make it with the mouse. But I would like to replace exactly this mouse grip with a TC-internal hotkey.

How do I do this in Tc? I never had the time to test it out.

Is there a hotkey for what I'm setting on. I just don't know him, I hope...

Joube
User avatar
Hacker
Moderator
Moderator
Posts: 13067
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Hotkey to place blinking cursor at the end of the TC commandline input?

Post by *Hacker »

JOUBE,
Something simlar to Shift-Right, End, but in one hotkey?

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

Re: Hotkey to place blinking cursor at the end of the TC commandline input?

Post by *JOUBE »

Okay. Shift-Right or Shift+Right? I will test ist. Thanks for the moment.

The reason to start this thread is, to force myself to take the time to test something...

Because it is allways the same: If I have that issue 20x times at that day, everything is hurryup and everything is really important at that moment, so there is no time to test something. ;-)

Now I will do it and will write results and additional questions/requests here.

Joube
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

Re: Hotkey to place blinking cursor at the end of the TC commandline input?

Post by *JOUBE »

It is Shift+Right.

Shift+Right End works. But it 'dangerous': To delete whole line. In the hurry it is not useful....

Shift+Right End works. But the truth is: that are two hotkeys... not usefull.

Hint: I has to say, that "copy" and than Ctrl+Enter twice puts the blinking Cursor in the Tc command line at the right position. But often I have todo something others before I want to go to the command line at the right position AND see the cursor blinking there. In this case I use the mouse and this I want to substitute with a hotkey.
sa16
Senior Member
Senior Member
Posts: 217
Joined: 2021-09-10, 07:15 UTC

Re: Hotkey to place blinking cursor at the end of the TC commandline input?

Post by *sa16 »

2JOUBE
You can, for example, assign a custom command to Ctrl+~.

wincmd.ini -->
[Shortcuts]
C+OEM_US`~=em_SendEndCmdLine

usercmd.ini -->
[em_SendEnd]
cmd=%COMMANDER_PATH%\VBS\SendEND.vbs
[em_SendEndCmdLine]
cmd=cm_FocusCmdLine,em_SendEND

SendEND.vbs -->
WScript.CreateObject("WScript.Shell").SendKeys "{END}"
Wscript.Quit
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

Re: Hotkey to place blinking cursor at the end of the TC commandline input?

Post by *JOUBE »

Thanks, I will try it. Maybe it takes some days for testing it.
User avatar
Hacker
Moderator
Moderator
Posts: 13067
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Hotkey to place blinking cursor at the end of the TC commandline input?

Post by *Hacker »

JOUBE,
Shift-Right or Shift+Right?
What would be the difference? Isn't it just another way of writing the same?
But it 'dangerous': To delete whole line.
Well, you have to let go of Shift before pressing End.
But the truth is: that are two hotkeys... not usefull.
Another, not much better approach, as long as you don't have quick search to activate while pressing a key, is simply to type a letter and backspace. The letter gets appended to the end of the command line, and backspace erases it.

If you want to use AHK, you could use something like:

Code: Select all

^~::Send, +{Right}{End}
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Hotkey to place blinking cursor at the end of the TC commandline input?

Post by *petermad »

IMHO the best thing was if TC remembered the last cursor position when loosing focus, and would use that position as the point of insertion when pressing Ctrl+Enter or Ctrl+Shift+Enter. Then Shift+LeftArrow could be used to return to the saved cursor position and not select anything. Currently Shift+LeftArrow and Shift+RuightArrow has the same function
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

Re: Hotkey to place blinking cursor at the end of the TC commandline input?

Post by *JOUBE »

Hacker wrote: 2024-01-26, 13:10 UTC Well, you have to let go of Shift before pressing End.
Yes, easy to write down, but impossible to always avoid, that's the problem... For me not usable, sorry.


Hacker wrote: 2024-01-26, 13:10 UTC If you want to use AHK, you could use something like:

Code: Select all

^~::Send, +{Right}{End}
Blinking cursor? I will try it.
Last edited by JOUBE on 2024-01-26, 20:35 UTC, edited 4 times in total.
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

Re: Hotkey to place blinking cursor at the end of the TC commandline input?

Post by *JOUBE »

petermad wrote: 2024-01-26, 13:26 UTC IMHO the best thing was if TC remembered the last cursor position when loosing focus, and would use that position as the point of insertion when pressing Ctrl+Enter or Ctrl+Shift+Enter. Then Shift+LeftArrow could be used to return to the saved cursor position and not select anything. Currently Shift+LeftArrow and Shift+RuightArrow has the same function
I do not see any problems with that. I think, cursor is at the correct position, but without blinking. That's the point.
User avatar
Hacker
Moderator
Moderator
Posts: 13067
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Hotkey to place blinking cursor at the end of the TC commandline input?

Post by *Hacker »

JOUBE,
easy to write down, but impossible to always avoid
If you don't use Brief view nor SpecialCursorMovement= you can do it without Shift, i.e. Right, End.

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Hotkey to place blinking cursor at the end of the TC commandline input?

Post by *Dalai »

2JOUBE
Do you use Windows 10 or 11? If so, there's a "feature" Microsoft implemented that causes the caret to stop blinking after about 5 seconds. This applies to all standard edit fields in all applications. This obviously includes all text fields in TC, including the command line. There's nothing TC could do about the caret.

However, there's an undocumented registry value to control this behavior and essentially return to the behavior of previous Windows versions:

Code: Select all

[HKEY_CURRENT_USER\Control Panel\Desktop]
;--- <Removed my German comments>
;    Documentation for this registry value: currently none.
;    default: 5000 (decimal)
"CaretTimeout"=dword:ffffffff
~4.3 billion milliseconds is basically forever in this context.

See also
https://stackoverflow.com/questions/57265346/how-to-keep-the-caret-blinking-in-windows-application
https://superuser.com/questions/1436937/cursor-stops-blinking-after-a-few-seconds-on-windows-10

Regards
Dalai
Last edited by Dalai on 2024-01-27, 02:03 UTC, edited 1 time in total.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: Hotkey to place blinking cursor at the end of the TC commandline input?

Post by *Fla$her »

petermad wrote: 2024-01-26, 13:26 UTC IMHO the best thing was if TC remembered the last cursor position when loosing focus, and would use that position as the point of insertion when pressing Ctrl+Enter or Ctrl+Shift+Enter. Then Shift+LeftArrow could be used to return to the saved cursor position and not select anything. Currently Shift+LeftArrow and Shift+RuightArrow has the same function
Great idea for an option with no text selection. Only the loss of focus should not be done by hiding by Esc or confirming by Enter.
This would also be useful when executing the commands: cm_FocusCmdLine, cm_AddPathToCmdline, cm_AddFileNameToCmdline, cm_AddPathAndFileNameToCmdline.
Maybe you'll post it here?
Overquoting is evil! 👎
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

Re: Hotkey to place blinking cursor at the end of the TC commandline input?

Post by *JOUBE »

Hacker wrote: 2024-01-26, 21:11 UTC JOUBE,
easy to write down, but impossible to always avoid
If you don't use Brief view nor SpecialCursorMovement= you can do it without Shift, i.e. Right, End.
Thanks for your hints. I use (nearly) ever the brief view.

Dalai wrote: 2024-01-26, 23:00 UTC Do you use Windows 10 or 11? If so, there's a "feature" Microsoft implemented that causes the caret to stop blinking after about 5 seconds.
...
Yes, I use these version and will have a look about that. Thanks


For my testing purposes it would be useful to have a list of default free Ctrl/Alt/Shift+Keys (not a list of the default used ones). Is that available somewhere? I've been looking for a list like this over the years again, regardless of this thread.



Joube
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Hotkey to place blinking cursor at the end of the TC commandline input?

Post by *petermad »

Fla$her wrote: 2024-01-27, 00:45 UTC Maybe you'll post it here?
Done: viewtopic.php?t=80898
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply