Literal Hotkey For Renaming // hotkeys without Ctrl, Alt or Windows key

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Glirastes
Junior Member
Junior Member
Posts: 7
Joined: 2023-03-23, 20:26 UTC

Literal Hotkey For Renaming // hotkeys without Ctrl, Alt or Windows key

Post by *Glirastes »

Not sure whether this is a bug or a suggestion, since I don't know the intended behaviour in this case.

I want to map cm_RenameOnly to "r". When I press "r", the file name gets selected as expected and I can start typing to rename the file. However, if the desired filename contains "r" and I press it, all previously typed text disappears and gets replaced by a single "r". I assume this happens because cm_RenameOnly is defined to select all text when the renaming text box is already active (at least this is the behaviour for Shift + F6).

In my case, I would find it desirable that typing "r" in the box just appends the letter, getting "escaped". Since F2 and Shift + F6 do not trigger literal symbols, the standard behaviour could be unaffected in these cases.

I guess this may be a philosophical question. Should the hotkey for an action that opens a text box always do selection, if it is already open?
For renaming this seems to be the case, for copying for example it is not. There, F5 for switching the selected text seems to be hardcoded.

Kind regards
sa16
Senior Member
Senior Member
Posts: 217
Joined: 2021-09-10, 07:15 UTC

Re: [11.02 64-bit] Literal Hotkey For Renaming

Post by *sa16 »

Glirastes wrote:if the desired filename contains "r" and I press it, all previously typed text disappears and gets replaced by a single "r"
Press CapsLook and Shift+r or Alt+114 on the numeric keyboard.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [11.02 64-bit] Literal Hotkey For Renaming

Post by *ghisler(Author) »

Currently it's not possible to define a single character or digit as a hotkey for cm_RenameOnly or cm_RenameSingleFile, because pressing the same hotkey repeatedly is used to select just the name or the name and extension. I will add an exception for hotkeys without Ctrl, Alt or Windows key if they are in the range A..Z or 0..9.
Author of Total Commander
https://www.ghisler.com
Glirastes
Junior Member
Junior Member
Posts: 7
Joined: 2023-03-23, 20:26 UTC

Re: Literal Hotkey For Renaming // hotkeys without Ctrl, Alt or Windows key

Post by *Glirastes »

sa16 wrote: 2023-11-27, 07:16 UTC
Glirastes wrote:if the desired filename contains "r" and I press it, all previously typed text disappears and gets replaced by a single "r"
Press CapsLook and Shift+r or Alt+114 on the numeric keyboard.
That would be a workaround, but it's cumbersome and therefore not satisfactory. I'd even have to press CapsLock a second time afterwards. After all, I use such hotkeys to be faster.

ghisler(Author) wrote: 2023-11-27, 10:21 UTC Currently it's not possible to define a single character or digit as a hotkey for cm_RenameOnly or cm_RenameSingleFile, because pressing the same hotkey repeatedly is used to select just the name or the name and extension. I will add an exception for hotkeys without Ctrl, Alt or Windows key if they are in the range A..Z or 0..9.
That's exactly what I was hoping for. Thanks!
sa16
Senior Member
Senior Member
Posts: 217
Joined: 2021-09-10, 07:15 UTC

Re: Literal Hotkey For Renaming // hotkeys without Ctrl, Alt or Windows key

Post by *sa16 »

2Glirastes
Glirastes wrote:I'd even have to press CapsLock a second time afterwards.
With Alt+114, CapsLook is not required at all.
But I agree that both options are cumbersome.
sa16
Senior Member
Senior Member
Posts: 217
Joined: 2021-09-10, 07:15 UTC

Re: Literal Hotkey For Renaming // hotkeys without Ctrl, Alt or Windows key

Post by *sa16 »

2Glirastes
Here they remembered the old good decision (which is already more than 12 years old) with the creation of a user command instead of an internal one.
In my opinion, this decision is suitable for you.
Create a custom em_RenameSingleFile command (usercmd.ini file):

Code: Select all

[em_RenameSingleFile]
cmd=cm_RenameSingleFile
Map em_RenameSingleFile command to the "r" key.
Or do the same thing with the cm_RenameOnly command if it suits you better.
Glirastes
Junior Member
Junior Member
Posts: 7
Joined: 2023-03-23, 20:26 UTC

Re: Literal Hotkey For Renaming // hotkeys without Ctrl, Alt or Windows key

Post by *Glirastes »

2sa16
A neat workaround indeed, eliminates the unwanted side effect.
I did not think of this myself and also missed the other thread. Thanks for the reference!
Post Reply