====== ControlSetMouseAction ====== The command adds an action on mouse events in the Total Commander window. ControlSetMouseAction ] [/B:<1..7>] [params] ControlSetMouseAction ] [/B:<1..7>] /C: [params] **Parameters** |< 100% 15% >| ||Index of control, see table below.| ||When using /C switch --- instance of control class.| ||Internal Autorun command.| ||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. |< 100% 15% 10%>| ^Button^Modifier^Description^ |/R\\ /M\\ /L\\ /X1\\ /X2|None|Sets the right, middle, left and two additional mouse buttons. Trigger at the "down" state of a button.| |:::|:U|Same thing, but trigger at the "up" state of the button.| |:::|:D|Same thing, but trigger at doubleclick of the button.| |/W|None|Sets the action on the rotation of the mouse wheel. Without modifiers it works on rotation in any direction.| |:::|:F|The same thing, but for rotation of the wheel forward (away from you).| |:::|:B|The same thing, but for rotation of the wheel backward (toward to you).| **Switches for setting modifiers** |< 100% 15% >| |/K:|C|The action is performed when Ctrl is pressed.| |:::|S|The action is performed when Shift is pressed.| |:::|A|The action is performed when Alt is pressed.| |:::|R|The action is performed when right mouse button is pressed.| |:::|M|The action is performed when middle mouse button is pressed.| |:::|L|The action is performed when left mouse button is pressed.| |:::|X1|The action is performed when first additional mouse button is pressed.| |:::|X2|The 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-. The remaining modifiers can only be used singly. **Additional switches** |< 100% 15% >| |/B:<1..7>|Bottom panel button. Used only with control index 17.| |/H:|Sum of the flags of window zones. It is used only with control index 0. Possible values in the table below.| |/C:|Control class. With a given switch, a method of obtaining control that is different from the standard is used. The first parameter ** ** 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** {{tc_window_index_en.png|}} |0|TC window. Can be used with switch /H:.| |1|Left file list.| |2|Right file list.| |3|Active file list.| |4|Inactive file list.| |5|Left header.| |6|Right header.| |7|Left size panel.| |8|Right size panel.| |9|Left path panel.| |10|Right path panel.| |11|Left info panel. :!: Currently unavailable.| |12|Right info panel. :!: Currently unavailable.| |13|Left dropdown disk list.| |14|Right dropdown disk list.| |15|Left panel (available when tabs opened, near area).| |16|Right panel (available when tabs opened, near area).| |17|Bottom panel (with functional buttons).| |18|Left folder tree.| |19|Right folder tree.| |20|Commandline.| |21|Current directory panel.| |22|Inplace editor field.| |23|Panel splitter.| |24|Left drive panel.| |25|Right drive panel.| |26|Left tab panel.| |27|Right tab panel.| |28|Buttonbar.| |29|Vertical buttonbar.| |10001|Active header.| |10002|Inactive header.| |10003|Active size panel.| |10004|Inactive size panel.| |10005|Active path panel.| |10006|Inactive path panel.| |10007|Active info panel. :!: Currently unavailable.| |10008|Inactive info panel. :!: Currently unavailable.| |10009|Active dropdown disk list.| |10010|Inactive dropdown disk list.| |10011|Active panel.| |10012|Inactive panel.| |10013|Active folder tree.| |10014|Inactive folder tree.| |10015|Active drive panel.| |10016|Inactive drive panel.| |10017|Active tab panel.| |10018|Inactive 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. |1|Client area.| |2|Window header.| |4|System menu.| |8|"Minimize" button.| |16|"Maximize" button.| |32|"Close" button.| |64|Main menu.| |128|Left border.| |256|Right border.| |512|Top border.| |1024|Top left corner.| |2048|Top right corner.| |4096|Bottom border.| |8192|Bottom left corner.| |16384|Bottom 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).