enthought/enable — Issue #37: Issues with KeyEvent on Mac OS X
Author: pberkes
Created: 2011-10-24 22:54:08+00:00
State: open

There are a few issues with KeyEvent on Mac:

1) Qt swaps the Ctrl and the Cmd key, while wx does not. As a result, KeyEvent.control_down is set to different values for the same key press on the two backends

2) There is no flag for the Cmd key in KeyEvent

3) In wx, Cmd is mapped to '\x00' instead of 'Menu'

4) In wx, in a combination of Ctrl and letter, the 'key' attribute is set to a unicode instead of the letter. For example, Ctrl-C results in control_down=True (correct), but key='\x03' (should be u'c').

You can use this UI to have a look at KeyEvents in different toolkits, and to preview the proposed new behavior:
https://gist.github.com/1310607

I'm about to submit a pull request from branch 'fix_ctrl_cmd' that should fix 1-4.