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. Handling input with OpenGL and Qt?
Forum Update on Tuesday, May 27th 2025

Handling input with OpenGL and Qt?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 403 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.
  • benjysugiB Offline
    benjysugiB Offline
    benjysugi
    wrote on last edited by benjysugi
    #1

    How would I handle input with OpenGL in Qt (keyboard, mouse position, mouse button, etc)

    In GLFW there's glfwSetKeyCallback(), glfwSetCursorPosCallback() and glfwSetMouseButtonCallback(). Are there any equivalents or something similar?

    How would I go about doing this?

    Another thing I would like to know is if there's an equivalent to glfwGetTime()

    Thanks,

    1 Reply Last reply
    0
    • benjysugiB benjysugi

      @SGaist How do I handle input on a QWidget?

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #4

      @benjysugi said in Handling input with OpenGL and Qt?:

      How do I handle input on a QWidget?

      QWidget has e.g. mosuePressEvent() and others.

      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
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        Are you thinking about QWindow ?

        If so, it provides the same interface as QWidget for handling mouse and keyboard.

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

        benjysugiB 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Are you thinking about QWindow ?

          If so, it provides the same interface as QWidget for handling mouse and keyboard.

          benjysugiB Offline
          benjysugiB Offline
          benjysugi
          wrote on last edited by
          #3

          @SGaist How do I handle input on a QWidget?

          Christian EhrlicherC 1 Reply Last reply
          0
          • benjysugiB benjysugi

            @SGaist How do I handle input on a QWidget?

            Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @benjysugi said in Handling input with OpenGL and Qt?:

            How do I handle input on a QWidget?

            QWidget has e.g. mosuePressEvent() and others.

            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
            0

            • Login

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