raspberry.pi
raspberry.pi

Reputation: 593

PyQt - Capture Windows Key

I'm trying to catch the windows key because it keeps exiting out of my pyqt application because on windows 8 it takes you back to start screen i want to disable that i have:

def keyPressEvent(self, e):
    if e.key() == QtCore.Qt.Key_'need windows key name here':
        pass

but i dont know what the windows key name is ive tried just key_windows but that didnt work can someone point me to a list of all the keys? or tell me what the key is? thanks

Upvotes: 0

Views: 909

Answers (2)

Radio-
Radio-

Reputation: 3171

Here is a link to the different keys, and according to that page,

On Windows Keyboards, Qt::MetaModifier and Qt::Key_Meta are mapped to the Windows key.

Upvotes: 1

falsetru
falsetru

Reputation: 369094

Key_Super_L and Key_Super_R

def keyPressEvent(self, e):
    if e.key() in (QtCore.Qt.Key_Super_L, QtCore.Qt.Key_Super_R):
        pass

Upvotes: 0

Related Questions