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 348 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.
  • K Offline
    K Offline
    Kent-Dorfman
    wrote on 2 Jan 2022, 02:56 last edited by Kent-Dorfman 1 Feb 2022, 03:01
    #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?

    J 1 Reply Last reply 2 Jan 2022, 08:23
    0
    • K Kent-Dorfman
      2 Jan 2022, 02:56

      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?

      J Online
      J Online
      JonB
      wrote on 2 Jan 2022, 08:23 last edited by JonB 1 Feb 2022, 09:18
      #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

      1/2

      2 Jan 2022, 02:56

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved