adobe/brackets — pull request #1079 by peterflynn (2012-06-20 00:32:14+00:00)
Title: Support Windows context menu key

In general, anything using mouse coords for purposes other than menu positioning should use mousedown, while the menu itself should be popped up via contextmenu.

In the case of our editor context menu, it turns out that the special processing we were doing with mouse position and selection is already done by CodeMirror too (see onContextMenu()), so in this case we can simply remove that logic instead of creating an additional mousedown handler.

This renders unused several Editor APIs that were recently added to support the above logic. I removed one that seemed less useful, and cleaned up/renamed the other two.

_Caveat:_ when using the context menu key, menu position is not always that nice. This is due to CodeMirror bugs: it doesn't always update the pos of the focused textarea at the right times. However, the pos of the menu when opened via keyboard is often poor in other apps too.