Button mehfach belegen

German support forum

Moderators: white, Hacker, Stefan2

Post Reply
Wurzelsepp
Junior Member
Junior Member
Posts: 63
Joined: 2012-12-13, 05:07 UTC

Button mehfach belegen

Post by *Wurzelsepp »

Kann man einen Button so belegen, dass Shift-Click oder Ctrl-Click eine andere Funktion hat als Einfachklick?
Oder kann ein Skript, das vom Button gestartet wird, erfahren wnn Shift gedrückt wurde?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Button mehfach belegen

Post by *Horst.Epp »

Da gibt es ButtonBar eXtended
viewtopic.php?t=20274

Persönlich benutze ich ein Autohokey Script Toolbar.ahk vom Author des ButtonBar eXtended.

"Toolbar" the little brother of "ButtonBar eXtended" for Total Commander
Version: 0.4
Freeware by Samuel Plentz

Das Skript ist im Download der Source von ButtonBar eXtended enthalten.
Der Folgende Text leider nicht, aber die mitgelieferte Toolbar.ini enthält Beispiele.
Spoiler


It does mainly 2 things:
- if you ctrl-click, Alt-click or Shift-click on a toolbar-icon, different commands can be run
- Makro support for TC

You need this file:
Toolbar.exe

You may also compile it with Autohotkey by yourself:
Toolbar.ahk

Now create a button in the Toolbar:
Code:
command: **your path to Toolbar.exe**\Toolbar.exe
parameter: **any number from the Toolbar.ini**
path: **your path to Toolbar.ini** (I suggest same as Toolbar.exe)

Any other options are left to you.


You also need a Toolbar.ini file like this:
Code:
[Button 1 Normal]
1_Command=2018

[Button 1 Ctrl]
1_Command=2017

[Button 2 Normal]
1_Command=69
2_Command=169

[Button 3 Normal]
1_File=C:\Programme\PSPad editor\PSPad.exe
1_Path=C:\Programme\PSPad editor\

[Button 3 Ctrl]
Needs_Parameters=1
Wait_Ctrl_Up=1
1_File=C:\Programme\PSPad editor\PSPad.exe
1_Path=C:\Programme\PSPad editor\
1_Parameter=%S


The 1. button copies long filenames by default and short ones if you hold ctrl. (The numbers are found in Totalcmd.inc)
The 2. button swaps the thumbnail-view on both panels. (any number of actions may be performed - also mixed between programs and commands)
The 3. button opens PSPad by default and with a parameter if you hold ctrl.

If you specify "Needs_Parameters=1" in a button then you may use this variables:
Code:
%S - list of all selected files (every file encapsulated in quotes)
%N - first selected file (encapsulated in quotes)
%P - path (NOT encapsulated in quotes)


"Wait_Ctrl_Up=1" is used because some programs behave different, if opened while you hold down ctrl. (For example they open minimized.) So "Toolbar.exe" waits until ctrl is released, before it continues.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

You can use the program for triggering macros by hotkeys.

Just create a user defined command by creating the "usercmd.ini" in the same directory as "wincmd.ini" with an entry like:
Code:
[em_SwitchBothPanelsToThumbnailMode]
cmd=**your path to Toolbar.exe**\Toolbar.exe
param=2
path=**your path to Toolbar.ini**


Then you need two entries in the "Toolbar.ini" like:
Code:
[Button 2 Normal]
1_Command=69
2_Command=169

[Button 2 Ctrl]
1_Command=69
2_Command=169

I created both entries, so the hotkey can have the ctrl-key pressed or not.
Now you can just assign any hotkey to the command: em_SwitchBothPanelsToThumbnailMode

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


You can execute any number of internal commands.
Code:
1_Command=...
2_Command=...
3_Command=...
4_Command=...
5_Command=...
6_Command=...
7_Command=...

You can also alternate commands with file executions like:
Code:
1_Command=...
2_File=...
2_Path=...
2_Parameter=...
3_Command=...
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
Post Reply