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.

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

Block Selection Commands

Item Selection Commands

Drag Selection Command

Quick copy Selection Command

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