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. Mac OS Option Key cannot be used for AltModifier
QtWS25 Last Chance

Mac OS Option Key cannot be used for AltModifier

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.5k Views
  • 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.
  • D Offline
    D Offline
    dcortesi
    wrote on 4 Apr 2014, 00:55 last edited by
    #1

    (Edit: Changed the title to highlight the root issue. In Qt4.x, the Mac user who pressed Option+key produced that key, e.g. Key_3, with AltModifier. This was platform-independent, the app got the identical keyEvent values in any platform with a defined Alt key. Now in 5.x, the values from Mac OS are different from other platforms. This breaks platform independence with respect to keyPressEvent processing.)

    I am working on Mac OSX 10.9. I have an existing app based on Qt4 and am rewriting it for Qt5.

    A widget with a keyPressEvent() method gets different values in the keyEvent. In the Qt4 version, when I press the Option and 3 keys together, the event contains Key_3 and Alt_Modifier. In Qt5.2, the same code receives Key_sterling (0xa3) and Alt_Modifier.

    Now, the Mac OS does support users entering special characters using the Option key. If you open the Mac Keyboard Viewer and hold down Option, yes, it shows the pound sterling symbol on the 3 key. But the Qt4-based code, in the exact same OS environment, gets the "raw" keystroke value in its keyEvent, while the Qt5-based code gets the "cooked" version.

    Is this an intentional change in the key event handling for Qt5? Is there any way of turning it off and going back to the previous behavior? I have looked at http://qt-project.org/doc/qt-5/macosx-issues.html and don't see anything relevant.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 12 Apr 2014, 22:09 last edited by
      #2

      Hi,

      Did you also took a look at the "bug report system":http://bugreports.qt-project.org ?

      If you can't find anything, please open a new report providing a minimal compilable examples that shows the problem.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

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