Keyboard Shortcut: how to remap the "End" Key ?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
unkis17
Junior Member
Junior Member
Posts: 80
Joined: 2006-07-31, 20:49 UTC
Location: Chicago, IL

Keyboard Shortcut: how to remap the "End" Key ?

Post by *unkis17 »

Recently purchased a new compact keyboard and now I don't have an "End" key without hitting the "Fn" key which doesn't come naturally.

I installed AutoHotKey and remapped the End Key to the Insert Key, works as expected.

Expect for in TC it seems? Not sure why. When I hit the INS key in TC it selects the file/directory as normal.

So I was thinking I could remap the INS key in TC then?

I have remapped a few keys in TCV over the years, but these remapping's are all to invoke "cm_XXX" commands.

How can I change the Insert key to End in TC? I am happy using something like Alt+INS or F12 (nothing by default I see in the Help) , but I can't seem to figure it out. Options -> Misc -> Remapping. But Once I click the magnifying glass I can only get lists of commands, not keys.

What am I doing wrong here?

Any help would be greatly appreciated.

Unkis
User avatar
Dalai
Power Member
Power Member
Posts: 9945
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Keyboard Shortcut

Post by *Dalai »

unkis17 wrote: 2025-01-27, 20:39 UTCExpect for in TC it seems? Not sure why. When I hit the INS key in TC it selects the file/directory as normal.
Are you running TC as administrator and the AutoHotkey script as user? If so, then that's very likely the reason why it doesn't work in TC - or any other program running as admin. Avoid running TC as admin except where it's really necessary (that's good advice regardless of this issue).
But Once I click the magnifying glass I can only get lists of commands, not keys.
In TC, keys or key combinations can only be remapped to commands, not to other keys.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
tuska
Power Member
Power Member
Posts: 4046
Joined: 2007-05-21, 12:17 UTC

Re: Keyboard Shortcut

Post by *tuska »

An em_command (without spaces) is needed here.

Configuration > Options... > Misc. > Select hotkey > Click on the magnifying glass 🔎... > Category: usercmd.ini >
New... > em_EndKEY (em_command without spaces!) >
e.g. Command: %COMMANDER_PATH%\Tools\AutoHotkey\AutoHotkey.exe %COMMANDER_PATH%\Tools\AutoHotkey\xxx.AHK > OK > OK >
click on the "Save"-Button: ✅ > OK - DONE!
Fla$her
Power Member
Power Member
Posts: 2982
Joined: 2020-01-18, 04:03 UTC

Re: Keyboard Shortcut

Post by *Fla$her »

2unkis17
You need to think ten times before buying a non-standard keyboard with Fn, etc. or have both options for different needs.
Overquoting is evil! 👎
unkis17
Junior Member
Junior Member
Posts: 80
Joined: 2006-07-31, 20:49 UTC
Location: Chicago, IL

Re: Keyboard Shortcut

Post by *unkis17 »

@Tuska,

Today I tried your example using F12, which is not mapped and this does NOT work. In fact it locks up TC! My CPU fan ramps up and the TaskMgr says TC is now clocking the CPU at 20%???

I reopened TC, removed F12 mapping, tried again with Ctrl+D (no default mapping on my system) and same result.

I copied "em_EndKEY" directly from the post so I am not sure if this doesn't work or if it is not the correct command.

Not sure if I did something wrong per your instructions.

Image: https://imgur.com/a/OgnOY3x
User avatar
Gral
Power Member
Power Member
Posts: 1600
Joined: 2005-01-26, 15:12 UTC

Re: Keyboard Shortcut

Post by *Gral »

As i see, description for your "em_EndKEY" is "em_EndKEY", so you just created a kind of loop.
This cannot work. Create a valid user command.
Follow the instructions of tuska and adjust the paths to the program and AHK script
unkis17
Junior Member
Junior Member
Posts: 80
Joined: 2006-07-31, 20:49 UTC
Location: Chicago, IL

Re: Keyboard Shortcut: how to remap the "End" Key ?

Post by *unkis17 »

Ah, I think I see now.

TC is not going to send the "End" keystroke. We created a hotkey to send the keystroke from the remapping that AHK is doing for me.

I will try that once I get back to that PC later today. Hopefully I can execute this correctly this time.
User avatar
tuska
Power Member
Power Member
Posts: 4046
Joined: 2007-05-21, 12:17 UTC

Re: Keyboard Shortcut: how to remap the "End" Key ?

Post by *tuska »

2unkis17

