IDE Window: Editor Options Mouse

This is an old revision of IDE Window: Editor Options Mouse, edited by Martin at . The current revision is 60644.

/* Selection Commands */

The Context Tree

The context tree is the Treeview just left to the Overview Grid. It currently has the entries:

You can define the behaviour of the Mouse-Buttons, dependent on the Context. E.g. clicking "selected text" may have a different action, than clicking unselected text.

If a Node for a specific context exists, it will use it's parents as fallback. E.g. If you click on "selected text", the configuration of the Selection node is searched first. If it has no action for your click, the parent node General is searched. (By default this is used to assign "drag selected text" to the left button)

The Gutter node is a top level node, that does have no fall-back. But the Fold... nodes do fall back on there parents.

The Click Configuration

When you click a mouse button, the following items are checked to find the desired behaviour/action.

The Button

There are individual settings for the Left, Right and Middle mouse Button

The Click Type

There are individual settings for Single, Double, Triple or Quad clicks.

Please make sure you read the section on Double to Quad Clicks

There also is a setting Any, which means the action is executed for any of the clicks. That would mean that a double click would execute the action twice. Or if the first part of the double-click changed the state of the object, the 2nd part would apply to the new state.

The left button on the code fold part is configured as Any. Each click will toggle between folded and unfolded. Therefore a double click will revert the action of the first.

Without the Any setting, if you accidentally folded the wrong node, you would have to wait before you could click again to unfold it. (Because a quick 2nd click would count as double click, which wouldn't be matched by Single)

Notes:

The Click Direction

A mouse click consists of a mouse-down and a mouse-up.

Actions can be configured to happen on either of those 2 events.

You can assign 2 different actions to the 2 events of the same click. They will be executed in the order of the events. However keep in mind that such a configuration may limit the action of the mouse-down event.

Notes:

The Modifier Keys

Mouse behaviour can be modified by holding the Shift, Alt or Ctrl key (or combinations of them)

At the time of the click-down or up the state of all three keys is checked. An action can be defined to:

For a given combination of Button, Click-Type, Click-Direction there must not be any ambiguity for the modifier keys. Example

Now if you do this click, with both of Shift and Ctrl pressed, it would be unclear which of the 2 settings to use

There is one exception from this rule. If all modifier keys are set to be ignored, the entry becomes the fall-back for the button, click-type, click-dir configuration. This is, if no configuration is found which has at least one modifier key required either pressed or un-pressed, then the fallback will be used.

Note:

e.g. Dragging uses "ctrl" to copy the dragged text instead of moving it. However the use of "ctrl" for copy indication is during mouse move, so you can set start dragging to rely on any other Modifier key. It is however recommended to set Ctrl to greyed, so you can start dragging with the key pressed or un-pressed.

This is different to using "alt" (or others) for column mode selection: Here the decision is made only at the time of click. Later changes of the "alt" key during mouse-move do not change the selection mode.

The Action / Behaviour

Each mouse button event as defined above, can trigger some action. The same action can be assigned to more than one event. (IF 2 events have the same behaviour, then there modifier keys are not checked for ambiguity)

With each action you can define, if you whish the caret to be moved. However this only additionally enforces the the caret move. If an action implicitly moves the caret, then this will happen, even if you uncheck the this box. (e.g. Selecting a block always moves the caret)

Some commands take additional params to refine there behaviour

No Action Command

There are 2 uses for this:

With "Move Caret" it will set the caret to the mouse location. This will unset an existing selection. It also prevents a new selection from being marked by moving the mouse.
If it occurs on down then the caret will be set to the location the mouse was pressed, never mind where you release the button

In Context-Subnodes this can prevent a click from executing the parent node(s) action.
E.g. this is assigned to the FoldTree. It catches clicks that are neither on a [+] or [-] node. Otherwise they fall through to the normal Gutter and toggle a breakpoint.

Selection Commands

Some events that occur on mouse down events implicitly assign a mouse up action for the current click.
E.g. dragging implicitly drops (inserts) the text when the button is released

If any configured action is assigned to the mouse up, then the implicit action is performed first, the configured action is performed second.

Block Selection Commands

There are 3 Selection commands, for the 3 selection modes supported by SynEdit: Normal, Column or Full-Lines.

Note: All of them move the caret implicitly.

Each of those can be configured in 2 different Modes:

Starts a new selection . If an old selection exists, it will be disregarded. The new Selections starts at the current mouse location.

If an old selection exists, then it will be extend.
If there was no selection, then a new selection is created, which will start at the position the caret had before the event occurred, and range to the click position.

Those events should be assigned to mouse down events, in which case the selection will resize with any following mouse-movement until the mouse button is released.

"Begin-Mode" on mouse up does nothing, but setting the caret. (Except currently for line mode, which selects the line).
"Continue-Mode" on mouse up will extend the selection

Item Selection Commands

Allow to select the Word, Line or Paragraph at the mouse position. Once selected the selection will not extend, if the mouse moves.

"Line" supports 2 modes, either including leading/trailing spaces of the line or not.

Note: All of them move the caret implicitly.

Drag Selection Command

Drags (Copies or moves) the current selection to a new position, following mouse movement. It will be pasted there if the button is released.

Independent of the modifier keys pressed at the time of the event occurring (or the configured mod, keys), it will check for the ctrl key at the time the dragged text is inserted. If Ctrl is pressed the text will be copied, otherwise moved.

Note: moves the caret implicitly.

Quick copy Selection Command

Inserts a copy of the currently selected text at the mouse location. If no text is selected, inserts the content of the clipboard.

Note: moves the caret implicitly.

Context Popup Menu

Fold Commands

Fold/Unfold Commands

Fold Popup Menu

Breakpoint Command

Double to Quad Clicks

If you assign actions to double and triple click, you should aware that they always trigger the lesser clicks too.

This is: Doing a Triple-Click will first do a Single-Click (down and up) with the same Modifier Keys (none, shift, alt, ...), then a double click, then the triple. (At the time of the first click, SynEdit does not know there will be more clicks)

You should therefore take care of the actions assigned to those clicks.

Current Limitations

Useful Examples