Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-76144

QKeyEvent: shift modifier not consumed

    XMLWordPrintable

Details

    • Linux/Wayland, Linux/X11

    Description

      Key events do not seems to be correctly consuming modifiers.

      Specifically, to enter '+' on my British keyboard requires 'Shift+='; the key event resulting from this gives '+' from key(), so clearly has consumed the shift, but yet modifiers() still reports the shift key as having been held (not consumed).

      I have arrived here from investigating a bug I noticed in VLC's hotkey editing facilities, whereby trying to assign '+' results in 'Shift++', an impossible sequence. This is due to 1) VLC does not currently use QKeySequenceEdit, and 2) VLC combines the reported key and modifiers in the event in order to capture what the user entered, which is necessary to take, for instance, 'Ctrl+O'.

      I did consider that perhaps the solution might be to not combine the shift modifier in the event handler, but then I'm at all not certain that is necessarily the correct fix. Fundamentally it seems that there is no way at all to get at the right information from the event. I have to presume that the shift modifier being marked in the event in this case is due to a Qt bug.

      edit: I had a lot of trouble writing this report, the damn silly form here, trying to be clever, kept eating sequences of plus then apostrophe, underlining things and such, in both 'visual' mode and 'text' mode, which was incredible frustrating; as a programmer I eventually tried escaping the plus with a backslash which worked, but this was far from ideal :/

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            liaqi Liang Qi
            jnqnfe Lyndon Brown
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes