Author Topic: [SUG][EDITOR] Editor Mouse + Modifier Controls  (Read 727 times)

0 Members and 1 Guest are viewing this topic.

Offline WillLem

  • Moderator
  • Posts: 3345
  • Unity isn't sameness, it's togetherness
    • View Profile
[SUG][EDITOR] Editor Mouse + Modifier Controls
« on: June 04, 2023, 08:48:29 PM »
I've always thought that it should be possible to scroll horizontally & vertically by combining modifier keys with the mousewheel, so this is now implemented as of commit 98bbcdc.

Ctrl + Mousewheel scrolls the level horizontally (when zoomed in)
Alt + Mousewheel scrolls the level vertically (again, when zoomed in)

This feature will be available in Editor 2.3, coming soon.



On a somewhat related note (and in case anyone missed the video showing this), it's also now possible to move pieces only-horizontally or only-vertically with the following:

i) Select the pieces you wish to move
ii) Press Ctri + Alt, then move the pieces, for horizontal-only movement (along the X axis)
or
ii) Press Ctrl + Shift, then move the pieces, for vertical-only movement (along the Y axis)

This feature is currently available (as of Editor 2.2)
« Last Edit: June 05, 2023, 12:44:26 AM by WillLem »

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Summary: Shift should make things go horizontally. At least Gimp and Firefox agree on this.



Your Alt means vertical scrolling for the mouse wheel, but horizontal movement for the dragging. Sounds more inconsistent than necessary.

The fundamental ideas are sound, let's see what other programs do.

Google Maps needs Ctrl+Wheel to zoom, and does nothing on wheel alone, even complains to the user that you should press Ctrl+Wheel to zoom. Probably because it's usually embedded in a webpage, and webpages have their rules for mousewheel. The restriction of being embedded in a browser trumps all other concerns, thus let's ignore Google Maps.

In Gimp:
  • Ctrl+Wheel zooms.
  • Wheel (without modifier keys) scrolls vertically.
  • Shift+Wheel scrolls horizontally.
  • Alt+Wheel seems to do nothing, but I'm not sure if this even gets through xfce4 to Gimp, see below.
In xfce4, my window manager, Alt+Wheel zooms the entire desktop, i.e., all windows become larger and I have to scroll around my desktop by moving the mouse. For me, this is a really dumb feature, but maybe it's useful for the sight-impaired. Anyway, I never accidentally press Alt+Wheel and it never annoys me.

It's possible that xfce4 eats the Alt+Wheel entirely and doesn't pass it on to Gimp. I haven't dug into the xfce4 config to remap Alt+Wheel.

In Firefox:
  • Ctrl+Wheel zooms.
  • Wheel (without modifier keys) scrolls vertically.
  • Shift+Wheel scrolls horizontally.
  • Alt+Wheel again seems to do nothing, but I can't test for sure.
Thus, at least between Gimp and Firefox, we have consistency: Shift always means horizontal action.

-- Simon

Offline WillLem

  • Moderator
  • Posts: 3345
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG][EDITOR] Editor Mouse + Modifier Controls
« Reply #2 on: June 05, 2023, 01:27:12 AM »
OK, maybe this discussion needs to be upgraded to a more general look at the Editor's mouse + key controls. Here's how they are currently (in Editor 2.2):

Modifier KeyMouse ActionResult if over piece(s)Result if over air
NoneLeft Button ClickSelect single pieceCancel selection
NoneLeft Button DragDrag piece(s)Select multiple pieces by dragging selection box
NoneRight Button ClickActivate drag-to-scrollActivate drag-to-scroll
NoneRight Button DragDrag-to-scrollDrag-to-scroll
NoneWheel UpZoom InZoom In
NoneWheel DownZoom OutZoom Out
NoneWheel ClickRemove piece(s) from selectionNothing
CtrlLeft Button ClickAdd/remove piece to/from current selectionNothing
CtrlLeft Button DragSelect multiple pieces by dragging selection boxSelect multiple pieces by dragging selection box
ShiftLeft Button ClickSelect/deselect single pieceCancel selection
AltLeft Button ClickInvert selection priorityCancel selection
Ctrl + ShiftLeft Button DragDrag pre-selected pieces verticallySelect multiple pieces by dragging selection box
Ctrl + AltLeft Button DragDrag pre-selected pieces horizontallySelect multiple pieces by dragging selection box

I wonder whether we could re-arrange the above so it's more comparative to other apps. Paint.net (image editor) also seems to be consistent with the examples given above by Simon:

Wheel = Vertical scroll
Ctrl + Wheel = Zoom In/Zoom Out
Shift + Wheel = Horizontal scroll
Wheel click = Drag-to-scroll

If we were to implement this note-for-note in the Editor, this would completely free up the right-mouse-button for performing the horizontal/drag actions without the need for multiple modifiers (i.e. Ctrl + Shift, Ctrl + Alt).

Here's what I propose:

Wheel = Vertical scroll (currently Zoom In/Out)
Ctrl + Wheel = Zoom In/Zoom Out (currently Zoom In/Out)
Shift + Wheel = Horizontal scroll (currently Zoom In/Out)
Wheel click = Drag-to-scroll (currently RMB)
RMB = Vertical drag (currently Ctrl + Shift + LMB)
Ctrl + RMB = Horizontal drag (currently Ctrl + Alt + LMB)

