Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Rotary encoder problem
Qt 6.11 is out! See what's new in the release blog

Rotary encoder problem

Scheduled Pinned Locked Moved Unsolved General and Desktop
14 Posts 4 Posters 1.9k Views 2 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.
  • A Offline
    A Offline
    allanbic
    wrote on last edited by
    #5

    Yes, I have some knobs connected to the application, which increment or decrement with the rotation. It's a lung ventilator project, each knob has a function, such as: tidal volume, frequency, flow, peep, limit pressure... when I click on the screen, I can control these knobs through the left and right keys, however I would like to use an encoder for this and also keep the keys working!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #6

      That is clear and understood. What you are not answering is: how is onKeyPress called ?
      What is the flow between your encoder back to your GUI ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        allanbic
        wrote on last edited by
        #7

        connect(parent, SIGNAL(KeyPress(int)),this,SLOT(onKeyPress(int)));
        Is it?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #8

          Then how is KeyPress emitted ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Offline
            A Offline
            allanbic
            wrote on last edited by
            #9

            By KeyPressEvent(QKeyEvent * e).

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mchinand
              wrote on last edited by
              #10

              What is the output from the rotary encoder that your application can respond to? Does it appear as a keyboard to the OS?

              A 1 Reply Last reply
              0
              • A Offline
                A Offline
                Anonymous_Banned275
                wrote on last edited by
                #11

                Doesn't rotary encoder outputs min of two "digits" ? Then you compare previous to current output to determine direction of rotation and from that derive "up or down " value to be added / deleted .

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  allanbic
                  wrote on last edited by allanbic
                  #12

                  @mchinand Hi, how are you? Have a great day. No, It is found as rotary encoder even by the operating system, but the qt app was configured to detect only the keyboard keys, and I would like to make the keyboard and the encoder work simultaneously. But I'm not sure how to make the encoder work in the qt application.

                  1 Reply Last reply
                  0
                  • M mchinand

                    What is the output from the rotary encoder that your application can respond to? Does it appear as a keyboard to the OS?

                    A Offline
                    A Offline
                    allanbic
                    wrote on last edited by allanbic
                    #13

                    @AnneRanch , Thanks for your answer! The problem is that I don't know how to add the encoder functions in my application. It is already working on the OS, but I don't know how to call it in the app...

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #14

                      Can you explain how it is "working with the OS" ?
                      How would you retrieve the data ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      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
                      • Unsolved