If you have followed these step-by-step instructions,
then the following should have taken place as a result (example).
  1. In the file "usercmd.ini" in %COMMANDER_PATH% *), the following code should be added for the em_command:
    Attention: Path to AHK script must be adjusted!
    In this example, I have added some text in the ‘Tooltip’ field.

    Code: Select all

    [em_EndKEY]
    button=
    cmd=%COMMANDER_PATH%\Tools\AutoHotkey\AutoHotkey.exe %COMMANDER_PATH%\Tools\AutoHotkey\xxx.AHK
    menu=em_EndKEY - F12 || Keyboard Shortcut: how to remap the "End" Key ? | https://www.ghisler.ch/board/viewtopic.php?p=467752#p467752
    *) %COMMANDER_PATH% is the path in which the TOTALCMD.EXE and/or TOTALCMD64.exe files are located.
       Pseudo environment variables
     
  2. F12: File "wincmd.ini" - section [Shortcuts] –-- Where is the wincmd.ini file located? -> Menu "Help" > "About Total Commander..."

    Code: Select all

    F12=em_EndKEY
After adjusting the path, the codes can also be entered in the wincmd.ini and usercmd.ini files using a text editor,
without following the step-by-step instructions. It is essential to note that the section names may only appear once!

Note:
Changes to the em_command can also be made as follows:
  1. Press BUTTON "CommandBrowser" (Ignore point 2. (Filter: 4006) --> only in the linked post(!))
  2. Category: usercmd.ini (bottom left) ...

 
See also: FAQs: User-Defined Command (UDC) (usercmd.ini) em_command


Restart TC
I'm not sure whether it is necessary to restart Total Commander after setup.
BUTTON with command: cm_exit 9

Code: Select all

TOTALCMD#BAR#DATA
cm_exit 9

TOTALCMD.EXE,25
cm_exit 9|1: Exit and restart Total Commander|8: Pass current left and right directory and file under cursor to new instance|https://www.ghisler.ch/board/viewtopic.php?p=446794#p446794

0
-1
Create a Button in the BUTTONBAR (copy/paste CODE)
  1. Click on "SELECT ALL" (to the right of CODE:), then press CTRL+C (copy to clipboard).
  2. Right-click on any place in the button bar, then click on "Paste".
     ⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺
  3. Option1: Point to the new button (slightly longer): 'Tooltip' is shown (-> description to the button).
                  A maximum of 259 characters is allowed for the tooltip. | = create line break, || = create | as separator character.
  4. Option2: Button bar - "Tooltip" field: A single space deactivates the display of the tooltip.
                  If the "Tooltip" field is empty, the content of the "Command" field is displayed.
  5. Option3: See FAQs and explanation: Button-code (TOTALCMD#BAR#DATA)  <-- <Ctrl+click on the link...>
unkis17
Junior Member
Junior Member
Posts: 80
Joined: 2006-07-31, 20:49 UTC
Location: Chicago, IL

Re: Keyboard Shortcut: how to remap the "End" Key ?

Post by *unkis17 »

I wanted to report back.

@Tuska - Your instructions were PERFECT, I did it all again verbatim this morning, checked my ini files and everything was correct. However it didn't give me the result I wanted. It did however launch AHK with the script I called. So your method was accurate.

Turns out @Dalai was correct with checking about running TC as Admin.

I WAS running TC this way. I changed that and immediately my existing AHK script worked!

I did change my AHK to use Ctrl+INS to send End because I do use INS in TC to select directories.

@Tuska thank you for your additional links. I have been using TC for +20yrs now, but rarely am I trying anything "new." I have been using it so long I kind of have things setup the way I need. I like learning "new to me" features as I don't know anyone in my life who uses this program. Always helpful to have a whole community here willing to help and teach. Thanks again

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

Re: Keyboard Shortcut: how to remap the "End" Key ?

Post by *petermad »

I did change my AHK to use Ctrl+INS to send End because I do use INS in TC to select directories.
By default you can also select files and folders in TC with the Space key. And if you want TC to jump to the next file after selecting with Space (like Ins does), then you can add SpaceMovesDown=1 to the [Configuration] section of your wincmd.ini file:
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
unkis17
Junior Member
Junior Member
Posts: 80
Joined: 2006-07-31, 20:49 UTC
Location: Chicago, IL

Re: Keyboard Shortcut: how to remap the "End" Key ?

Post by *unkis17 »

@petermad,

Thanks for the tip! The "move down" feature was the whole reason I kept INS by default. I might just change this now that I know I can add this.

unkis
Post Reply