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

Capture keyboard exclusively

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 938 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.
  • M Offline
    M Offline
    Max13
    wrote on last edited by
    #1

    I have a USB barcode scanner presented to the OS as a keyboard. I need to capture exclusive use of the barcode scanner to avoid some issues:

    • Users have very very very very little knowledge of using a computer. We teach them how to scan barcodes and that's really all they have to do.
    • Users don't use the same keyboard mapping as the scanner, so sometimes the OS doesn't switch back. Users are confused and they stop working.
    • We employ an external team, their company manages who they send us and they often rotate. So training them to focus on the app, reopen the app, use the barcode, change the keyboard mapping if the taskbar shows "FR" instead of "EN", etc… It's time-consuming when you have to train them every 2 or 3 days when they rotate.

    I had 2 solutions in mind, make an arduino-like device with usb-host capture the barcode scanner then use the arduino as a serial device (which allows me to open it exclusively), or capture (if possible) the barcode scanner exclusively. Is there a way to capture an HID device exclusively by an app Qt style (cross platform) ?

    We all have started by asking questions. Then after some time, we can begin answering them.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      What os do you run on ?
      For win 10, you could change layout in the app so the system layout wont matter.

      M 1 Reply Last reply
      0
      • mrjjM mrjj

        Hi
        What os do you run on ?
        For win 10, you could change layout in the app so the system layout wont matter.

        M Offline
        M Offline
        Max13
        wrote on last edited by
        #3

        @mrjj MacOS, Windows XP, Windows 7 and 10. They often have to switch to another app (which actually focuses itself sometimes) and they scan in this app without switching, so they send the barcodes to other apps and don’t raise the correct app to scan again. That’s why I would like to capture the scanner

        We all have started by asking questions. Then after some time, we can begin answering them.

        mrjjM 1 Reply Last reply
        0
        • M Max13

          @mrjj MacOS, Windows XP, Windows 7 and 10. They often have to switch to another app (which actually focuses itself sometimes) and they scan in this app without switching, so they send the barcodes to other apps and don’t raise the correct app to scan again. That’s why I would like to capture the scanner

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Max13
          Hi
          When you also need to support XP, i think using a arduino-ish device as scan station will be the most cost effective in both up front price and
          long term maintenance.

          As far as I know Qt cannot capture a HID. outside of grabKeyboard() you would have to resort to platform native tricks or
          direct USB reading.

          M 1 Reply Last reply
          0
          • mrjjM mrjj

            @Max13
            Hi
            When you also need to support XP, i think using a arduino-ish device as scan station will be the most cost effective in both up front price and
            long term maintenance.

            As far as I know Qt cannot capture a HID. outside of grabKeyboard() you would have to resort to platform native tricks or
            direct USB reading.

            M Offline
            M Offline
            Max13
            wrote on last edited by
            #5

            @mrjj Well… If I end up capturing an HID device exclusively, using native code, then it shouldn't cost much. Using an arduino-ish needs an arduino and a USB host on this device to make it a serial port. For now, I think costs would be equivalent (no device but more time using native code, device but less time using QSerialPort.

            Thanks for your input

            We all have started by asking questions. Then after some time, we can begin answering them.

            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