Инструменты пользователя

Инструменты сайта


en:documentation:tweaks_controlsetmouseaction

ControlSetMouseAction

The command adds an action on mouse events in the Total Commander window.

ControlSetMouseAction </R[:U|:D]|/M[:U|:D]|/L[:U|:D]|/W[:F|:R]|/X1[:U|:D]/X2[:U|:D]] [/K:<S|C|A|R|M|L|X1|X2>] [/B:<1..7>] <controlid> <cmd> [params]
ControlSetMouseAction </R[:U|:D]|/M[:U|:D]|/L[:U|:D]|/W[:F|:R]|/X1[:U|:D]/X2[:U|:D]] [/K:<S|C|A|R|M|L|X1|X2>] [/B:<1..7>] /C:<class> <instance> <cmd> [params]

Parameters

<controlid>Index of control, see table below.
<instance>When using /C switch — instance of control class.
<cmd>Internal Autorun command.
<params>Command parameters (if applicable). Those parameters are sending as-is, so can be calculated on every command call.

Switches for setting mouse buttons

Switches specify the mouse button or scroll wheel. The switch is required and there can be only one; if more than one is specified, the latter will be applied.

ButtonModifierDescription
/R
/M
/L
/X1
/X2
NoneSets the right, middle, left and two additional mouse buttons. Trigger at the «down» state of a button.
:USame thing, but trigger at the «up» state of the button.
:DSame thing, but trigger at doubleclick of the button.
/WNoneSets the action on the rotation of the mouse wheel. Without modifiers it works on rotation in any direction.
:FThe same thing, but for rotation of the wheel forward (away from you).
:BThe same thing, but for rotation of the wheel backward (toward to you).

Switches for setting modifiers

/K:CThe action is performed when Ctrl is pressed.
SThe action is performed when Shift is pressed.
AThe action is performed when Alt is pressed.
RThe action is performed when right mouse button is pressed.
MThe action is performed when middle mouse button is pressed.
LThe action is performed when left mouse button is pressed.
X1The action is performed when first additional mouse button is pressed.
X2The action is performed when second additional mouse button is pressed.

Modifiers Ctrl, Shift, Alt can be used in any combination, for this you can set the switch several times. For example, /R /K:C /K:S will work as Ctrl+Shift-<right mouse button>. The remaining modifiers can only be used singly.

Additional switches

/B:<1..7>Bottom panel button. Used only with control index 17.
/H:<area>Sum of the flags of window zones. It is used only with control index 0. Possible <area> values in the table below.
/C:<class>Control class. With a given switch, a method of obtaining control that is different from the standard is used. The first parameter <instance> of command is used to specify an instance of the class.

:!: Use this method only if the desired control is not available through indexes.

:!: The method cannot be used to obtain an “active / inactive” control; the control is always fixed.

:!: When you change the appearance of the main window, the method may not work correctly (or even stop working) at previously configured values: depending on the visible window elements, class instance numbers may change.

Control indexes

0TC window. Can be used with switch /H:<area>.
1Left file list.
2Right file list.
3Active file list.
4Inactive file list.
5Left header.
6Right header.
7Left size panel.
8Right size panel.
9Left path panel.
10Right path panel.
11Left info panel. :!: Currently unavailable.
12Right info panel. :!: Currently unavailable.
13Left dropdown disk list.
14Right dropdown disk list.
15Left panel (available when tabs opened, near area).
16Right panel (available when tabs opened, near area).
17Bottom panel (with functional buttons).
18Left folder tree.
19Right folder tree.
20Commandline.
21Current directory panel.
22Inplace editor field.
23Panel splitter.
24Left drive panel.
25Right drive panel.
26Left tab panel.
27Right tab panel.
28Buttonbar.
29Vertical buttonbar.
10001Active header.
10002Inactive header.
10003Active size panel.
10004Inactive size panel.
10005Active path panel.
10006Inactive path panel.
10007Active info panel. :!: Currently unavailable.
10008Inactive info panel. :!: Currently unavailable.
10009Active dropdown disk list.
10010Inactive dropdown disk list.
10011Active panel.
10012Inactive panel.
10013Active folder tree.
10014Inactive folder tree.
10015Active drive panel.
10016Inactive drive panel.
10017Active tab panel.
10018Inactive tab panel.

List of window areas flags

Flags can be summarized. For example: 8 + 16 = 24, the action will be assigned to the minimize and maximize buttons.

