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. Qtgamepad connections
Qt 6.11 is out! See what's new in the release blog

Qtgamepad connections

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtgamepad
2 Posts 1 Posters 551 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.
  • J Offline
    J Offline
    jhowland
    wrote on last edited by
    #1

    Ubuntu 16.04, QT 5.9.1, I am using a Logitech gamepad, and am able to access everything about it satisfactorily except for the connection state. I have tried using the available signals:

    connect(gamepad,SIGNAL(connectedChanged(bool)), this, SLOT(connectedChanged(bool)));

    and the corresponding signal/slot mechanism in qgamepadmanager, and when I pull the gamepad out of the USB slot, I never get the isgnal until I am quitting the application.

    In a slot triggered by a Qtimer, I query the connection state

    if(gamepad->isConnected())

    I always return true, whether or not the gamepad is pulled out or not.

    Since I want to use the gamepad to control a robot, I am quite concerned with the state of the device--I want to secure all my actuators and take other corrective action if the gamepad is pulled out of the USB slot.

    Is there something else I need to do? I find nothing else in the QT documentation referring to timeouts or anything similar.
    Thanks in advance for any help

    J 1 Reply Last reply
    0
    • J jhowland

      Ubuntu 16.04, QT 5.9.1, I am using a Logitech gamepad, and am able to access everything about it satisfactorily except for the connection state. I have tried using the available signals:

      connect(gamepad,SIGNAL(connectedChanged(bool)), this, SLOT(connectedChanged(bool)));

      and the corresponding signal/slot mechanism in qgamepadmanager, and when I pull the gamepad out of the USB slot, I never get the isgnal until I am quitting the application.

      In a slot triggered by a Qtimer, I query the connection state

      if(gamepad->isConnected())

      I always return true, whether or not the gamepad is pulled out or not.

      Since I want to use the gamepad to control a robot, I am quite concerned with the state of the device--I want to secure all my actuators and take other corrective action if the gamepad is pulled out of the USB slot.

      Is there something else I need to do? I find nothing else in the QT documentation referring to timeouts or anything similar.
      Thanks in advance for any help

      J Offline
      J Offline
      jhowland
      wrote on last edited by
      #2

      @jhowland I should have written Qgamepad, of course, not Qtgamepad

      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