Skip to content

Conversation

@yohannd1
Copy link

@yohannd1 yohannd1 commented Jan 9, 2026

This PR adds the ability to pan through the workspace without having to click on the background. At the moment, the trigger I have used for this is the key combo Ctrl+Alt, which might not be ideal, but it was the most unique modifier combination I could think of.

vid.mp4
  • 0:00 to 0:09 is the intended behavior.
  • 0:12 shows a bug that appeared upon implementing this. Normal drag (no modifiers, just drag the background) works fine, but what I think is the first move mouse event is being handled in correctly, always resulting in a diagonal shift down-left.
  • 0:16 is a "friendly" bug that does nothing, but is still confusing so I will try to fix it - you can begin the pan in any state, including when a window is maximized. I didn't show in the video but you can also begin it from the sidebar and the top bar.

Feedback is very welcome! I want to see if other people would have their workflow improved by being able to do this. I believe mine will.

Progress:

  • Initial implementation
  • Change keybinding: Ctrl+Alt -> Alt+S
  • Fix offset bug (at 0:12 in the video)
  • Add checks to prevent dragging in odd situations (at 0:16 in the video)
  • Indicate more clearly when this action is happening (maybe show an indicator somewhere saying "pan-anywhere activated")
  • Fix bug : panning without the keybinding, finishing and then trying to drag a widget is causing weird issues. Usually it tries to resize the widget.

@yohannd1 yohannd1 changed the title Workspace dragging with Ctrl+Alt "Universal" workspace panning with Ctrl+Alt Jan 9, 2026
Copy link
Contributor

@szeli1 szeli1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern with this PR is that it looks like to me that other "ctrl + alt" mouse shortcuts may not work because of the event filter. I did not test this PR.
Here is some code that may be effected:
AutomationEditor:

}
else if( we->modifiers() & Qt::ControlModifier && we->modifiers() & Qt::AltModifier )
{

ClipView:

bool ClipView::unquantizedModHeld( QMouseEvent * me )
{
	return me->modifiers() & Qt::ControlModifier || me->modifiers() & Qt::AltModifier;
}

PianoRoll:

void PianoRoll::dragNotes(int x, int y, bool alt, bool shift, bool ctrl)


#include <QApplication>
#include <QCloseEvent>
#include <QDebug> // TODO: remove
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include <QDebug> // TODO: remove

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove this right before I remove the draft state. I'm using it for debugging some things :)

@yohannd1 yohannd1 changed the title "Universal" workspace panning with Ctrl+Alt "Universal" workspace panning Jan 9, 2026
@yohannd1
Copy link
Author

yohannd1 commented Jan 9, 2026

Changed the keybinding to Alt+S, which (as discussed on discord) is not perfect. I'm hoping to find a better keybinding in the future but for now I'm leaving this one, which I believe doesn't have any conflicts.

Also a note to self: adding the keybinding handling on the event filter is sadly necessary, as when it is pressed I have to prevent it from being forwarded to other elements. I tried implementing it with key{Press,Release}Event and it was a mess.

@szeli1
Copy link
Contributor

szeli1 commented Jan 11, 2026

Also a note to self: adding the keybinding handling on the event filter is sadly necessary, as when it is pressed I have to prevent it from being forwarded to other elements. I tried implementing it with key{Press,Release}Event and it was a mess.

If I remember correctly, there are other options like implementing it in MainWindow::KeyPressEvent, or by using QAction with a shortcut in MainWindow, but event filter may be the best option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants