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

QKeySequence does not handle Qt::Key_mu right

    XMLWordPrintable

Details

    Description

      When using QKeySequence with a µ key, it is replaced by M which is not the same key.
      When entering Ctrl+µ, QKeySequence replace it with Ctrl+M.

      This is on a Belgian keyboard where M and µ key are not the same.
      See https://en.wikipedia.org/wiki/File:Belgian_keyboard_layout.png

      This is probably caused by this line:
      https://code.woboq.org/qt5/qtbase/src/gui/kernel/qkeysequence.cpp.html#1176

      ret |= accelRef.at(0).toUpper().unicode();
      

      as QString("µ").toUpper() == "M".

      This can be reproduced with the attached python script findkey.py , which print this on my system:

      $ cat findkey.py 
      import PyQt5.QtGui as QtGui
      
      print("New QKeySequence: ", QtGui.QKeySequence("Ctrl+µ").toString(QtGui.QKeySequence.NativeText))
      $ python3 findkey.py 
      New QKeySequence:  Ctrl+Μ
      

      Attachments

        1. Belgian_keyboard_layout.png
          Belgian_keyboard_layout.png
          28 kB
        2. findkey.py
          0.1 kB
        3. QTBUG-89620.patch
          3 kB
        4. QTBUG-89620.tar.gz
          1 kB

        Issue Links

          For Gerrit Dashboard: QTBUG-89620
          # Subject Branch Project Status CR V

          Activity

            People

              cnn Qt Core & Network
              amurzeau Alexis Murzeau
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are 2 open Gerrit changes