WinPTE.com

 

Mouse Operations

Overview

WinPTE offers a full complement of mouse selections and drag/drop editing including the drag/drop replace mode that allows you to drop a selection on top of a word, a bracket or a quote and have that selection replace the word, bracketed expression or contents or quoted string or contents.

Mouse drag/drop and selections do not prevent other operations or keys from occurring in their midst. This allows you to start a drag operation and then navigate using the keyboard even another file for the actual drop or replace operation. It also allows you to use keys that perform editing operations while dragging. It could be useful if you start to drag an identifier with the intention of dropping it with drag/drop replace on another line, only to realize when you are at the destination line that you want to keep the original copy of the line too. No problem, keep the left button down to stay in drag mode and hit Alt+A (duplicate a line). Now you have two copies one of which can be used as the drop target.

Similarly, you can switch files while dragging (F6 or Ctrl+Shift+F6 go to next file, Shift+F6 or Ctrl+F6 go to previous file) and pick a drop target in the new file, all without having to let go of the mouse. Granted, some key combinations are not practical while one hand is busy holding down the left button, but the functionality is there nevertheless.

Selections

In general selecting text with the mouse will create a character selection if the selection spans one line and switch to line selection when the selection spans more than one line. Mouse selection can also me modified using Ctrl and Shift modifier keys. If column selection mode is turned on (Column/Column Selection menu item) then mouse selection without any modifier keys will be a column selection.

Column Selection mode is a macro based flag whose value causes all selection macros definitions, including the mouse handling macros, to modify the type of selection created. It is not a "hard-wired" application mode that forces interpretation of all selections to be "column" selections. So it is possible to have column selections without having "Column Selection" mode turned on and to have non-column selections when the mode is turned on.

Shift Modifier

Shift key by itself is used to extend the current selection and must be held down before the left mouse button is pressed. If there is no current selection then a new selection will be from the cursor position to the position where the left button was clicked. The shift key by itself has no effect after the left mouse button is pressed and can be released.

Ctrl Modifier

New: Ctrl key held down then pressing the left mouse button will make the left mouse button perform a double click operation using the rest of the modifier keys if the click occurs outside of a selection. Clicking inside is assumed to be followed by a drag so the double click shortcut is suppressed.

Pressing the Ctrl key after the left button is held down during selection is used to force selection type to character type whether spanning multiple lines or if column selection mode is turned on.

Ctrl+Shift Modifier

New: Ctrl+Shift key held down then pressing the left mouse button will make the left mouse button perform a double click operation using the rest of the modifier keys. Hence, Ctrl+Shift will perform the same operation as a double click with the Shift pressed. This will select all characters from the clicked character position to the end of line. Does nothing if the clicked position is after the current line's end of line.

Ctrl+Shift pressed after the left mouse button is held down during selection will have the effect of changing the selection type to opposite of the current Column Selection mode. If Column Selection mode is on then the selection will be character or line depending on whether it spans multiple lines, if current Column Selection mode is off then the selection will be a column selection.

Switching into Column Selection mode is only required if you are going to be making repetitive column selections. For an occasional column mode selection it is easier to leave column selection mode turned off and just use the Ctrl+Shift modifier keys while selecting.

Double Click

Double clicking on a word will select the word. Double clicking on an opening or closing bracket () [] {} will select all text between matching brackets and the brackets themselves. Double clicking on an opening or closing single, double or back quote will select the quoted string and the quotes.

Note: Only quotes that are defined as quoting operators for the file type being edited will be recognized unless they occur in comments in which case all quotes will be recognized for automatic double click selection.

Alt+Double Click

Alt+Double Click will reduce the size of the selection depending on whether it is selecting a word, brackets or quotes. For word selections Alt modifier key will select a part of the word delimited by Alternating Caps or non-alphanumeric characters (an underscore for example). This is useful for selecting a part of an identifier when word separators in identifiers are either capital letters if using the Camel Hump naming convention or the traditional underscore.

For bracketed and quoted selections the Alt modifier key will exclude the brackets or quotes from the selection and select only the text contained in between:

Example:

 

Double Click: on word, open bracket or quote.

Drag & Drop with a twist: Drag/Replace Mode

