Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Distinguish input from virtual keyboard and real keyboard

Distinguish input from virtual keyboard and real keyboard

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 2 Posters 413 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.
  • M Offline
    M Offline
    mr_max
    wrote on last edited by
    #1

    I am developing an embedded application (with Qt 5 on Linux) in which users can input text on a touch screen with Qt's virtual keyboard. At the same time, a USB barcode scanner is attached which acts as a USB keyboard. Its data shall be processed independently, even while a user is typing on the virtual keyboard. Unfortunately, I receive KeyPress events from both of them. Is there a way to distinguish between events from the "real" (USB) and virtual keyboards so that I can filter the data?

    raven-worxR 1 Reply Last reply
    0
    • M mr_max

      I am developing an embedded application (with Qt 5 on Linux) in which users can input text on a touch screen with Qt's virtual keyboard. At the same time, a USB barcode scanner is attached which acts as a USB keyboard. Its data shall be processed independently, even while a user is typing on the virtual keyboard. Unfortunately, I receive KeyPress events from both of them. Is there a way to distinguish between events from the "real" (USB) and virtual keyboards so that I can filter the data?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @mr_max
      most barcodescanner can be switched to serial mode, e.g. by scanning a special barcode (see the scanners manual).
      then you must use QtSerialPort module to connect to the scanner via the serial port and receive the input.

      there is no other way to distinguish, since the driver integrates with the OS's input system (like a keyboard)

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      2
      • M Offline
        M Offline
        mr_max
        wrote on last edited by
        #3

        Thank you for the suggestion, @raven-worx . I eventually did it that way.

        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