Bug 40474 - [Qt] In Carbon event model, control & command modifiers are reversed
Summary: [Qt] In Carbon event model, control & command modifiers are reversed
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 420+
Hardware: Mac (Intel) OS X 10.6
: P3 Normal
Assignee: Nobody
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2010-06-11 05:18 PDT by qt-info
Modified: 2014-01-14 09:21 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description qt-info 2010-06-11 05:18:13 PDT
In the Carbon event model, the modifier flags for the control & command keys are reversed. 

When an event is received in NPP_HandleEvent, in the EventRecord's "modifiers" field, the cmdKey bit (from the classic Events.h header file) is set when the control key is pressed, and the controlKey bit is set when the command key is pressed.

The Qt API does this by default, but this problem pertains to the NPAPI part of WebKit, which has its own standards independent of Qt. 

To illustrate further, imagine what happens if a plugin supports the Carbon event model from multiple browsers, one of them being Qt's WebKit. The non-Qt browsers would set the cmdKey bit for the command key, which doesn't match what Qt's WebKit does. So the plugin would have to swap the meaning of cmdKey and controlKey only for Qt (probably by examining the user agent).

(Bug reported against Qt version 4.6.2)