Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mouse scroll wheel not working #362

Open
n4ogw opened this issue Jul 8, 2024 · 1 comment
Open

mouse scroll wheel not working #362

n4ogw opened this issue Jul 8, 2024 · 1 comment

Comments

@n4ogw
Copy link

n4ogw commented Jul 8, 2024

The mouse scroll wheel isn't working to adjust the frequency or rotator position. To receive mouse wheel events one needs to enable the #GDK_SCROLL_MASK mask.


diff --git a/src/gtk-freq-knob.c b/src/gtk-freq-knob.c
index 9225acc..cab21de 100644
--- a/src/gtk-freq-knob.c
+++ b/src/gtk-freq-knob.c
@@ -358,6 +358,7 @@ GtkWidget      *gtk_freq_knob_new(gdouble val, gboolean buttons)
             g_signal_connect(knob->evtbox[i],
                              "button_press_event", (GCallback) on_button_press,
                              widget);
+           gtk_widget_add_events(GTK_WIDGET(knob->evtbox[i]), GDK_SCROLL_MASK);
             g_signal_connect(knob->evtbox[i], "scroll_event",
                              (GCallback) on_button_scroll, widget);
 

diff --git a/src/gtk-rot-knob.c b/src/gtk-rot-knob.c
index a7d0771..25f52cd 100644
--- a/src/gtk-rot-knob.c
+++ b/src/gtk-rot-knob.c
@@ -528,6 +528,7 @@ GtkWidget      *gtk_rot_knob_new(gdouble min, gdouble max, gdouble val)
 
         g_signal_connect(knob->evtbox[i], "button_press_event",
                          (GCallback) on_button_press, widget);
+       gtk_widget_add_events(GTK_WIDGET(knob->evtbox[i]), GDK_SCROLL_MASK);
         g_signal_connect(knob->evtbox[i], "scroll_event",
                          (GCallback) on_button_scroll, widget);
 
@csete
Copy link
Owner

csete commented Sep 17, 2024

I will include this enhancement, thanks!

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

No branches or pull requests

2 participants