Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. JoyStick integration in QT
Qt 6.11 is out! See what's new in the release blog

JoyStick integration in QT

Scheduled Pinned Locked Moved Game Development
9 Posts 5 Posters 23.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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I'm undergraduate student. I'm working on a project. My project is about Game development using QT. But I found that this nice graphic library not have integration for Joystick.
    My Question is that how I can use Joystick in QT base Programs? Is there any Class for Joystick? Can anyone send me example code implementation for joystick I QT?

    1 Reply Last reply
    0
    • I Offline
      I Offline
      irfan.omair
      wrote on last edited by
      #2

      Well there is no any class for this in Qt. You may have to use some thirdparty lib as I know "SDL":http://http://plib.sf.net is the one which has this support.

      See if this "example":http://www.fredemmott.co.uk/blog/2009/07/23/Accessing joysticks with Qt helps you.

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        @ Mr.Irfan: Thanks for answer my question. I can not open the link which you have mention above. Can you write again the links for SDL and SDL Example.

        1 Reply Last reply
        0
        • I Offline
          I Offline
          irfan.omair
          wrote on last edited by
          #4

          Ah here it is again "SDL":http://plib.sf.net
          http://www.fredemmott.co.uk/blog/2009/07/23/Accessing joysticks with Qt

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            @ Mr.Irfan:- Finaly I got it. I'll remain in you contact for future Joystick help. Thank for Great Help.

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              The one Other way could think of writing own class which interacts with joystick using joystick driver and QIoDevice, how is joy stick connected with your machine? is that using RS232? then you can get input on IODevice?

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                @ Mr. Immii :- I think this idea is also good. Can you guide me further on this method? Can anyone give me more details on above topic? I mean tools or examples or other resources which can help to understand QioDevice and Joystick DRIVER? I'll try both of these methods to use joystick in QT and check which method is best for me.

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  jhowland
                  wrote on last edited by
                  #8

                  another option--a little lame, but it works.

                  python has a games module. Use python to access your joystick, and another communication method (I used a UDP socket) to send joy data to your application

                  1 Reply Last reply
                  0
                  • ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by
                    #9

                    Another option that you might want to consider is using SFML.
                    http://www.sfml-dev.org/

                    SFML is a free multimedia C++ API that provides you low and high level access to graphics, input, audio, etc.

                    Here is a tutorial on how to integrate it into Qt.
                    http://www.sfml-dev.org/tutorials/1.6/graphics-qt.php

                    And here is the input class.
                    http://www.sfml-dev.org/documentation/1.6/classsf_1_1Input.htm

                    1 Reply Last reply
                    1

                    • Login

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