Mouse wheel event's angleDelta().y() always 0 with Alt key modifier

Tobias Megies megies at
Fri Nov 25 09:01:39 GMT 2022

Hi all,

I'm experiencing a bug with pyqt, although to be fair, I can not say if 
it is a pyqt or qt problem. I reported this in the wrong place first so 
please look at this for more detailed description:

When Alt key is held down, mouse wheel events always report 0 for 
"angleDelta().y()", i.e. it is impossible to tell in which direction the 
mouse wheel was scrolled. Not sure if Alt is the only affected modifier, 
in any case some other common keys like shift or control are not affected.

Minimal example code to reproduce:

import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QLabel, QMainWindow

class MainWindow(QMainWindow):
     def __init__(self):
         self.label = QLabel("scroll mouse wheel here")

     def wheelEvent(self, e):
         info = [
             "wheel event",
             "modifier: %d" % e.modifiers(),
             "angleDelta.y: %d" % e.angleDelta().y(),

app = QApplication(sys.argv)
window = MainWindow()

Steps to reproduce:
  - scroll mouse wheel over the shown label, shows +120 / -120 for
    scrolling up/down
  - scroll mouse wheel over the shown label with Alt key held down, shows
    0 / 0 scrolling up/down

Just verified bug is still present in most recent versions available 
through conda-forge.

pyqt                      5.15.7          py311h3408d8f_2    conda-forge
pyqt5-sip                 12.11.0         py311ha362b79_2    conda-forge
qt-main                   5.15.6               h7acdfc8_2    conda-forge

-------------- next part --------------
A non-text attachment was scrubbed...
Type: text/x-python
Size: 605 bytes
Desc: not available
URL: <>

More information about the PyQt mailing list