WinPTE offers a full complement of drag/drop editing capability. The operation performed depends on the type of selection, context of where the drop is being performed and on the Alt, Ctrl, Shift modifier keys. Ctrl or Shift modifiers held down by themselves will perform the standard copy or move operation respectively. Use these if you want the standard Windows drag/drop functionality only.

The mouse cursor will provide visual feedback to the type of operation. Additionally if the drop operation will replace text then the text replaced will be shown in an alternate selection color as the selection is being dragged so there is no guesswork in what you are going to be replacing. It is highly recommended that you experiment with this powerful functionality otherwise you may be missing out on a quick way to edit your files without resorting to the keyboard.

Mouse Cursor
Operation
Move, the dragged selection will be moved to the dragged location.
Copy, the dragged selection will be copied to the dragged location.
Replace, the dragged selection will replace the selected text (see Character Selection drag/Drop below)
Overlay, applies to column selections only and will "stamp" the dragged selection's text at the dropped location. The affected area is shown as you drag so you will know what will be modified when you release the left mouse button.
Transfer, applies to column selection only and will "stamp" the dragged selection's text at the dropped location and fill the dragged selection with spaces. This has the effect of peeling away text from the drag source.
No operation. No operation can be performed at the current location because of conflicts between the source selection and destination location or the destination selection.

Character Selection Drag/Drop

Drag/Drop with no modifier keys will perform either a copy, a replace word, replace matching brackets or quoted string depending on where the drop is done. In all replace cases the display will reflect what the dropped selection is going to replace while you drag.

Drop done on:

Note: Only quotes that are defined as quoting operators for the file type being edited will be recognized for automatic drop replacement. The exception is in comments in where all quotes will be recognized for automatic selection.

Example:

 

Drag/Drop/Replace Character mark on: word, open bracket or quote.

Alt Modifier for Character Selections

The Alt Modifier key for drag and drop will reduce size of the replaced text similar to the reduction done by Alt+Double Click selection. Drop done on:

Ctrl Modifier

Held down by itself will perform a copy operation

Shift Modifier

Held down by itself will perform a move operation

Ctrl+Shift Modifiers

Will select the replacement text from the dragged to position to the last non blank character of the line. If the dragged to position is after the last non blank of line then a will select from first to last non blank.

Ctrl+Shift+Alt Modifiers

Will select the replacement text from the dragged to position to the first non blank character of the line. If the dragged to position is before the last non blank of line then will select from first to last non blank.

Here is an animation of the Ctrl+Shift+Alt selection followed by Ctrl+Shift+Alt drag/drop replace

Ctrl+Alt Modifiers

Will allow you to select arbitrary text to replace with the dropped selection. The text selected will start at the location where the Ctrl+Alt modifiers were first pressed to the currently dragged mouse cursor. Releasing the left button with the modifier keys held down will replace the selected text with the dragged selection. This is not needed often because the default drag/drop/replace offers a robust set of automatic context based selections, but when automatic does not meet your needs you can always fall back on this mode to select the text you want replaced.

Line Selection Drag/Drop

Drag/Drop with no modifier keys will perform a copy operation. The Alt modifier key is not used while dragging line selections and is ignored.

Ctrl Modifier

Held down by itself will perform a copy operation same as drag with no modifier keys.

Shift Modifier

Held down by itself will perform a move operation.

Ctrl+Shift Modifiers

