Keyboard shortcut for drives

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
jriemerm
Junior Member
Junior Member
Posts: 2
Joined: 2022-01-28, 17:09 UTC

Keyboard shortcut for drives

Post by *jriemerm »

Hello all!

My previous favorite file manager, no longer under development, had super easy shortcuts for switching drives: Shift-D for changing to drive D, Shift-E for drive E, etc. I don't see anything quite like that in Total Commander, but I suspect there's a way to customize it so that works. If so, can someone tell help me find the simplest way to set it up? I'm comfortable editing configuration files if that's what it takes.

As long as I'm here, I might as well suggest such a feature built-in for the future. Or maybe just a easy-to-use dedicated tool in the settings for creating commands for changing drives and paths.

Thanks,

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

Re: Keyboard shortcut for drives

Post by *Dalai »

Switching drives in TC (via keyboard) is done with Alt+F1 and Alt+F2 key combinations (and typing the drive letter after that) for the left and right panels respectively. If that isn't suitable for you, define your own via Options > Misc > Redefine hotkeys and map any hotkey to cm_GotoDriveC, cm_GotoDriveD, cm_GotoDriveE and so on. See also cm_CommandBrowser (Choose command) that you can define more if required.

Keep in mind that using something common like Shift+D might interfere with basic TC functions like searching for a file with letters only (see Options > Quick search).

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
jriemerm
Junior Member
Junior Member
Posts: 2
Joined: 2022-01-28, 17:09 UTC

Re: Keyboard shortcut for drives

Post by *jriemerm »

That's perfect; thank you.
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Keyboard shortcut for drives

Post by *Stefan2 »

More details:


1) First complete missed entries in "TOTALCMD.INC" text file:

[________________Navigation________________]=0

cm_GotoDriveA=2061;Switch to drive A
cm_GotoDriveC=2063;Switch to drive C
cm_GotoDriveD=2064;Switch to drive D
cm_GotoDriveE=2065;Switch to drive E
cm_GotoDriveF=2066;(etc, define your own if)
cm_GotoDriveG=2067; G
cm_GotoDriveh=2068; H
cm_GotoDrivei=2069; I
cm_GotoDrivej=2070; J
cm_GotoDrivek=2071; K
cm_GotoDrivel=2072; L
cm_GotoDrivem=2073; M
cm_GotoDriven=2074; N
cm_GotoDriveo=2075; O
cm_GotoDrivep=2076; P
cm_GotoDriveq=2077; Q
cm_GotoDriver=2078; R
cm_GotoDrives=2079; S
cm_GotoDrivet=2080; T
cm_GotoDriveu=2081; U
cm_GotoDrivev=2082; V
cm_GotoDrivew=2083; W
cm_GotoDrivex=2084; X
cm_GotoDrivey=2085; Y

cm_GotoDriveZ=2086;(you need more drives)



2) The settings in "Options > Misc > Redefine hotkeys"
can be written directly to "wincmd.ini" too, for example (just copy&paste the needed)

[Shortcuts]
;'Shift+C execute Goto Drive 'C'
S+C=cm_GotoDriveC


S+D=cm_GotoDriveD
S+E=cm_GotoDriveE
S+F=cm_GotoDriveF
S+G=cm_GotoDriveG
S+H=cm_GotoDriveH
S+I=cm_GotoDriveI
S+J=cm_GotoDriveJ
S+K=cm_GotoDriveK
S+L=cm_GotoDriveL
S+M=cm_GotoDriveM
S+N=cm_GotoDriveN
S+O=cm_GotoDriveO
S+P=cm_GotoDriveP
S+Q=cm_GotoDriveQ
S+R=cm_GotoDriveR
S+S=cm_GotoDriveS
S+T=cm_GotoDriveT
S+U=cm_GotoDriveU
S+V=cm_GotoDriveV
S+W=cm_GotoDriveW
S+X=cm_GotoDriveX
S+Y=cm_GotoDriveY
S+Z=cm_GotoDriveZ



3) make a backup of your TOTALCMD.INC and wincmd.ini for later reference

for the lazy people
PS C:\temp> 1..19|ForEach{$a=70;$b=2066}{$a++;$b++; "cm_GotoDrive$([char]$a)=$b;[char]$a"}
cm_GotoDriveG=2067
cm_GotoDriveH=2068
cm_GotoDriveI=2069
cm_GotoDriveJ=2070
cm_GotoDriveK=2071
cm_GotoDriveL=2072
cm_GotoDriveM=2073
cm_GotoDriveN=2074
cm_GotoDriveO=2075
cm_GotoDriveP=2076
cm_GotoDriveQ=2077
cm_GotoDriveR=2078
cm_GotoDriveS=2079
cm_GotoDriveT=2080
cm_GotoDriveU=2081
cm_GotoDriveV=2082
cm_GotoDriveW=2083
cm_GotoDriveX=2084
cm_GotoDriveY=2085
PS C:\temp>

-or-

Code: Select all

PS C:\temp> 1..19|ForEach{$a=70;$b=2066}{$a++;$b++; "cm_GotoDrive$([char]$a)=$b    ;Switch to drive $([char]$a)"}
cm_GotoDriveG=2067    ;Switch to drive G
cm_GotoDriveH=2068    ;Switch to drive H
cm_GotoDriveI=2069    ;Switch to drive I
 
User avatar
petermad
Power Member
Power Member
Posts: 14743
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Keyboard shortcut for drives

Post by *petermad »

It is actually not necessary to add the missing entries in totalcmd.inc - you can just use the command number directly in the [Shortcuts] section of the wincmd.ini file - like

Code: Select all

[Shortcuts]
S+G=2067
S+H=2068
etc.

Notice that this has to be done in the wincmd.ini file - it is not possible to enter the command number via the "Configuration" -> "Misc." dialog.

If you use the command number like that in the wincmd.ini file, then it is not necessary to edit the totalcmd.inc file after each update of TC.
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.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply