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 Monday, May 27th 2025

Handling input with OpenGL and Qt?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 401 Views
  • 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.
  • B Offline
    B Offline
    benjysugi
    wrote on 18 Nov 2022, 08:48 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
    • B benjysugi
      18 Nov 2022, 20:35

      @SGaist How do I handle input on a QWidget?

      C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 18 Nov 2022, 20:40 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
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 18 Nov 2022, 20:04 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

        B 1 Reply Last reply 18 Nov 2022, 20:35
        0
        • S SGaist
          18 Nov 2022, 20:04

          Hi,

          Are you thinking about QWindow ?

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

          B Offline
          B Offline
          benjysugi
          wrote on 18 Nov 2022, 20:35 last edited by
          #3

          @SGaist How do I handle input on a QWidget?

          C 1 Reply Last reply 18 Nov 2022, 20:40
          0
          • B benjysugi
            18 Nov 2022, 20:35

            @SGaist How do I handle input on a QWidget?

            C Offline
            C Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 18 Nov 2022, 20:40 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

            1/4

            18 Nov 2022, 08:48

            • Login

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