1Client area.
2Window header.
4System menu.
8«Minimize» button.
16«Maximize» button.
32«Close» button.
64Main menu.
128Left border.
256Right border.
512Top border.
1024Top left corner.
2048Top right corner.
4096Bottom border.
8192Bottom left corner.
16384Bottom right corner.

Examples

# Author: Flasher
# Scroll on active tabs = move active tab left/right:  
ControlSetMouseAction /W:B 10017 SendCommand 3015 
ControlSetMouseAction /W:F 10017 SendCommand 3016 
# Alt+Scroll on active tabs = switch active tab:  
ControlSetMouseAction /W:F /K:A 10017 SendCommand 3005 
ControlSetMouseAction /W:B /K:A 10017 SendCommand 3006 
# Atl+RMB on active tabs = lock/unlock tab: 
ControlSetMouseAction /R /K:A 10017 SendCommand 3012 
# Shift+LMB on tabs = switch to first tab in correspondng panel: 
ControlSetMouseAction /L /K:S 26 SendCommand 5201 
ControlSetMouseAction /L /K:S 27 SendCommand 5301 
# Ctrl+RMB on tabs = configure custom columns: 
ControlSetMouseAction /R /K:C 5 SendCommand 483 
ControlSetMouseAction /R /K:C 6 SendCommand 483 
# Alt+RMB on active tabs = configure current custom columns: 
ControlSetMouseAction /R:U /K:A 10001 SendCommand 2920 
# Ctrl+RMB on file panel = disable sorting on corresponding panel: 
ControlSetMouseAction /R /K:C 1 SendCommand 125 
ControlSetMouseAction /R /K:C 2 SendCommand 225 
# Alt+RMB on file panel = inverse sorting on corresponding panel: 
ControlSetMouseAction /R /K:A 1 SendCommand 130 
ControlSetMouseAction /R /K:A 2 SendCommand 230 
# Alt+RMB on "active" drive panel = opening 'My Computer': 
ControlSetMouseAction /R /K:A 10015 SendCommand 2122 
# RMB on drive size panel = opening 'Desktop' on corresponding panel (32-bit version):  
ControlSetMouseAction /R /C:TMyPanel 2 CommandExec /CD :: 
ControlSetMouseAction /R /C:TMyPanel 1 CommandExec /CD "" :: 
# Alt+LMB on panel splitter = equal panels size: 
ControlSetMouseAction /L /K:A 23 SendCommand 909 

# Shift+MMB anywhere = switch to main toolbar, 
# where em_Bar has OPENBAR1 and %A in the Command: and Params:, correspondingly: 
ControlSetMouseAction /M:U /K:S 0 CommandExec em_Bar Default.bar
# Next two commands enable em_Lang, where OPENLANGUAGEFILE in the "Command:" field, %A in the "Params:" field: 
# RMB on main menu = update current localization: 
ControlSetMouseAction /R /H:64 0 CommandExec em_Lang %"IniRead('~/R', %COMMANDER_INI%, Configuration, LanguageIni)" 
# Alt+RMB on main menu = switch between Russian and English languages: 
ControlSetMouseAction /R /K:A /H:64 0 ShellExec '%COMMANDER_PATH%\Utils\TCFS2\TCFS2.exe' '/ef if(tcini(Configuration,LanguageIni,`WCMD_RUS.LNG`),tem(em_Lang),tem(`em_Lang Wcmd_rus.lng`))' 

# Commans below are just as ideas, require additional usercommands 
# Alt+LMB on tabs = save tabs to given file in corresponding panel: 
ControlSetMouseAction /L /K:A 26 CommandExec em_SaveTabsL 
ControlSetMouseAction /L /K:A 27 CommandExec em_SaveTabsR
# MMB on window title and title buttons = show additional info in the title: 
ControlSetMouseAction /M:U /H:62 0 CommandExec em_AddTitleInfo

Notes

Although the plugin was optimized for speed, due to the large number of intercepted and processed messages, it is recommended to minimize the number of installed handlers if possible. It is also recommended that the most frequently occurring events (for example, scrolling with the mouse wheel, left-click) be placed at the beginning.

Limitations

Minimal requirements: Autorun 2.0.11+, Total Commander 9.0+.

Under Windows 7, actions assigned to the mouse wheel do not block the default action for this control.

X1 / X2 buttons may not work (untested).

en/documentation/tweaks_controlsetmouseaction.txt · Последнее изменение: 2020/05/31 10:14 — loopback

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki