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. How can we block keyboard input in Qt?
Qt 6.11 is out! See what's new in the release blog

How can we block keyboard input in Qt?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 7.9k 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 writing an application that can block keyboard globally. i have searched in internet but i didn't find it.
    Thank you in advance.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Globally? As in your whole system?
      Qt does not support that (luckely!). I would hate any application stealing my input focus like that. You'll have to resort to platform specific tricks.

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

        You can use @QWidget::setEnabled(false)@ to disable mouse and keyboard events for a specific widget. Globally, you could try this thread: http://www.head-fi.org/t/100145/disable-keyboard-input-with-c-c. It talks about using c/c++ to disable keyboard input events, not sure why you would want to do that though.

        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