EDIT: My only reservation here is that Zoom In/Out tends to be used a lot more than Vertical scroll, so I actually feel like these two should be swapped. It would also mean that scrolling is kept to modifiers only for LMB, or drag-scrolling with the Wheel click

Thoughts?
« Last Edit: June 05, 2023, 01:47:44 AM by WillLem »

Online Proxima

  • Posts: 4562
    • View Profile
Re: [SUG][EDITOR] Editor Mouse + Modifier Controls
« Reply #3 on: June 05, 2023, 01:54:26 AM »
Wheel for zoom is vastly more useful than wheel for vertical scroll -- most levels are 160 pixels tall, which is less than a third of the vertical height of the window; even on the rare level that goes above this, one is more likely to want to zoom than scroll. And it's consistent with what the wheel does (by default) in the game. So that obviously shouldn't change.

Shift-wheel for horizontal scroll is okay. I wouldn't often want it, but there are some wide levels where it's handy to have a quick way to scroll across. I don't even have an objection to assigning shift-wheel to horizontal scroll while having nothing for vertical scroll. We're designing a Lemmings level editor, not a general image editor, so it doesn't have the same needs.

Horizontal-only and vertical-only drag are good features to have, but much too niche to give to the unmodified RMB, which ought to go to something the user will use often. The current assignation of RMB to drag-to-scroll is optimal and shouldn't be changed without a very good reason.

Do we have to restrict ourselves to ctrl, shift, alt as modifiers? Could holding down H or V while dragging be assigned to horizontal-only and vertical-only?

Offline WillLem

  • Moderator
  • Posts: 3345
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG][EDITOR] Editor Mouse + Modifier Controls
« Reply #4 on: June 05, 2023, 02:11:53 AM »
Wheel for zoom is vastly more useful than wheel for vertical scroll ... And it's consistent with what the wheel does (by default) in the game.

Agreed. I've edited the post with this comment - the same thing occurred to me after I posted.

while having nothing for vertical scroll

I disagree about it not having the same needs as an image editor tbh. A lot of editing is done zoomed-in, so even if the level isn't tall, there is still a case for a dedicated vertical scroll action being useful. Of course, we have the scrollbars, but my instinct here is the more options the merrier.

Horizontal-only and vertical-only drag are good features to have, but much too niche to give to the unmodified RMB, which ought to go to something the user will use often.

Can you give any suggestions as to what it could be used for?

The current assignation of RMB to drag-to-scroll is optimal and shouldn't be changed without a very good reason.

Yes, I'm hesitant about this as well. Perhaps we leave unmodified RMB as drag-to-scroll, and then have modified RMB as the horizontal/vertical drag modes?

Do we have to restrict ourselves to ctrl, shift, alt as modifiers? Could holding down H or V while dragging be assigned to horizontal-only and vertical-only?

I did try having X and Y as modifiers, but for some reason it won't work.
« Last Edit: June 05, 2023, 02:21:33 AM by WillLem »

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Re: [SUG][EDITOR] Editor Mouse + Modifier Controls
« Reply #5 on: June 05, 2023, 10:16:58 AM »
I too think: Zoom is far more common than vertical scrolling. Keep zoom on wheel, and vertical scrolling on Ctrl+wheel.

It's not 100 % clear-cut. Ctrl+wheel to zoom is so common, people might inadvetently hold Ctrl. You can add options for these combos when somebody complains.

-- Simon

Offline WillLem

  • Moderator
  • Posts: 3345
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG][EDITOR] Editor Mouse + Modifier Controls
« Reply #6 on: June 05, 2023, 03:38:31 PM »
You can add options for these combos

Yeah... ideally, the Editor would have fully-customisable hotkeys. If nothing else, it would encourage users to find out exactly what the Editor is capable of (for example, I didn't know priority invert was a thing until I started working on this).

Thing is though, implementing hotkey customisation is not easy and it's not something I want to take on by myself. If someone else who knows C# / MS Visual Studio wants to help me with it, let's make it happen.

Offline WillLem

  • Moderator
  • Posts: 3345
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG][EDITOR] Editor Mouse + Modifier Controls
« Reply #7 on: June 06, 2023, 02:30:44 PM »
OK, here's what I've decided to go with for now:

Unmodified Wheel = Zoom In/Out (as it is now)
Ctrl + Wheel = Horizontal-only scroll
Shift + Wheel = Vertical-only scroll*
Unmodified wheel click = Remove piece from selection (as it is now)

Unmodified Right-click = Drag-to-scroll (as it is now)
Ctrl + Right = Horizontal-only drag pieces
Shift + Right = Vertical-only drag pieces*

Unmodified Left-click = Drag to select / select pieces | Cancel selection (as it is now)
Ctrl + Left-click =  Add/remove pieces to/from selection | Cancel selection (as it is now)
Shift + Left-click = Add/remove pieces to/from selection | Cancel selection
Alt + Left-click = Invert priority (as it is now)



Eventually, I'd like to implement customisable hotkeys in the Editor, but this is a long way off. For now, I think the above is sufficient - most of the controls are the same as they are currently, and the new ones have single modifier keys rather than double.

*I decided to have shift for vertical movement since horizontal movement is more likely to be useful in the majority of cases, and Ctrl is a slightly easier key to reach for.
« Last Edit: June 06, 2023, 02:55:03 PM by WillLem »