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

QKeySequence does not handle Qt::Key_mu right

XMLWordPrintable

      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+Μ
      

        1. QTBUG-89620.tar.gz
          1 kB
        2. QTBUG-89620.patch
          3 kB
        3. findkey.py
          0.1 kB
        4. Belgian_keyboard_layout.png
          Belgian_keyboard_layout.png
          28 kB
        For Gerrit Dashboard: QTBUG-89620
        # Subject Branch Project Status CR V

            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

              Created:
              Updated:

                There are 2 open Gerrit changes