[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] Numpad shortcuts do not work anymore
From:       hgn <hgn () posteo ! org>
Date:       2019-04-14 15:36:33
Message-ID: 74e4a3b7f3dea165aaeb4eb573e20e84 () posteo ! de
[Download RAW message or body]

Hello,

for quite some time (maybe over a year?)  now numpad shortcuts are 
broken. In worked in the past.

These are shortcuts for the numpad keys, like the numbers, when the 
numpad is active (LED on keyboard is lit)

Tested on Python 3.7.3, PyQt5 5.12.1, 5.12.2

I have attached a python file that will enable you to see the problem. 
Run it from the terminal.

+hgn

P.S. I posted this to the Qt bugtracker when I first discovered it but 
they refused to even look at the bug because it was Python code. I am 
not able to write this example in C++.
["keypadmodifier-bug.py" (text/x-python)]

#! /usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
from PyQt5 import QtWidgets, QtGui, QtCore

qtApp = QtWidgets.QApplication(sys.argv)
widget = QtWidgets.QWidget()

print ("In the empty Qt window: Press Ctrl+1 to see 'Foo Bar',  press Numpad 1 (with \
numpad LED active) to see 'Hello World'. or not, because there is a bug")

########Relevant Code########
numpadAction = QtWidgets.QAction("Numpad")
widget.addAction(numpadAction) #no actions without a widget
numpadAction.setShortcut(QtGui.QKeySequence(QtCore.Qt.KeypadModifier+QtCore.Qt.Key_1)) \
#Numpad 1. Needs numpad LED activated. numpadAction.triggered.connect(lambda: print \
("Hello World"))

ctrlAction = QtWidgets.QAction("Control")
widget.addAction(ctrlAction) #no actions without a widget
ctrlAction.setShortcut(QtGui.QKeySequence(QtCore.Qt.ControlModifier+QtCore.Qt.Key_1)) \
#Ctrl+1 ctrlAction.triggered.connect(lambda: print ("Foo Bar"))
########Relevant Code End########

widget.show()
sys.exit(qtApp.exec_())


[Attachment #4 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic