Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Control + Shift + Key I

Control + Shift + Key I

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 1.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qt Enthusiast
    wrote on last edited by
    #1

    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

    jsulmJ J.HilkJ 2 Replies Last reply
    0
    • Q Qt Enthusiast

      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

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @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)):
      

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      Q 1 Reply Last reply
      6
      • Q Qt Enthusiast

        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

        J.HilkJ Online
        J.HilkJ Online
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @Qt-Enthusiast it also helps listing to the correct key

        QtCore.Qt.Key_T can never hit true for Ctrl+Shift+k


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply
        5
        • jsulmJ jsulm

          @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)):
          
          Q Offline
          Q Offline
          Qt Enthusiast
          wrote on last edited by
          #4

          @jsulm
          This is also not working

          (((modifiers & QtCore.Qt.ControlModifier) && (modifiers & QtCore.Qt.ShiftModifier)) && (event.key() == QtCore.Qt.Key_I))

          This is not working .

          jsulmJ 1 Reply Last reply
          0
          • Q Qt Enthusiast

            @jsulm
            This is also not working

            (((modifiers & QtCore.Qt.ControlModifier) && (modifiers & QtCore.Qt.ShiftModifier)) && (event.key() == QtCore.Qt.Key_I))

            This is not working .

            jsulmJ Online
            jsulmJ Online
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Qt-Enthusiast Well, you're using Python, right?
            Shouldn't you change what I suggested to

            if ((modifiers & QtCore.Qt.ControlModifier) and (modifiers & QtCore.Qt.ShiftModifier) and (event.key() == QtCore.Qt.Key_I)):
            

            ?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            2
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @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...

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              2
              • Q Offline
                Q Offline
                Qt Enthusiast
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved