Macs historically have not shipped with multibutton mice, so on OS X it is expected to be able to open context menus with Ctrl+click. However this does not work in OmegaT.
The way we are detecting the context menu trigger is not correct for proper cross-platform behavior:
new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.isPopupTrigger() || e.getButton() == MouseEvent.BUTTON3) {
// show context menu
}
}
}
Documentation for MouseEvent.isPopupTrigger() says:
Note: Popup menus are triggered differently on different systems. Therefore,
isPopupTriggershould be checked in bothmousePressedandmouseReleasedfor proper cross-platform functionality.
Corrected behavior:
new MouseAdapter() {
public void mousePressed(MouseEvent e) {
if (e.isPopupTrigger()) {
// show context menu
}
}
public void mouseReleased(MouseEvent e) {
if (e.isPopupTrigger()) {
// show context menu
}
}
}
This correctly detects context menu triggers on all platforms, including OS X.
Fixed in the released version 4.0 of OmegaT.
Didier