Unsolved Control + Shift + Key I
-
I have following code
Shortcut Key Ctrl +I for addition of Verification Objective
if (((modifiers == QtCore.Qt.ControlModifier) | (modifiers == QtCore.Qt.ShiftModifier )) & (event.key() == QtCore.Qt.Key_I)): self.addChildNode("A") elif (((modifiers == QtCore.Qt.ControlModifier ) | (modifiers == QtCore.Qt.ShiftModifier )) & (event.key() == QtCore.Qt.Key_T)): self.addSiblingNode("B ")
is not working
I want to impliment a binding and Binding key is Ctrl+Shift+I and other key binding Ctrl+Shift+k -
@Qt-Enthusiast said in Control + Shift + Key I:
if (((modifiers == QtCore.Qt.ControlModifier) | (modifiers == QtCore.Qt.ShiftModifier )) & (event.key() == QtCore.Qt.Key_I)):
It doesn't work like this! These are bitwise operations:
if (((modifiers & QtCore.Qt.ControlModifier) && (modifiers & QtCore.Qt.ShiftModifier)) && (event.key() == QtCore.Qt.Key_I)):
-
@Qt-Enthusiast it also helps listing to the correct key
QtCore.Qt.Key_T can never hit true for Ctrl+Shift+k
-
@jsulm
This is also not working(((modifiers & QtCore.Qt.ControlModifier) && (modifiers & QtCore.Qt.ShiftModifier)) && (event.key() == QtCore.Qt.Key_I))
This is not working .
-
@Qt-Enthusiast Well, you're using Python, right?
Shouldn't you change what I suggested toif ((modifiers & QtCore.Qt.ControlModifier) and (modifiers & QtCore.Qt.ShiftModifier) and (event.key() == QtCore.Qt.Key_I)):
?
-
@jsulm said in Control + Shift + Key I:
Well, you're using Python, right?
At least he tries to... I wonder why people think they can program in a language without knowing the simplest basics...
-
def keyPressEvent(self, event):
# when the user presses Tab Key
then the focus should go to next text box
modifiers = QtGui.QApplication.keyboardModifiers()
if ((modifiers & QtCore.Qt.ShiftModifier) and (event.key() == QtCore.Qt.Key_Tab)): -----> for Shift + key_tab
print("\n I am here in shift Modifies shift + Tab")
return
QtGui.QTextBrowser.keyPressEvent(self, event)
I am not able to get print print("\n I am here in shift Modifies shift + Tab"
Why any reason ?
Could you suggest correct