ScrollView - issues with mouse wheel
on_scroll_move isn't triggered with mouse wheel e.g. in scrollview.py:
def on_scroll_move(self, touch):
print self.scroll_y
...
then on_scroll_stop isn't triggered when scroll_y == 0 and scroll_y == 1, again try with print e.g.
def on_scroll_stop(self, touch, check_children=True):
print self.scroll_y
...
I think on_scroll_start works as it should, but it would be a good idea to check it too from pc perspective.
However both issues with the wheel aren't present with a simple touch, because scrollview is based on touch probably with touch devices in mind, but the mouse wheel was somehow forgotten.
Interresting, which platform are you on? For me on linux for me with sdl2, on current master, i do get an on_scroll_stop event for each time i scroll, and i do get dispatching when i get to 1.0 or 0.0 (which for some reason displays at -0.0).
edited the example (see diff)
--- a/kivy/uix/scrollview.py
+++ b/kivy/uix/scrollview.py
@@ -1113,6 +1113,10 @@ if __name__ == '__main__':
from kivy.uix.gridlayout import GridLayout
from kivy.uix.button import Button
+ from functools import partial
+
+ def spprint(event, sv, *arg):
+ print event, sv.scroll_y
class ScrollViewApp(App):
@@ -1126,6 +1130,8 @@ if __name__ == '__main__':
layout1.add_widget(btn)
scrollview1 = ScrollView(bar_width='2dp')
scrollview1.add_widget(layout1)
+ scrollview1.bind(on_scroll_move=partial(spprint, 'move'))
+ scrollview1.bind(on_scroll_stop=partial(spprint, 'stop'))
layout2 = GridLayout(cols=4, spacing=10, size_hint=(None, None))
layout2.bind(minimum_height=layout2.setter('height'),
and when i scroll on my laptop, using either method of mousewheel emulation, i get output like:
stop 0.959183673469
stop 0.959183673469
stop 0.918367346939
stop 0.918367346939
stop 0.877551020408
stop 0.877551020408
stop 0.836734693878
stop 0.836734693878
stop 0.795918367347
stop 0.795918367347
stop 0.755102040816
stop 0.755102040816
stop 0.714285714286
stop 0.714285714286
stop 0.673469387755
stop 0.673469387755
stop 0.714285714286
stop 0.714285714286
stop 0.755102040816
stop 0.755102040816
stop 0.795918367347
stop 0.795918367347
stop 0.836734693878
stop 0.836734693878
stop 0.877551020408
stop 0.877551020408
stop 0.918367346939
stop 0.918367346939
stop 0.959183673469
stop 0.959183673469
stop 1.0
stop 1.0
stop 0.959183673469
stop 0.959183673469
stop 0.918367346939
stop 0.918367346939
stop 0.877551020408
stop 0.877551020408
stop 0.836734693878
stop 0.836734693878
stop 0.795918367347
stop 0.795918367347
stop 0.755102040816
stop 0.755102040816
stop 0.714285714286
stop 0.714285714286
stop 0.673469387755
stop 0.673469387755
stop 0.632653061224
stop 0.632653061224
stop 0.591836734694
stop 0.591836734694
stop 0.551020408163
stop 0.551020408163
stop 0.510204081633
stop 0.510204081633
stop 0.469387755102
stop 0.469387755102
stop 0.428571428571
stop 0.428571428571
stop 0.387755102041
stop 0.387755102041
stop 0.34693877551
stop 0.34693877551
stop 0.30612244898
stop 0.30612244898
stop 0.265306122449
stop 0.265306122449
stop 0.224489795918
stop 0.224489795918
stop 0.183673469388
stop 0.183673469388
stop 0.142857142857
stop 0.142857142857
stop 0.102040816327
stop 0.102040816327
stop 0.0612244897959
stop 0.0612244897959
stop 0.0204081632653
stop 0.0204081632653
stop -0.0
stop -0.0
stop 0.0408163265306
stop 0.0408163265306
stop 0.0816326530612
stop 0.0816326530612
stop 0.122448979592
stop 0.122448979592
stop 0.163265306122
stop 0.163265306122
stop 0.204081632653
stop 0.204081632653
stop 0.244897959184
stop 0.244897959184
stop 0.285714285714
stop 0.285714285714
stop 0.326530612245
stop 0.326530612245
stop 0.367346938776
stop 0.367346938776
stop 0.408163265306
stop 0.408163265306
stop 0.448979591837
stop 0.448979591837
stop 0.489795918367
stop 0.489795918367
stop 0.530612244898
stop 0.530612244898
stop 0.571428571429
stop 0.571428571429
stop 0.612244897959
stop 0.612244897959
stop 0.65306122449
stop 0.65306122449
stop 0.69387755102
stop 0.69387755102
stop 0.734693877551
stop 0.734693877551
stop 0.775510204082
stop 0.775510204082
stop 0.816326530612
stop 0.816326530612
stop 0.857142857143
stop 0.857142857143
stop 0.897959183673
stop 0.897959183673
stop 0.938775510204
stop 0.938775510204
stop 0.979591836735
stop 0.979591836735
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 1.0
stop 0.959183673469
stop 0.959183673469
stop 0.918367346939
stop 0.918367346939
stop 0.877551020408
stop 0.877551020408
stop 0.836734693878
stop 0.836734693878
stop 0.795918367347
stop 0.795918367347
stop 0.755102040816
stop 0.755102040816
stop 0.714285714286
stop 0.714285714286
stop 0.673469387755
stop 0.673469387755
stop 0.714285714286
stop 0.714285714286
stop 0.755102040816
stop 0.755102040816
stop 0.795918367347
stop 0.795918367347
stop 0.836734693878
stop 0.836734693878
stop 0.877551020408
stop 0.877551020408
stop 0.918367346939
stop 0.918367346939
stop 0.959183673469
stop 0.959183673469
stop 1.0
stop 1.0
stop 0.959183673469
stop 0.959183673469
stop 0.918367346939
stop 0.918367346939
stop 0.877551020408
stop 0.877551020408
stop 0.836734693878
stop 0.836734693878
stop 0.795918367347
stop 0.795918367347
stop 0.755102040816
stop 0.755102040816
stop 0.714285714286
stop 0.714285714286
stop 0.673469387755
stop 0.673469387755
stop 0.632653061224
stop 0.632653061224
stop 0.591836734694
stop 0.591836734694
stop 0.551020408163
stop 0.551020408163
stop 0.510204081633
stop 0.510204081633
stop 0.469387755102
stop 0.469387755102
stop 0.428571428571
stop 0.428571428571
stop 0.387755102041
stop 0.387755102041
stop 0.34693877551
stop 0.34693877551
stop 0.30612244898
stop 0.30612244898
stop 0.265306122449
stop 0.265306122449
stop 0.224489795918
stop 0.224489795918
stop 0.183673469388
stop 0.183673469388
stop 0.224489795918
stop 0.224489795918
stop 0.265306122449
stop 0.265306122449
stop 0.30612244898
stop 0.30612244898
stop 0.34693877551
stop 0.34693877551
stop 0.387755102041
stop 0.387755102041
stop 0.428571428571
stop 0.428571428571
stop 0.469387755102
stop 0.469387755102
stop 0.510204081633
stop 0.510204081633
stop 0.551020408163
stop 0.551020408163
stop 0.591836734694
stop 0.591836734694
stop 0.632653061224
stop 0.632653061224
stop 0.673469387755
stop 0.673469387755
stop 0.714285714286
stop 0.714285714286
stop 0.755102040816
stop 0.755102040816
stop 0.795918367347
stop 0.795918367347
stop 0.836734693878
stop 0.836734693878
stop 0.877551020408
stop 0.877551020408
stop 0.918367346939
stop 0.918367346939
stop 0.959183673469
stop 0.959183673469
stop 1.0
stop 1.0
stop 0.959183673469
stop 0.959183673469
stop 0.918367346939
stop 0.918367346939
stop 0.877551020408
stop 0.877551020408
stop 0.836734693878
stop 0.836734693878
stop 0.795918367347
stop 0.795918367347
stop 0.755102040816
stop 0.755102040816
stop 0.714285714286
stop 0.714285714286
stop 0.673469387755
stop 0.673469387755
stop 0.632653061224
stop 0.632653061224
stop 0.591836734694
stop 0.591836734694
stop 0.551020408163
stop 0.551020408163
stop 0.510204081633
stop 0.510204081633
stop 0.469387755102
stop 0.469387755102
stop 0.428571428571
stop 0.428571428571
stop 0.387755102041
stop 0.387755102041
stop 0.34693877551
stop 0.34693877551
stop 0.30612244898
stop 0.30612244898
stop 0.265306122449
stop 0.265306122449
stop 0.224489795918
stop 0.224489795918
stop 0.183673469388
stop 0.183673469388
stop 0.142857142857
stop 0.142857142857
stop 0.102040816327
stop 0.102040816327
stop 0.0612244897959
stop 0.0612244897959
stop 0.0204081632653
stop 0.0204081632653
stop -0.0
stop -0.0
stop 0.0408163265306
stop 0.0408163265306
stop 0.0816326530612
stop 0.0816326530612
stop 0.122448979592
stop 0.122448979592
stop 0.163265306122
stop 0.163265306122
stop 0.204081632653
stop 0.204081632653
stop 0.244897959184
stop 0.244897959184
stop 0.285714285714
stop 0.285714285714
stop 0.326530612245
stop 0.326530612245
stop 0.367346938776
stop 0.367346938776
stop 0.408163265306
stop 0.408163265306
stop 0.448979591837
stop 0.448979591837
stop 0.489795918367
stop 0.489795918367
stop 0.530612244898
stop 0.530612244898
stop 0.571428571429
stop 0.571428571429
stop 0.612244897959
stop 0.612244897959
stop 0.65306122449
stop 0.65306122449
stop 0.69387755102
stop 0.69387755102
stop 0.734693877551
stop 0.734693877551
stop 0.775510204082
stop 0.775510204082
stop 0.816326530612
stop 0.816326530612
stop 0.857142857143
stop 0.857142857143
stop 0.897959183673
stop 0.897959183673
stop 0.938775510204
stop 0.938775510204
stop 0.979591836735
stop 0.979591836735
stop 1.0
stop 1.0
stop 0.959183673469
stop 0.959183673469
stop 0.918367346939
stop 0.918367346939
stop 0.877551020408
stop 0.877551020408
stop 0.836734693878
stop 0.836734693878
stop 0.795918367347
stop 0.795918367347
stop 0.755102040816
stop 0.755102040816
stop 0.714285714286
stop 0.714285714286
stop 0.673469387755
stop 0.673469387755
stop 0.632653061224
stop 0.632653061224
stop 0.591836734694
stop 0.591836734694
stop 0.551020408163
stop 0.551020408163
stop 0.510204081633
stop 0.510204081633
stop 0.469387755102
stop 0.469387755102
stop 0.428571428571
stop 0.428571428571
stop 0.387755102041
stop 0.387755102041
stop 0.34693877551
stop 0.34693877551
stop 0.30612244898
stop 0.30612244898
stop 0.265306122449
stop 0.265306122449
stop 0.224489795918
stop 0.224489795918
stop 0.183673469388
stop 0.183673469388
stop 0.142857142857
stop 0.142857142857
stop 0.102040816327
stop 0.102040816327
stop 0.0612244897959
stop 0.0612244897959
stop 0.0204081632653
stop 0.0204081632653
stop -0.0
stop -0.0
Windows 8.1, sdl2, wheels, but this isn't platform related. I'm not really sure if this is what I had in mind back then, but try to click (only) in the ScrollView. Don't move or anything, just click.
-
click → when
0or1- start
- start
- stop
stop 1.05575978041 start 1.0 < start 1.0 stop 1.0 start 1.0 < start 1.0 stop 1.0 start 1.0 < start 1.0 stop 1.0 start 1.0 < start 1.0 stop 1.0 -
wheel scroll → when
0or1to the opposite direction- start (only)
start 1.0 start 1.0 start 1.0 start 1.0 or start 1.0 start -0.0 start 1.0 start -0.0 start 1.0 start -0.0 -
drag
- nothing wrong there most likely
When the end was reached (the issue), there was only start available in the console as I mentioned above:
start 0.142857142857
stop 0.102040816327
start 1.0
start 0.102040816327
stop 0.0612244897959
start 1.0
start 0.0612244897959
stop 0.0204081632653
start 1.0
start 0.0204081632653
stop -0.0
start 1.0
start -0.0
start 1.0
start -0.0
start 1.0
start -0.0
start 1.0
start -0.0
start 1.0
start -0.0
start 1.0
start -0.0
Yet if it's intended, then there's just an inconsistency between mouse wheel and dragging by touch.
Also there seems to be some strange thing with start's scroll_y, but I'm not sure if this is an issue too or if it's intended - printed twice and for two separate ends when scrolling down:
start 1.0
start -0.0
stop -0.0
start 1.0
start -0.0
stop -0.0
start 1.0
start -0.0
stop -0.0
start 1.0
start -0.0
stop -0.0
start 1.0
start -0.0
stop -0.0
start 1.0
start -0.0
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have the same issue on WIndows 10 pro with kivy 1.10
So basically, on_scroll_move do not work with mouse wheel.
It seem to work only by clicking and dragging the mouse on the RecycleView/ScrollView area.
Does anyone have any news for this problem?
Not sure if my issue is related but it's either this or the relative layout #6494
The same problem persists for me in version 1.11.1. I am using Linux as a development platform. Scrolling by dragging works, scrolling via mouse wheel not.
It persists. On my Windows 10 on_scroll_stop is never called when using mouse wheel and scroll_y reachs 0 or 1
from kivy.uix.gridlayout import GridLayout
from kivy.uix.button import Button
from kivy.uix.scrollview import ScrollView
from kivy.core.window import Window
from kivy.app import runTouchApp
layout = GridLayout(cols=1, spacing=10, size_hint_y=None)
# Make sure the height is such that there is something to scroll.
layout.bind(minimum_height=layout.setter('height'))
for i in range(100):
btn = Button(text=str(i), size_hint_y=None, height=40)
layout.add_widget(btn)
root = ScrollView(size_hint=(1, None), size=(Window.width, Window.height))
root.add_widget(layout)
root.bind(
on_scroll_start=lambda r, m: print('start', r.scroll_y),
on_scroll_move=lambda r, m: print('move', r.scroll_y),
on_scroll_stop=lambda r, m: print('stop', r.scroll_y)
)
runTouchApp(root)
This is an example from docs
I am having the same issue, scrolling by dragging works perfectly, yet scrolling with mouse wheel, nor with my laptop mousepad doesn't work. Does anyone know a workaround to make scrolling actually possible?
My experience (Windows 11, Kivy 2.2.1) is contrary to @ntaraujo's description.
on_scroll_stop is being called twice for every on_scroll_start:
e.g.
start 0.7129840546697038
stop 0.7084282460136674
stop 0.7084282460136674
start 0.7084282460136674
stop 0.7038724373576309
stop 0.7038724373576309
start 0.7038724373576309
stop 0.6993166287015945
stop 0.6993166287015945
@KeyWeeUsr: Is this resolved in Kivy 2.2.1?
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have the means to take action. Please reach out if you have or find the answers we need so that we can investigate further.