New Will select the lines to replace from the line to the end of "Paragraph". Each language template can define what is a paragraph in the context of its file types. By default it is a block of lines separated by blank lines. In C/C++ based language templates (C++, Java, c#, perl) a paragraph is a statement terminated by a ; or a compound block or a block of blank and comment lines.

Ctrl+Shift+Alt Modifiers

New Does the same replacement as with the Ctrl+Shift modifiers but will exclude the top and bottom lines of the Ctrl+Shift Modifier selection. This is useful for C/C++ based languages when dropping a block of lines on a compound block statement to remove the { } from the replacement selection.

Ctrl+Alt Modifiers

Will allow you to select arbitrary lines to replace with the dropped selection. The lines selected will start at the location where the Ctrl+Alt modifiers were first pressed to the currently dragged mouse cursor line. Releasing the left button with the modifier keys held down will replace the selected lines with the dragged selection. This is useful when you want to replace a block of code with another block of code. The lines being selected for replacement are highlighted as you move the mouse.

Column Selection Drag/Drop

Drag/Drop with no modifier keys will perform a copy operation. The Alt modifier key is used to select the Overlay and Alt+Shift Transfer column selection operations.

Ctrl Modifier

Held down by itself will perform a copy operation same as drag with no modifier keys.

Shift or Ctrl+Shift Modifiers

Held down by itself or in combination with Ctrl will perform a move operation.

Alt Modifier for Column Selections

The Alt Modifier key will select the overlay operation. The text of the dragged selection will be overlaid on top of the dropped location. This is similar to overtype mode used during typing where the new characters replace instead of insert into the cursor location.

Text at the drop location that will be affected by the operation will be highlighted so you can align the drop exactly where you want it to be.

Alt+Shift Modifiers for Column Selections

The Alt+Shift modifier keys will select the transfer operation. The text of the dragged selection will be overlaid on top of the dropped location and the source selection will be filled with spaces. This is similar to the overlay operation except text is removed from the source location. This allows you shift the source selection to another location without affecting the column position of text outside the selection at either the source or the destination locations.

Text at the drop location that will be affected by the operation will be highlighted so you can align the drop exactly where you want it to be.

NOTE: The Ctrl modifier key is ignored if the Alt key is held down for column selection drag operations.

Ctrl and Ctrl+Shift Right Click - User Macro Execution

Additionally, you can assign a macro to be executed on a Ctrl Right Click or Ctrl+Shift Right Click. This is a powerful facility that you can use when automated text modification is not practical but the same operation needs to be performed many times. In this case you can assign a macro to the Ctrl Right Click and/or the Ctrl+Shift counterpart and click away.

The Ctrl key modifier has to be held down when the right mouse button is pressed, otherwise the standard context menu will be displayed.

The macro assigned to the right click combination will be run when the right mouse button is released. Dragging with the right button pressed simply moves the cursor to the newly dragged position. This allows you to place the cursor in an exact position before releasing the button and running the macro.

NOTE: The operation performed will be selected based on the state of the Ctrl and Shift modifiers at the time when the right button is released. If the Ctrl key is released then no operation will be performed. The caption of the macro that will be executed is displayed in the status bar and is updated to reflect the what macro will be run when the right mouse button is released.

Configuring the Ctrl and Ctrl+Shift Right Click

The configuration of the Right click macros is available through a Shift Right Click context menu.

Assigning Macros to run on Right Click

Assignment of the macro is done by selecting items from the Assign Ctrl+Right Click or Assign Ctrl+Shift+Right Click sub-menus.

 

The Split Line and Split Line Extra correspond to the operation of Alt+S and Alt+Shift+S keys in the default configuration and are always available. The rest are user assignable and are disabled if not defined. You can record any sequence of either printable keys or macro keys for the user defined macros.

Selecting an entry from the sub-menu will assign the macro to execute on the corresponding right click operation.

Recording a new macro for Right Click Operations

To record a new user defined macro for use by the right click operations select one of the items from the Define Macro sub-menu

You will be prompted to enter a name for the macro which will be used as the caption for the macro in the menus. After pressing OK in the dialog WinPTE will be in record mode. Any keys hit will perform their assigned operation and added to the recorded macro. Clicking the right mouse button will end record mode. Additionally if you hit ESC then record mode will be aborted without saving any changes to the partially recorded macro.

Once you have recorded the macro you can assign it to either the Ctrl or Ctrl+Shift right click combination by selecting it from the Assign sub-menu.

Printable keys are grouped into strings that will result in text being typed into the file when the macro is run. Non printable keys will execute the function assigned to the key when the macro is run.

The recorded macro is stored as text and is limited to 4000 printable characters or about 400 non-printable keys.

Manually Executing a Right Click User Macro

You can manually execute any of the recorded user macros by selecting the macro from the Run sub-menu.

 

 

 

Site Map | Privacy Policy | Contact Us | ©2004 Winpte.com