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

AltGr is mismapped to Alt key in Windows

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P4: Low
    • Resolution: Unresolved
    • Affects Version/s: 5.10.1
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      Windows
    • Commits:
      81d6cf71cc9202374a706305402a34dd1a06c2bd (qtbase/5.12, 21.8.2018, 5.12)

      Description

      When pressing the right Alt key in QMainWindow with the keyboard layout set to, say, Hungarian or German, the key is not properly detected as AltGr in QMainWindow's keyPressEvent() method.  Instead, it is detected as the Alt key.  Attached is an example that prints the key pressed when the key captured in keyPressEvent() is Alt or AltGr.  Set your keyboard to be Hungarian from WIndow's "Text Services and Input" dialog (available under the "Regions and Language" dialog -> "Keyboard and Languages" tab -> "Change Keyboards..." button).  From within the attached code's main window, press the right Alt key.  The code will incorrectly print "Alt pressed" to the console, when it should print "AltGr pressed".

      I cannot replicate this behavior in Linux (Qt 5.11.0).  It appears to only affect Windows.  I am using the MinGW version of Qt 5.10.1, if that helps.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              kleint Friedemann Kleint
              Reporter:
              wereturtle wereturtle
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes