andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 38 forks source link

Using mouse for rectangular selection #109

Closed vi closed 11 years ago

vi commented 11 years ago

I think selecting using mouse with Alt and Shift being hold should do rectanglar selection.

In old enki you could do the trick by selecting with mouse, than pressing any of rectangular select commands (so existing selectiong "converts" to rectangular, like in Vim), but in qutepart enki this does not work yet.

andreikop commented 11 years ago

I pushed version, in which you can select with mouse, when Ctrl+Alt is held. If Alt or Alt+Shift is pressed and mouse is moved, my DE (Mate) moves the window.

Using Shift+Alt for keyboard selection and Ctrl+Alt for mouse selection is not intuitive. vi, what do you think about it?

vi commented 11 years ago

I would prefer Alt+Shift+Mouse (or both Ctrl+Shift and Alt+Shift). As with other keyboard things, it should be configurable (so we'll think about "what will be the default" instead "what will it be").

Is Alt+Shift+mouse a standard window moving gesture across various DEs? It yes then it can be Ctrl+Alt (what about also changing rectangular selection by keyboard to Ctrl+Alt+arrows?). If it's only for Mate then a message can be displayed to user when it presses "Alt+Shift" like "Alt+Shift is for rectangular selection. If you window manager interferes with Alt+Shift, use Control+Alt".

BTW how user expected to find out about rectangular selection at all? Primarily by documentation or by experimentation?

andreikop commented 11 years ago

Good idea about both! I implemented 3 variants: Alt, Alt+Shift, Alt+Control. At least one should work

BTW how user expected to find out about rectangular selection at all? Primarily by documentation or by experimentation?

I don't know. Both ways are possible. Do you have ideas how to make a user to know it?

vi commented 11 years ago

Thinking about ideas...

Primary method: main menu, which should cover all functions and all keys. User sees Alt+Shift+arrows for rectangular selection using keyboard, tries it, considers Alt+Shift as "Rectangular combo" and tries it with mouse. (optionally seeing message "Please use Ctrl+Alt for this"). /* I don't like the idea of short main menu... I think for a power user the main menu is basically for learning about the program features and hotkeys, then for rarely used actions. After using the program for a while, main menu can be just hidden (shown again when pressing "Alt"). */

Heuristical method: Enki monitors what user is doing with the text. If there are periodic actions, like "Down,Backspace,Backspace,Down,Backspace,Backspace" or "Select 10 characters using mouse, Delete, Select 10 characters on the next line, Delete", Enki shows suggestion about using rectangular selection.

andreikop commented 11 years ago

I'm thinking about something like vimtutor.