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

Scrolling generates a mouse up event for previously pressed button instead of scrolling event #5058

Open
valsr opened this issue Mar 14, 2017 · 3 comments
Labels
Component: input kivy/input Status: Confirmed Confirmed as real issue Type: Bug A bug or something not working as intended

Comments

@valsr
Copy link

valsr commented Mar 14, 2017

Versions

  • Python: 3.4.3
  • OS: LinuxMint (17.3)
  • Kivy: 1.9.1
  • Kivy installation method: Package manager

Description

Attempted to use capture mouse wheel events while holding a button down (i.e. press left then scroll up/down using the mouse wheel). In essence kivy converts the first scroll up/down to a mouse up event of the previous button

Expected:

  1. Left button down event
  2. Mouse wheel event

Actual:

  1. Left button down event
  2. Left button up event
  3. (on continuing scrolling) Mouse wheel event

Code and Logs

To demonstrate:

  1. Run application
  2. Press and hold left mouse button
  3. Scroll the mouse wheel button once (while still holding the left mouse button)
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.textinput import TextInput

from kivy.app import App

class Example(App):

    def __init__(self, **kwargs):
        App.__init__(self, **kwargs)
        self.layout = None
        self.text = None

    def build(self):
        self.layout = BoxLayout()
        self.layout.bind(on_touch_down=self.on_touch_down)
        self.layout.bind(on_touch_up=self.on_touch_up)
        self.text = TextInput(multiline=True)
        self.layout.add_widget(self.text)

        return self.layout

    def on_touch_down(self, widget, touch):
        text = self.text.text
        text += "\n DOWN: " + touch.button
        self.text.text = text

    def on_touch_up(self, widget, touch):
        text = self.text.text
        text += "\n UP: " + touch.button
        self.text.text = text

if __name__ == '__main__':
    Example().run()
@dessant
Copy link
Contributor

dessant commented Mar 16, 2017

It's also not just a scroll issue and it's reproducible with any widget, here is another test case for the example:

  1. press and hold left mouse button
  2. press and release right mouse button

Expected:
DOWN: left
DOWN: right
UP: right

Actual (Kivy<=1.8.0):
DOWN: left

Actual (Kivy>=1.9.0):
DOWN: left
UP: left

EDIT: The behavior also changes between kivy versions.

@dessant dessant added the Status: Confirmed Confirmed as real issue label Mar 16, 2017
@dessant dessant added this to the 2.0.0 milestone Mar 16, 2017
@stale
Copy link

stale bot commented Oct 7, 2017

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.

@stale stale bot added the stale label Oct 7, 2017
@KeyWeeUsr KeyWeeUsr removed the stale label Oct 15, 2017
@baboosh
Copy link

baboosh commented Jan 12, 2018

m

vchslv13 added a commit to vchslv13/kivy that referenced this issue Mar 18, 2019
@matham matham removed this from the 2.0.0 milestone Oct 28, 2020
@Julian-O Julian-O added Component: input kivy/input Type: Bug A bug or something not working as intended labels Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: input kivy/input Status: Confirmed Confirmed as real issue Type: Bug A bug or something not working as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants