Spinbox increments multiplier

When using the mouse wheel while the cursor hovers the timecode display, the playhead moves by increments on 1 frame.

But if you press the Ctrl key while spinning the mouse wheel, the playhead will move by increments of 10 frames.

spinbox_increments

I find this VERY useful, and I wonder if that feature could be added to the spinboxes of the filters.

UWYFXjRr53

4 Likes

J’approuve totalement cette demande, c’est une fonction qui me manque énormément.
J’avais réussi à l’obtenir en modifiant un seul fichier (spinbox.qml), malheureusement depuis le passage à QT6 cela ne fonctionne plus.
C’est très utile, notamment pour tous les filtres qui disposent du réglage de taille et de position, cela permet d’effectuer une approche rapide en appuyant sur Ctrl puis d’affiner précisément en relâchant la touche.

I totally approve of this request, it is a feature that I miss a lot.
I had managed to get it by modifying a single file (spinbox.qml), unfortunately since switching to QT6 it no longer works.
This is very useful, especially for all filters that have size and position adjustment, it allows you to perform a rapid approach by pressing Ctrl and then fine-tune precisely by releasing the key.

3 Likes

I would vote for this too with great enthusiasm. In my view it would greatly enhance user experience in a lot of filters. +1

1 Like

OK, this is easy to do, and I agree.

--- src/qml/modules/Shotcut/Controls/DoubleSpinBox.qml
+++ src/qml/modules/Shotcut/Controls/DoubleSpinBox.qml
@@ -183,2 +183,9 @@ Item {
                     onClicked: contextMenu.popup()
+                    onWheel: wheel => {
+                        spinbox.stepSize = root.stepSize * _factor * (wheel.modifiers & Qt.ControlModifier ? 10 : 1);
+                        if (wheel.angleDelta.y > 0)
+                            spinbox.increase();
+                        else
+                            spinbox.decrease();
+                    }
                 }

5 Likes

Excellent, @shotcut. You did this in half the time it took me to make this video of my workaround using a simple Auto HotKey script … :wink: :upside_down_face:

This is how I made a very quick white border round a photo. The hotkey script simply clicks the mouse 10 times when you press CTRL+mouse (It also clicks the mouse 20 times when pressing CTRL + SHIFT + Mouse, and 40 times when pressing CTRL+SHIFT+ALT+MOUSE) but I didn’t use that in this demo.

Having this feature within SC will be amazing.

PS Here’s my AHK script…

SetKeyDelay, 30

 ^LButton::
 Send, {Click 10}
 Return

 ^+LButton::
 Send, {Click 20}
 Return

 ^+!LButton::
 Send, {Click 40}
 Return
1 Like

Bonjour,
Merci pour ce code.
Je viens de le tester, il met bien à jour les spinbox en fonction de la touche Ctrl mais le VUI n’est pas mis à jour.
J’ai du ajouter une ligne supplémentaire à la fin du “onWheel”.

Hi,
Thanks for this code.
I just tested it, it does update the spinboxes according to the Ctrl key but the VUI is not updated.
I had to add an extra line at the end of the “onWheel”.

onWheel: wheel => {
    spinbox.stepSize = root.stepSize * _factor * (wheel.modifiers & Qt.ControlModifier ? 10 : 1);
    if (wheel.angleDelta.y > 0)
        spinbox.increase();
    else
        spinbox.decrease();
    root.valueModified();
}
2 Likes

Thanks @Namna !

@shotcut and @Namna. Thank you. That’s great :+1:
@shotcut et @Namna. Merci. C’est super :+1:

Wow! This is great!
Thanks a lot @shotcut and @Namna :+1: :+1:

@jonray I should really try learn how to use Auto HotKey :slight_smile:

1 Like

@shotcut, @namna, I’ve just tried pasting this new code into the DoubleSpinBox QML file but it didn’t work.
How do I do this exactly please? Thanks.

@shotcut, @namna, je viens d’essayer de coller ce nouveau code dans le fichier QML DoubleSpinBox mais cela n’a pas fonctionné.
Comment faire exactement s’il vous plait ? Merci.

@jonray Here is the DoubleSpinBox file:
Le voici :
DoubleSpinBox.zip (2.2 KB)

1 Like

@SergeC Great, Thanks! :clap:

Works perfectly - thank you. Apologies, I should have realised that the new code goes after the “onClicked” line 183 - as indicated in @shotcut’s post… d’oh…

@shotcut, @namna, @SergeC – I don’t suppose it would be possible to amend the code further to have ctrl + shift + wheel to increment by 20 pixels as well?

@shotcut

To prevent this case:

  • Use wheel with ctrl on a spinbox
  • Then use keyUp or keyDown on the same spinbox

Step is always set to 10

We need to add a new line at the end of “onWheel”

onWheel: wheel => {
	spinbox.stepSize = root.stepSize * _factor * (wheel.modifiers & Qt.ControlModifier ? 10 : 1);
	if (wheel.angleDelta.y > 0)
		spinbox.increase();
	else
		spinbox.decrease();
	root.valueModified();
	spinbox.stepSize = root.stepSize * _factor;
}

1 Like

OK, I have a release candidate coming today that includes this change but with this minor bug fixed for the release.

1 Like

I just happened to badly mistreat my mousewheel when setting a large number keyframes for a SPR filter. Then I stumbled across this thread which will fulfill my unspoken wishes :slight_smile:
This is why I love Shoutcut - you guys rock!

1 Like