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. disabling all keyboard input to a dialog
Forum Updated to NodeBB v4.3 + New Features

disabling all keyboard input to a dialog

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 359 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.
  • Kent-DorfmanK Offline
    Kent-DorfmanK Offline
    Kent-Dorfman
    wrote on last edited by Kent-Dorfman
    #1

    So I'm not really interesting in the reasons why this may or may not be a good idea...I have a use case where I navigate the dialog by mouse, and keys normally associated with dialog navigation are shortcutted to custom UI child widget invocation: up/down/left/right/pg-up/pg-dn need to ONLY DO what I make them do via a KeyReleaseEvent override. The UI is realized in the Ouptut.py class as follows:

    self.ui = Ui_Output()
    self.ui.setupUi(self) 
    

    The observed behaviour is that both my override AND the built-in dialog navigation functions are being executed. I want ALL dialog keyboard navigation functions disabled for the dialog and its child widgets! Only my KeyReleaseEvent handler should process keyboard input. The mouse must continue to function on available widgets. I cannot have right-right-right key sequence move focus to the dialog slider, where it is captured and (interpretted) by the slider widget, as an example.

    A flavor of this question was asked back in 2012 with no answers posted.

    How can I (with one fell swoop) disable keyboard navigation for my dialog and all its children?

    JonBJ 1 Reply Last reply
    0
    • Kent-DorfmanK Kent-Dorfman

      So I'm not really interesting in the reasons why this may or may not be a good idea...I have a use case where I navigate the dialog by mouse, and keys normally associated with dialog navigation are shortcutted to custom UI child widget invocation: up/down/left/right/pg-up/pg-dn need to ONLY DO what I make them do via a KeyReleaseEvent override. The UI is realized in the Ouptut.py class as follows:

      self.ui = Ui_Output()
      self.ui.setupUi(self) 
      

      The observed behaviour is that both my override AND the built-in dialog navigation functions are being executed. I want ALL dialog keyboard navigation functions disabled for the dialog and its child widgets! Only my KeyReleaseEvent handler should process keyboard input. The mouse must continue to function on available widgets. I cannot have right-right-right key sequence move focus to the dialog slider, where it is captured and (interpretted) by the slider widget, as an example.

      A flavor of this question was asked back in 2012 with no answers posted.

      How can I (with one fell swoop) disable keyboard navigation for my dialog and all its children?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Kent-Dorfman
      +1 for your command of the English language to (correctly) use "one fell swoop", and not the spelling so often found which refers to football or chickens... :)

      In a single word, is the way to achieve your desired behaviour by defining an eventFilter() on the dialog, where you can select which events to handle/pass on and which to ignore?

      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